Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
singleton< INSTANCE, destroy_on_exit > Class Template Reference

Detailed Description

template<typename INSTANCE, bool destroy_on_exit = true>
class foxxll::singleton< INSTANCE, destroy_on_exit >

Definition at line 25 of file singleton.hpp.

+ Inheritance diagram for singleton< INSTANCE, destroy_on_exit >:

#include <singleton.hpp>

Public Member Functions

 singleton ()=default
 
 singleton (const singleton &)=delete
 non-copyable: delete copy-constructor More...
 
singletonoperator= (const singleton &)=delete
 non-copyable: delete assignment operator More...
 

Static Public Member Functions

static instance_pointer get_instance ()
 
static instance_typeget_ref ()
 

Private Types

using instance_pointer = instance_type *
 
using instance_type = INSTANCE
 
using volatile_instance_pointer = volatile instance_pointer
 

Static Private Member Functions

static instance_pointer create_instance ()
 
static void destroy_instance ()
 

Static Private Attributes

static volatile_instance_pointer instance = nullptr
 

Member Typedef Documentation

using instance_pointer = instance_type *
private

Definition at line 28 of file singleton.hpp.

using instance_type = INSTANCE
private

Definition at line 27 of file singleton.hpp.

using volatile_instance_pointer = volatile instance_pointer
private

Definition at line 29 of file singleton.hpp.

Constructor & Destructor Documentation

singleton ( )
default
singleton ( const singleton< INSTANCE, destroy_on_exit > &  )
delete

non-copyable: delete copy-constructor

Member Function Documentation

singleton< INSTANCE, destroy_on_exit >::instance_pointer create_instance ( )
staticprivate
void destroy_instance ( )
staticprivate

Definition at line 76 of file singleton.hpp.

static instance_pointer get_instance ( )
inlinestatic

Definition at line 44 of file singleton.hpp.

static instance_type& get_ref ( )
inlinestatic

Definition at line 52 of file singleton.hpp.

singleton& operator= ( const singleton< INSTANCE, destroy_on_exit > &  )
delete

non-copyable: delete assignment operator

Member Data Documentation

singleton< INSTANCE, destroy_on_exit >::volatile_instance_pointer instance = nullptr
staticprivate

The documentation for this class was generated from the following file: