EMANE  1.2.1
EMANE::Utils::Singleton< T > Class Template Reference

Ensure a class only has one instance, and provide a global point of access to it. More...

#include <singleton.h>

Static Public Member Functions

static T * instance ()
 
static void destroy ()
 

Detailed Description

template<typename T>
class EMANE::Utils::Singleton< T >

Ensure a class only has one instance, and provide a global point of access to it.

Definition at line 47 of file singleton.h.

Member Function Documentation

◆ destroy()

template<typename T>
static void EMANE::Utils::Singleton< T >::destroy ( )
inlinestatic

Destroys the single instance of type T. Once destroyed it cannot be used or recreated. This is not a thread-safe method.

Definition at line 67 of file singleton.h.

◆ instance()

template<typename T>
static T* EMANE::Utils::Singleton< T >::instance ( )
inlinestatic

Provides thread-safe access to a single instance of type T. It does not provide thread-safety for T methods.

Returns
A pointer to T

Definition at line 56 of file singleton.h.


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