1 #ifndef SCARAB_SINGLETON_HH_ 2 #define SCARAB_SINGLETON_HH_ 13 #define allow_singleton_access( class_name ) \ 14 friend class scarab::singleton< class_name >; \ 15 friend class scarab::destroyer< class_name >; 17 template<
class x_type >
24 template<
class... x_args >
43 template<
class x_type >
46 template<
class x_type >
49 template<
class x_type >
52 template<
class x_type >
57 std::unique_lock< std::mutex > t_lock(
f_mutex );
63 template<
class x_type >
68 std::unique_lock< std::mutex > t_lock(
f_mutex );
74 template<
class x_type >
75 template<
class... x_args >
80 throw error() <<
"Instance already exists; create_instance can only be called before the instance exists";
82 std::unique_lock< std::mutex > t_lock(
f_mutex );
88 template<
class x_type >
98 template<
class x_type >
109 template<
class x_type >
113 template<
class x_type >
void set_doomed(XDoomed *)
static void kill_instance()
static void construct_instance()
static x_type * f_instance
static destroyer< x_type > f_destroyer
static x_type * get_instance()
static void delete_instance()
static x_type * create_instance(x_args...args)
static std::mutex f_mutex