kanzi::detail::ProfilingCategorySingletonInitializer< UniqueProfilingCategoryType > Struct Template Reference

Guarantees creation of profiling category singleton object associated with unique profiling category type defined with KZ_DETAIL_PROFILING_REGISTER_CATEGORY() and passed as template parameter. More...

#include <kanzi/core/profiling/profiling_category_detail.hpp>

Public Member Functions

 ProfilingCategorySingletonInitializer ()
 Accesses singleton object associated with the unique profiling category type passed as template argument. More...
 

Static Public Attributes

static ProfilingCategorySingletonInitializer s_initializerInstance
 Static instance of this class guarantees that profiling category singleton is created no later than initialization of static variables is finished. More...
 

Detailed Description

template<typename UniqueProfilingCategoryType>
struct kanzi::detail::ProfilingCategorySingletonInitializer< UniqueProfilingCategoryType >

Guarantees creation of profiling category singleton object associated with unique profiling category type defined with KZ_DETAIL_PROFILING_REGISTER_CATEGORY() and passed as template parameter.

The constructor of the class accesses singleton object associated with the unique profiling category type passed as template argument. That triggers the singleton creation if it has not been created yet. The static instance of this class s_initializerInstance guarantees that the singleton is created during initialization of static variables.

Constructor & Destructor Documentation

template<typename UniqueProfilingCategoryType >
kanzi::detail::ProfilingCategorySingletonInitializer< UniqueProfilingCategoryType >::ProfilingCategorySingletonInitializer ( )
inlineexplicit

Accesses singleton object associated with the unique profiling category type passed as template argument.

If access to singleton object happens first time, it will be created.

Member Data Documentation

template<typename UniqueProfilingCategoryType >
ProfilingCategorySingletonInitializer< UniqueProfilingCategoryType > kanzi::detail::ProfilingCategorySingletonInitializer< UniqueProfilingCategoryType >::s_initializerInstance
static

Static instance of this class guarantees that profiling category singleton is created no later than initialization of static variables is finished.

Initialize static instance of profiling category singleton initializer.


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