DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ers::SingletonCreator< T > Class Template Reference

#include <SingletonCreator.hpp>

Static Public Member Functions

static T * create ()

Static Private Attributes

static std::mutex s_mutex
static T * s_instance

Detailed Description

template<class T>
class ers::SingletonCreator< T >

Definition at line 34 of file SingletonCreator.hpp.

Member Function Documentation

◆ create()

template<class T>
T * ers::SingletonCreator< T >::create ( )
inlinestatic

Definition at line 40 of file SingletonCreator.hpp.

41 {
42 // on MacOS with gcc 4.2 the s_mutex is not yet created
43 // at this moment which causes crash. This might be fixed
44 // when movining to newer gcc version
45 #if !defined( __APPLE__) && !defined(__rtems__)
47 #endif
48 if ( !s_instance )
49 {
50 s_instance = new T();
51 }
52 return s_instance;
53 }
static std::mutex s_mutex

Member Data Documentation

◆ s_instance

template<class T>
T* ers::SingletonCreator< T >::s_instance
staticprivate

Definition at line 37 of file SingletonCreator.hpp.

◆ s_mutex

template<class T>
std::mutex ers::SingletonCreator< T >::s_mutex
staticprivate

Definition at line 36 of file SingletonCreator.hpp.


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