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::component::properties< Tp > Struct Template Reference

This is a critical specialization for mapping string and integers to component types at runtime. The enum_string() function is the enum id as a string. The id() function is (typically) the name of the C++ component as a string. The ids() function returns a set of strings which are alternative string identifiers to the enum string or the string ID. Additionally, it provides serializaiton of these values. More...

#include "timemory/components/properties.hpp"

+ Collaboration diagram for tim::component::properties< Tp >:

Public Types

using type = Tp
 
using value_type = TIMEMORY_COMPONENT
 

Public Member Functions

template<typename Archive >
void serialize (Archive &, const unsigned int)
 
TIMEMORY_COMPONENT operator() ()
 
constexpr operator TIMEMORY_COMPONENT () const
 

Static Public Member Functions

static constexpr bool specialized ()
 
static constexpr const char * enum_string ()
 
static constexpr const char * id ()
 
static idset_t ids ()
 

Static Public Attributes

static constexpr TIMEMORY_COMPONENT value = TIMEMORY_COMPONENTS_END
 

Detailed Description

template<typename Tp>
struct tim::component::properties< Tp >

This is a critical specialization for mapping string and integers to component types at runtime. The enum_string() function is the enum id as a string. The id() function is (typically) the name of the C++ component as a string. The ids() function returns a set of strings which are alternative string identifiers to the enum string or the string ID. Additionally, it provides serializaiton of these values.

Template Parameters
TpComponent type

A macro is provides to simplify this specialization:

"real_clock", "virtual_clock")
#define TIMEMORY_PROPERTY_SPECIALIZATION(TYPE, ENUM, ID,...)
Specialization of the property specialization.
Definition: macros.hpp:223
#define TIMEMORY_WALL_CLOCK
Definition: enum.h:632

In the above, the first parameter is the C++ type, the second is the enumeration id, the enum string is automatically generated via preprocessor # on the second parameter, the third parameter is the string ID, and the remaining values are placed in the ids(). Additionally, this macro specializes the tim::component::enumerator.

Definition at line 213 of file properties.hpp.

Member Typedef Documentation

◆ type

template<typename Tp >
using tim::component::properties< Tp >::type = Tp

Definition at line 215 of file properties.hpp.

◆ value_type

Definition at line 216 of file properties.hpp.

Member Function Documentation

◆ enum_string()

template<typename Tp >
static constexpr const char * tim::component::properties< Tp >::enum_string ( )
inlinestaticconstexpr

Definition at line 220 of file properties.hpp.

220{ return "TIMEMORY_COMPONENTS_END"; }

◆ id()

template<typename Tp >
static constexpr const char * tim::component::properties< Tp >::id ( )
inlinestaticconstexpr

◆ ids()

template<typename Tp >
static idset_t tim::component::properties< Tp >::ids ( )
inlinestatic

Definition at line 222 of file properties.hpp.

222{ return idset_t{}; }
std::set< std::string > idset_t
Definition: properties.hpp:54

◆ operator TIMEMORY_COMPONENT()

template<typename Tp >
constexpr tim::component::properties< Tp >::operator TIMEMORY_COMPONENT ( ) const
inlineconstexpr

Definition at line 228 of file properties.hpp.

228{ return TIMEMORY_COMPONENTS_END; }
#define TIMEMORY_COMPONENTS_END
Definition: enum.h:155

References TIMEMORY_COMPONENTS_END.

◆ operator()()

template<typename Tp >
TIMEMORY_COMPONENT tim::component::properties< Tp >::operator() ( )
inline

Definition at line 226 of file properties.hpp.

226{ return TIMEMORY_COMPONENTS_END; }

References TIMEMORY_COMPONENTS_END.

◆ serialize()

template<typename Tp >
template<typename Archive >
void tim::component::properties< Tp >::serialize ( Archive &  ,
const unsigned int   
)
inline

Definition at line 224 of file properties.hpp.

225 {}

◆ specialized()

template<typename Tp >
static constexpr bool tim::component::properties< Tp >::specialized ( )
inlinestaticconstexpr

Definition at line 219 of file properties.hpp.

219{ return false; }

Member Data Documentation

◆ value

template<typename Tp >
constexpr TIMEMORY_COMPONENT tim::component::properties< Tp >::value = TIMEMORY_COMPONENTS_END
staticconstexpr

Definition at line 217 of file properties.hpp.


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