Scarab  v3.3.0
Project 8 C++ Utility Library
Classes | Namespaces | Macros
thread_singleton.hh File Reference
#include "destroyer.hh"
#include "error.hh"
#include <cstddef>
#include <mutex>
Include dependency graph for thread_singleton.hh:

Go to the source code of this file.

Classes

class  thread_singleton< x_type >
 Base class that turns a class into a thread-local singleton. More...
 

Namespaces

 scarab
 

Macros

#define allow_thread_singleton_access(class_name)
 

Macro Definition Documentation

◆ allow_thread_singleton_access

#define allow_thread_singleton_access (   class_name)
Value:
friend class scarab::thread_singleton< class_name >; \
friend class scarab::destroyer< class_name >;
Base class that turns a class into a thread-local singleton.

Gives friend access to your class from scarab::singleton< class_name > and scarab::destroyer< class_name > so that those classes can control the life of your singleton class.

Definition at line 24 of file thread_singleton.hh.