timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::operation::get_depth< T, DefaultDepth > Struct Template Reference

This operation attempts to call a member function which provides a depth value. More...

#include "timemory/operations/types.hpp"

+ Collaboration diagram for tim::operation::get_depth< T, DefaultDepth >:

Public Member Functions

template<typename Up , enable_if_t<!std::is_pointer< decay_t< Up > >::value, int > = 0>
auto operator() (Up &obj) const
 
template<typename Up , enable_if_t< std::is_pointer< decay_t< Up > >::value, int > = 0>
auto operator() (Up obj) const
 

Detailed Description

template<typename T, int64_t DefaultDepth = 0>
struct tim::operation::get_depth< T, DefaultDepth >

This operation attempts to call a member function which provides a depth value.

Template Parameters
TComponent type
DefaultDepthvalue to return if get_depth() function not available

Definition at line 741 of file types.hpp.

Member Function Documentation

◆ operator()() [1/2]

template<typename T , int64_t DefaultDepth = 0>
template<typename Up , enable_if_t<!std::is_pointer< decay_t< Up > >::value, int > = 0>
auto tim::operation::get_depth< T, DefaultDepth >::operator() ( Up &  obj) const
inline

Definition at line 746 of file types.hpp.

747 {
748 static_assert(!std::is_pointer<Up>::value,
749 "SFINAE tests will always fail with pointer types");
750 return sfinae(obj, 0, 0);
751 }

◆ operator()() [2/2]

template<typename T , int64_t DefaultDepth = 0>
template<typename Up , enable_if_t< std::is_pointer< decay_t< Up > >::value, int > = 0>
auto tim::operation::get_depth< T, DefaultDepth >::operator() ( Up  obj) const
inline

Definition at line 754 of file types.hpp.

755 {
756 if(!obj)
757 return DefaultDepth;
758
759 return sfinae(*obj, 0, 0);
760 }

The documentation for this struct was generated from the following file: