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.
|
Thread-safe singleton management. More...
#include "timemory/utility/singleton.hpp"
Public Types | |
using | this_type = singleton< Type, PointerT, TagT > |
using | thread_id_t = std::thread::id |
using | mutex_t = std::recursive_mutex |
using | auto_lock_t = std::unique_lock< mutex_t > |
using | pointer = Type * |
using | children_t = std::set< pointer > |
using | smart_pointer = PointerT |
using | deleter_t = std::function< void(PointerT &)> |
using | dtor_map_t = std::map< pointer, std::function< void()> > |
template<bool B, typename T = int> | |
using | enable_if_t = typename std::enable_if< B, T >::type |
Public Member Functions | |
singleton () | |
~singleton () | |
singleton (const singleton &)=delete | |
singleton (singleton &&)=delete | |
singleton & | operator= (const singleton &)=delete |
singleton & | operator= (singleton &&)=delete |
void | initialize () |
void | reset (pointer ptr) |
void | reset () |
Static Public Member Functions | |
static pointer | instance () |
static pointer | master_instance () |
static smart_pointer & | smart_instance () |
static smart_pointer & | smart_master_instance () |
static pointer | instance_ptr () |
static pointer | master_instance_ptr () |
static thread_id_t | master_thread_id () |
static children_t | children () |
static bool | is_master (pointer ptr) |
static bool | is_master_thread () |
static void | insert (smart_pointer &itr) |
static void | remove (pointer itr) |
static mutex_t & | get_mutex () |
Thread-safe singleton management.
Definition at line 111 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::auto_lock_t = std::unique_lock<mutex_t> |
Definition at line 117 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::children_t = std::set<pointer> |
Definition at line 119 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::deleter_t = std::function<void(PointerT&)> |
Definition at line 121 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::dtor_map_t = std::map<pointer, std::function<void()> > |
Definition at line 122 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::enable_if_t = typename std::enable_if<B, T>::type |
Definition at line 125 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::mutex_t = std::recursive_mutex |
Definition at line 116 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::pointer = Type* |
Definition at line 118 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::smart_pointer = PointerT |
Definition at line 120 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::this_type = singleton<Type, PointerT, TagT> |
Definition at line 114 of file singleton.hpp.
using tim::singleton< Type, PointerT, TagT >::thread_id_t = std::thread::id |
Definition at line 115 of file singleton.hpp.
tim::singleton< Type, PointerT, TagT >::singleton |
tim::singleton< Type, PointerT, TagT >::~singleton |
Definition at line 275 of file singleton.hpp.
|
delete |
|
delete |
|
inlinestatic |
Definition at line 152 of file singleton.hpp.
|
inlinestatic |
Definition at line 157 of file singleton.hpp.
void tim::singleton< Type, PointerT, TagT >::initialize |
Definition at line 288 of file singleton.hpp.
|
static |
Definition at line 351 of file singleton.hpp.
|
static |
|
static |
Definition at line 333 of file singleton.hpp.
|
inlinestatic |
Definition at line 153 of file singleton.hpp.
References tim::singleton< Type, PointerT, TagT >::master_instance_ptr().
|
static |
Definition at line 342 of file singleton.hpp.
|
static |
Definition at line 319 of file singleton.hpp.
|
inlinestatic |
Definition at line 147 of file singleton.hpp.
Referenced by tim::singleton< Type, PointerT, TagT >::is_master().
|
inlinestatic |
Definition at line 150 of file singleton.hpp.
|
delete |
|
delete |
|
static |
Definition at line 364 of file singleton.hpp.
void tim::singleton< Type, PointerT, TagT >::reset |
Definition at line 423 of file singleton.hpp.
References tim::get().
void tim::singleton< Type, PointerT, TagT >::reset | ( | pointer | ptr | ) |
|
inlinestatic |
Definition at line 142 of file singleton.hpp.
|
inlinestatic |
Definition at line 143 of file singleton.hpp.