1 #if !defined(__SINGLETON_HPP) 2 #define __SINGLETON_HPP 24 #if !defined(__COMMON_HPP) 37 template<
class TypeImpl >
58 REQUIRE( theSingleton == NULLPTR );
59 REQUIRE( theType == NULLPTR );
61 theType =
new TypeImpl;
71 ENSURE( aTypePtr != NULLPTR );
72 REQUIRE( theSingleton == NULLPTR );
73 REQUIRE( theType == NULLPTR );
82 if( theSingleton ==
this )
84 theSingleton = NULLPTR;
85 if( theType != NULLPTR )
114 return ( &aSingleton == theSingleton );
172 static TypeImpl *theType;
177 template<
class TypeImpl >
182 template<
class TypeImpl >
186 #endif // if !defined(__SINGLETON_HPP) static TypeImpl * instance(void)
Returns the instance of the TypeImpl.
Definition: Singleton.hpp:126
Ensure a class only has one instance, and provide a global point of access to it. ...
Definition: Singleton.hpp:38
CoreLinuxObject(void)
Default Constructor.
Definition: CoreLinuxObject.cpp:31
Singleton(TypeImpl *aTypePtr)
Initializing constructor.
Definition: Singleton.hpp:67
Forward reference the various common classes.
Definition: AbstractAllocator.hpp:32
bool operator==(const Singleton &aSingleton) const
Equality operator tests that theSingleton instances are equal.
Definition: Singleton.hpp:112
Singleton(void)
Default constructor sets theSingleton and theType after insuring that they are not already instantiat...
Definition: Singleton.hpp:54
Assertion is-a Exception created when an assertion fails.
Definition: Assertion.hpp:423
virtual ~Singleton(void)
Virtual destructor.
Definition: Singleton.hpp:80
An CoreLinuxObject is a base class for the library.
Definition: CoreLinuxObject.hpp:39