fix8  version 1.4.0
Open Source C++ FIX Framework
FIX8::Singleton< T > Class Template Reference

#include <f8utils.hpp>

Public Member Functions

 Singleton ()
 Ctor. More...
 
virtual ~Singleton ()
 Dtor. More...
 
 Singleton (const Singleton &)=delete
 
Singletonoperator= (const Singleton &)=delete
 

Static Public Member Functions

static T * instance ()
 

Detailed Description

template<typename T>
class FIX8::Singleton< T >

A lockfree Singleton. C++11 makes this a lot simpler http://en.wikipedia.org/wiki/Double-checked_locking

Template Parameters
Tthe instance object type

Definition at line 1115 of file f8utils.hpp.

Constructor & Destructor Documentation

template<typename T >
FIX8::Singleton< T >::Singleton ( )
inline

Ctor.

Definition at line 1119 of file f8utils.hpp.

1119 {}
template<typename T >
virtual FIX8::Singleton< T >::~Singleton ( )
inlinevirtual

Dtor.

Definition at line 1122 of file f8utils.hpp.

1122 {}
template<typename T >
FIX8::Singleton< T >::Singleton ( const Singleton< T > &  )
delete

Member Function Documentation

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

Definition at line 1127 of file f8utils.hpp.

1128  {
1129  static T instance;
1130  return &instance;
1131  }
static T * instance()
Definition: f8utils.hpp:1127
template<typename T >
Singleton& FIX8::Singleton< T >::operator= ( const Singleton< T > &  )
delete

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