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::enumerator< Idx > Struct Template Reference

This is a critical specialization for mapping string and integers to component types at runtime (should always be specialized alongside tim::component::properties) and it is also critical for performing template metaprogramming "loops" over all the components. E.g.: More...

#include "timemory/components/properties.hpp"

+ Collaboration diagram for tim::component::enumerator< Idx >:

Public Types

using type = placeholder< nothing >
 
using value_type = TIMEMORY_COMPONENT
 

Public Member Functions

bool operator== (int) const
 
bool operator== (const char *) const
 
bool operator== (const std::string &) const
 
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 bool value = false
 

Detailed Description

template<int Idx>
struct tim::component::enumerator< Idx >

This is a critical specialization for mapping string and integers to component types at runtime (should always be specialized alongside tim::component::properties) and it is also critical for performing template metaprogramming "loops" over all the components. E.g.:

Template Parameters
IdxEnumeration value
template <size_t Idx>
using Enumerator_t = typename tim::component::enumerator<Idx>::type;
template <size_t... Idx>
auto init(std::index_sequence<Idx...>)
{
// expand for [0, TIMEMORY_COMPONENTS_END)
Enumerator_t<Idx>>());
}
void init()
{
init(std::make_index_sequence<TIMEMORY_COMPONENTS_END>{});
}
void init(Args &&... args)
Definition: types.hpp:111
provides nothing, used for dummy types in enum
Definition: placeholder.hpp:44
static storage_initializer get()
#define TIMEMORY_FOLD_EXPRESSION(...)
Definition: types.hpp:56

Definition at line 260 of file properties.hpp.

Member Typedef Documentation

◆ type

template<int Idx>
using tim::component::enumerator< Idx >::type = placeholder<nothing>

Definition at line 262 of file properties.hpp.

◆ value_type

Definition at line 216 of file properties.hpp.

Member Function Documentation

◆ enum_string()

static constexpr const char * tim::component::properties< placeholder< nothing > >::enum_string ( )
inlinestaticconstexprinherited

Definition at line 220 of file properties.hpp.

220{ return "TIMEMORY_COMPONENTS_END"; }

◆ id()

static constexpr const char * tim::component::properties< placeholder< nothing > >::id ( )
inlinestaticconstexprinherited

Definition at line 221 of file properties.hpp.

221{ return ""; }

◆ ids()

static idset_t tim::component::properties< placeholder< nothing > >::ids ( )
inlinestaticinherited

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()

constexpr tim::component::properties< placeholder< nothing > >::operator TIMEMORY_COMPONENT ( ) const
inlineconstexprinherited

Definition at line 228 of file properties.hpp.

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

◆ operator()()

TIMEMORY_COMPONENT tim::component::properties< placeholder< nothing > >::operator() ( )
inlineinherited

Definition at line 226 of file properties.hpp.

226{ return TIMEMORY_COMPONENTS_END; }

◆ operator==() [1/3]

template<int Idx>
bool tim::component::enumerator< Idx >::operator== ( const char *  ) const
inline

Definition at line 266 of file properties.hpp.

266{ return false; }

◆ operator==() [2/3]

template<int Idx>
bool tim::component::enumerator< Idx >::operator== ( const std::string &  ) const
inline

Definition at line 267 of file properties.hpp.

267{ return false; }

◆ operator==() [3/3]

template<int Idx>
bool tim::component::enumerator< Idx >::operator== ( int  ) const
inline

Definition at line 265 of file properties.hpp.

265{ return false; }

◆ serialize()

void tim::component::properties< placeholder< nothing > >::serialize ( Archive &  ,
const unsigned int   
)
inlineinherited

Definition at line 224 of file properties.hpp.

225 {}

◆ specialized()

static constexpr bool tim::component::properties< placeholder< nothing > >::specialized ( )
inlinestaticconstexprinherited

Definition at line 219 of file properties.hpp.

219{ return false; }

Member Data Documentation

◆ value

template<int Idx>
constexpr bool tim::component::enumerator< Idx >::value = false
staticconstexpr

Definition at line 263 of file properties.hpp.


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