ATLAS Offline Software
Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
ExpressionParsing::EncapsulatingSingleton< T > Class Template Reference

#include <EncapsulatingSingleton.h>

Collaboration diagram for ExpressionParsing::EncapsulatingSingleton< T >:

Static Public Member Functions

static T * getInstance ()
 
static void setInstance (T *proxyLoader)
 
static const EncapsulatingSingletongetSingleton ()
 

Private Member Functions

 EncapsulatingSingleton ()
 
 ~EncapsulatingSingleton ()
 
 EncapsulatingSingleton (const EncapsulatingSingleton &)=delete
 
EncapsulatingSingletonoperator= (const EncapsulatingSingleton &)=delete
 

Private Attributes

T * m_pointer
 

Detailed Description

template<typename T>
class ExpressionParsing::EncapsulatingSingleton< T >

Definition at line 22 of file EncapsulatingSingleton.h.

Constructor & Destructor Documentation

◆ EncapsulatingSingleton() [1/2]

template<typename T >
ExpressionParsing::EncapsulatingSingleton< T >::EncapsulatingSingleton ( )
inlineprivate

Definition at line 46 of file EncapsulatingSingleton.h.

46  {
47  typedef typename EncapsulatedDefault<T>::type Default;
48  m_pointer = new Default();
49  }

◆ ~EncapsulatingSingleton()

template<typename T >
ExpressionParsing::EncapsulatingSingleton< T >::~EncapsulatingSingleton ( )
inlineprivate

Definition at line 51 of file EncapsulatingSingleton.h.

51  {
52  if (m_pointer) {
53  delete m_pointer;
54  }
55  }

◆ EncapsulatingSingleton() [2/2]

template<typename T >
ExpressionParsing::EncapsulatingSingleton< T >::EncapsulatingSingleton ( const EncapsulatingSingleton< T > &  )
privatedelete

Member Function Documentation

◆ getInstance()

template<typename T >
static T* ExpressionParsing::EncapsulatingSingleton< T >::getInstance ( )
inlinestatic

Definition at line 24 of file EncapsulatingSingleton.h.

24  {
26  if (!instance.m_pointer) {
27  throw std::runtime_error("EncapsulatingSingleton: Error - no instance loaded.");
28  }
29  return instance.m_pointer;
30  }

◆ getSingleton()

template<typename T >
static const EncapsulatingSingleton& ExpressionParsing::EncapsulatingSingleton< T >::getSingleton ( )
inlinestatic

Definition at line 40 of file EncapsulatingSingleton.h.

40  {
41  static const EncapsulatingSingleton instance;
42  return instance;
43  }

◆ operator=()

template<typename T >
EncapsulatingSingleton& ExpressionParsing::EncapsulatingSingleton< T >::operator= ( const EncapsulatingSingleton< T > &  )
privatedelete

◆ setInstance()

template<typename T >
static void ExpressionParsing::EncapsulatingSingleton< T >::setInstance ( T *  proxyLoader)
inlinestatic

Definition at line 32 of file EncapsulatingSingleton.h.

32  {
34  if (instance.m_pointer) {
35  delete instance.m_pointer;
36  }
37  instance.m_pointer = proxyLoader;
38  }

Member Data Documentation

◆ m_pointer

template<typename T >
T* ExpressionParsing::EncapsulatingSingleton< T >::m_pointer
private

Definition at line 60 of file EncapsulatingSingleton.h.


The documentation for this class was generated from the following file:
ExpressionParsing::EncapsulatingSingleton::m_pointer
T * m_pointer
Definition: EncapsulatingSingleton.h:60
ExpressionParsing::EncapsulatingSingleton::EncapsulatingSingleton
EncapsulatingSingleton()
Definition: EncapsulatingSingleton.h:46
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
MCP::SystVariation::Default
@ Default
Definition: EnumDef.h:73
ExpressionParsing::EncapsulatingSingleton::getSingleton
static const EncapsulatingSingleton & getSingleton()
Definition: EncapsulatingSingleton.h:40
ExpressionParsing::EncapsulatedDefault::type
T type
Definition: EncapsulatingSingleton.h:19