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::trait::runtime_enabled< T > Struct Template Reference

trait that signifies that an implementation is enabled at runtime. The value returned from get() is for the specific setting for the type, the global settings (type: void) and the specific settings for it's APIs More...

#include "timemory/mpl/type_traits.hpp"

+ Collaboration diagram for tim::trait::runtime_enabled< T >:

Public Types

using api_type_list = mpl::get_true_types_t< concepts::is_runtime_configurable, component_apis_t< T > >
 type-list of APIs that are runtime configurable More...
 

Static Public Member Functions

template<typename U = T>
static bool get (enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
 GET specialization if component is available. More...
 
template<typename U = T>
static bool set (bool val, enable_if_t< is_available< U >::value &&get_value< U >(), int >=0)
 SET specialization if component is available. More...
 
template<typename U = T>
static bool get (enable_if_t<!is_available< U >::value||!get_value< U >(), long >=0)
 GET specialization if component is NOT available. More...
 
template<typename U = T>
static bool set (bool, enable_if_t<!is_available< U >::value||!get_value< U >(), long >=0)
 SET specialization if component is NOT available. More...
 

Static Public Attributes

static constexpr bool value = supports_runtime_enabled<T>::value
 

Detailed Description

template<typename T>
struct tim::trait::runtime_enabled< T >

trait that signifies that an implementation is enabled at runtime. The value returned from get() is for the specific setting for the type, the global settings (type: void) and the specific settings for it's APIs

Definition at line 172 of file type_traits.hpp.

Member Typedef Documentation

◆ api_type_list

type-list of APIs that are runtime configurable

Definition at line 185 of file type_traits.hpp.

Member Function Documentation

◆ get() [1/2]

template<typename T >
template<typename U = T>
static bool tim::trait::runtime_enabled< T >::get ( enable_if_t< is_available< U >::value &&get_value< U >(), int >  = 0)
inlinestatic

GET specialization if component is available.

Definition at line 190 of file type_traits.hpp.

192 {
193 return (runtime_enabled<void>::get() && get_runtime_value() &&
194 apply<runtime_enabled>{}(api_type_list{}));
195 }
mpl::get_true_types_t< concepts::is_runtime_configurable, component_apis_t< T > > api_type_list
type-list of APIs that are runtime configurable

Referenced by tim::get_storage_singleton(), and tim::operation::generic_counter< Tp >::TIMEMORY_DELETED_OBJECT().

◆ get() [2/2]

template<typename T >
template<typename U = T>
static bool tim::trait::runtime_enabled< T >::get ( enable_if_t<!is_available< U >::value||!get_value< U >(), long >  = 0)
inlinestatic

GET specialization if component is NOT available.

Definition at line 207 of file type_traits.hpp.

209 {
210 return is_available<T>::value && default_runtime_enabled<T>::value;
211 }

◆ set() [1/2]

template<typename T >
template<typename U = T>
static bool tim::trait::runtime_enabled< T >::set ( bool  val,
enable_if_t< is_available< U >::value &&get_value< U >(), int >  = 0 
)
inlinestatic

◆ set() [2/2]

template<typename T >
template<typename U = T>
static bool tim::trait::runtime_enabled< T >::set ( bool  ,
enable_if_t<!is_available< U >::value||!get_value< U >(), long >  = 0 
)
inlinestatic

SET specialization if component is NOT available.

Definition at line 215 of file type_traits.hpp.

217 {
218 return is_available<T>::value && default_runtime_enabled<T>::value;
219 }

Member Data Documentation

◆ value

template<typename T >
constexpr bool tim::trait::runtime_enabled< T >::value = supports_runtime_enabled<T>::value
staticconstexpr

Definition at line 182 of file type_traits.hpp.


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