|
Geant4-11
|
Singleton object that allows a deleter class to be specified. More...
#include <Singleton.hh>
Data Structures | |
| struct | persistent_data |
Public Types | |
| using | auto_lock_t = std::unique_lock< mutex_t > |
| using | deleter_t = std::function< void(PointerT &)> |
| template<bool B, typename T = int> | |
| using | enable_if_t = typename std::enable_if< B, T >::type |
| using | list_t = std::set< pointer > |
| using | mutex_t = std::recursive_mutex |
| using | pointer = Type * |
| using | smart_pointer = PointerT |
| using | this_type = Singleton< Type, PointerT > |
| using | thread_id_t = std::thread::id |
Public Member Functions | |
| void | Destroy () |
| void | Initialize () |
| void | Initialize (pointer) |
| void | operator delete (void *ptr) |
| void * | operator new (size_t) |
| Singleton & | operator= (const Singleton &)=delete |
| Singleton & | operator= (Singleton &&)=delete |
| void | Reset () |
| void | Reset (pointer) |
| Singleton () | |
| Singleton (const Singleton &)=delete | |
| Singleton (pointer) | |
| Singleton (Singleton &&)=delete | |
| ~Singleton () | |
Static Public Member Functions | |
| static list_t | Children () |
| static pointer | GetInstance () |
| static pointer | GetMasterInstance () |
| static thread_id_t | GetMasterThreadID () |
| static mutex_t & | GetMutex () |
| static void | Insert (pointer) |
| static bool | IsMaster (pointer ptr) |
| static bool | IsMasterThread () |
| static void | Remove (pointer) |
Protected Member Functions | |
| pointer | GetRawInstance () |
| smart_pointer & | GetSmartInstance () |
Static Protected Member Functions | |
| static pointer | GetRawMasterInstance () |
| static smart_pointer & | GetSmartMasterInstance () |
Private Member Functions | |
| template<typename Tp = Type, typename PtrT = PointerT, enable_if_t<(std::is_same< PtrT, std::shared_ptr< Tp > >::value)> = 0> | |
| deleter_t & | GetDeleter () |
| template<typename Tp = Type, typename PtrT = PointerT, enable_if_t<!(std::is_same< PtrT, std::shared_ptr< Tp > >::value)> = 0> | |
| deleter_t & | GetDeleter () |
| void | operator delete[] (void *) noexcept |
| void * | operator new[] (std::size_t) noexcept |
Static Private Member Functions | |
| static smart_pointer & | _local_instance () |
| static smart_pointer & | _master_instance () |
| static list_t & | f_children () |
| static pointer & | f_master_instance () |
| static thread_id_t & | f_master_thread () |
| static mutex_t & | f_mutex () |
| static persistent_data & | f_persistent_data () |
Private Attributes | |
| bool | m_IsMaster = false |
Friends | |
| class | Type |
Singleton object that allows a deleter class to be specified.
Definition at line 42 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::auto_lock_t = std::unique_lock<mutex_t> |
Definition at line 48 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::deleter_t = std::function<void(PointerT&)> |
Definition at line 52 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::enable_if_t = typename std::enable_if<B, T>::type |
Definition at line 55 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::list_t = std::set<pointer> |
Definition at line 50 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::mutex_t = std::recursive_mutex |
Definition at line 47 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::pointer = Type* |
Definition at line 49 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::smart_pointer = PointerT |
Definition at line 51 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::this_type = Singleton<Type, PointerT> |
Definition at line 45 of file Singleton.hh.
| using PTL::Singleton< Type, PointerT >::thread_id_t = std::thread::id |
Definition at line 46 of file Singleton.hh.
| PTL::Singleton< Type, PointerT >::Singleton |
Definition at line 236 of file Singleton.hh.
| PTL::Singleton< Type, PointerT >::Singleton | ( | pointer | ptr | ) |
Definition at line 244 of file Singleton.hh.
| PTL::Singleton< Type, PointerT >::~Singleton |
Definition at line 252 of file Singleton.hh.
|
delete |
|
delete |
|
inlinestaticprivate |
Definition at line 121 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetRawInstance(), and PTL::Singleton< Type, PointerT >::GetSmartInstance().
|
inlinestaticprivate |
Definition at line 127 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetSmartMasterInstance().
|
inlinestatic |
Definition at line 73 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::f_children().
| void PTL::Singleton< Type, PointerT >::Destroy |
Definition at line 288 of file Singleton.hh.
References PTL::get().
|
staticprivate |
Definition at line 228 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::Children().
|
staticprivate |
Definition at line 210 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetRawInstance(), PTL::Singleton< Type, PointerT >::GetRawMasterInstance(), and PTL::Singleton< Type, PointerT >::operator delete().
|
staticprivate |
Definition at line 201 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetMasterThreadID(), and PTL::Singleton< Type, PointerT >::operator delete().
|
staticprivate |
Definition at line 219 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetMutex().
|
inlinestaticprivate |
Definition at line 190 of file Singleton.hh.
|
inlineprivate |
Definition at line 138 of file Singleton.hh.
|
inlineprivate |
Definition at line 146 of file Singleton.hh.
|
static |
|
static |
Definition at line 321 of file Singleton.hh.
|
inlinestatic |
Definition at line 72 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::f_master_thread().
|
inlinestatic |
|
inlineprotected |
Definition at line 113 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::_local_instance(), PTL::Singleton< Type, PointerT >::f_master_instance(), and PTL::Singleton< Type, PointerT >::IsMasterThread().
|
inlinestaticprotected |
Definition at line 117 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::f_master_instance().
Referenced by PTL::Singleton< Type, PointerT >::IsMaster().
|
inlineprotected |
Definition at line 109 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::_local_instance().
|
inlinestaticprotected |
Definition at line 110 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::_master_instance().
| void PTL::Singleton< Type, PointerT >::Initialize |
Definition at line 262 of file Singleton.hh.
| void PTL::Singleton< Type, PointerT >::Initialize | ( | pointer | ptr | ) |
Definition at line 275 of file Singleton.hh.
|
static |
Definition at line 380 of file Singleton.hh.
|
inlinestatic |
Definition at line 74 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::GetRawMasterInstance().
|
static |
Definition at line 371 of file Singleton.hh.
Referenced by PTL::Singleton< Type, PointerT >::GetRawInstance().
|
inline |
Definition at line 97 of file Singleton.hh.
References PTL::Singleton< Type, PointerT >::f_master_instance(), and PTL::Singleton< Type, PointerT >::f_master_thread().
|
inlineprivatenoexcept |
Definition at line 134 of file Singleton.hh.
|
inline |
Definition at line 89 of file Singleton.hh.
|
inlineprivatenoexcept |
Definition at line 133 of file Singleton.hh.
|
delete |
|
delete |
|
static |
Definition at line 390 of file Singleton.hh.
| void PTL::Singleton< Type, PointerT >::Reset |
Definition at line 359 of file Singleton.hh.
References G4Threading::IsMasterThread().
| void PTL::Singleton< Type, PointerT >::Reset | ( | pointer | ptr | ) |
Definition at line 335 of file Singleton.hh.
References PTL::get().
|
friend |
Definition at line 106 of file Singleton.hh.
|
private |
Definition at line 184 of file Singleton.hh.