FreeNOS
Static Public Member Functions
StrictSingleton< T > Class Template Reference

Singleton design pattern: only one instance is allowed. More...

#include <Singleton.h>

Static Public Member Functions

static T * instance ()
 Retrieve the instance. More...
 

Detailed Description

template<class T>
class StrictSingleton< T >

Singleton design pattern: only one instance is allowed.

The StrictSingleton has the following constraints:

Definition at line 39 of file Singleton.h.

Member Function Documentation

◆ instance()

template<class T >
static T* StrictSingleton< T >::instance ( )
inlinestatic

Retrieve the instance.

Note that we use a static initializer here, which makes use of the __cxa_guard_acquire and __cxa_guard_release functions in order to guarantee the object is only initialized once.

See also
__cxa_guard_acquire
__cxa_guard_release

Definition at line 53 of file Singleton.h.


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