Thrill
0.1
|
Definition at line 25 of file singleton.hpp.
#include <singleton.hpp>
Public Types | |
using | instance_pointer = instance_type * |
using | instance_type = InstanceType |
using | volatile_instance_pointer = volatile instance_pointer |
Public Member Functions | |
singleton ()=default | |
singleton (const singleton &)=delete | |
non-copyable: delete copy-constructor More... | |
singleton & | operator= (const singleton &)=delete |
non-copyable: delete assignment operator More... | |
Static Public Member Functions | |
template<typename SubInstanceType > | |
static instance_pointer | create_instance () |
create instance of SubInstanceType and move into singleton More... | |
static void | destroy_instance () |
destroy singleton and mark as invalid More... | |
static instance_pointer | get_instance () |
return instance or create base instance if empty More... | |
static instance_type & | get_ref () |
Static Private Attributes | |
static volatile_instance_pointer | instance_ = nullptr |
singleton object instance More... | |
static std::mutex | singleton_mutex_ |
mutex to protect instance_ More... | |
using instance_pointer = instance_type * |
Definition at line 29 of file singleton.hpp.
using instance_type = InstanceType |
Definition at line 28 of file singleton.hpp.
using volatile_instance_pointer = volatile instance_pointer |
Definition at line 30 of file singleton.hpp.
|
default |
non-copyable: delete copy-constructor
|
static |
create instance of SubInstanceType and move into singleton
Definition at line 75 of file singleton.hpp.
Referenced by singleton< disk_queues >::get_ref().
|
static |
destroy singleton and mark as invalid
Definition at line 87 of file singleton.hpp.
Referenced by singleton< disk_queues >::create_instance(), and singleton< disk_queues >::get_ref().
|
inlinestatic |
return instance or create base instance if empty
Definition at line 41 of file singleton.hpp.
|
inlinestatic |
Definition at line 49 of file singleton.hpp.
non-copyable: delete assignment operator
|
staticprivate |
singleton object instance
Definition at line 66 of file singleton.hpp.
Referenced by singleton< disk_queues >::create_instance(), singleton< disk_queues >::destroy_instance(), singleton< disk_queues >::get_instance(), and singleton< disk_queues >::get_ref().
|
staticprivate |
mutex to protect instance_
Definition at line 69 of file singleton.hpp.
Referenced by singleton< disk_queues >::create_instance(), and singleton< disk_queues >::destroy_instance().