Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

corelinux::Singleton Template Class Reference

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

#include <Singleton.hpp>

Inheritance diagram for corelinux::Singleton

Inheritance graph
[legend]
Collaboration diagram for corelinux::Singleton:

Collaboration graph
[legend]
List of all members.

Public Methods

 Singleton ( void ) throw ( Assertion )
 Default constructor sets theSingleton and theType after insuring that they are not already instantiated. More...

 Singleton ( TypeImpl *aTypePtr ) throw ( Assertion )
 Initializing constructor.

virtual ~Singleton ( void )
 Virtual destructor.

bool operator== ( const Singleton & aSingleton ) const
 Equality operator tests that theSingleton instances are equal. More...


Static Public Methods

TypeImpl* instance ( void )
 Returns the instance of the TypeImpl. More...


Detailed Description

template<class TypeImpl> template class corelinux::Singleton

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

This is easier said than done outside of the solution domain. While we can declare a protocol by which the use of this type will prevent multiple applications, we can't insure that the implementor won't violate said protocol.


Constructor & Destructor Documentation

template<classTypeImpl>
corelinux::Singleton<TypeImpl>::Singleton<TypeImpl> ( void ) throw ( Assertion )
 

Default constructor sets theSingleton and theType after insuring that they are not already instantiated.

Exceptions:
Assertion  


Member Function Documentation

template<classTypeImpl>
TypeImpl * corelinux::Singleton<TypeImpl>::instance ( void ) [inline, static]
 

Returns the instance of the TypeImpl.

Returns:
TypeImpl pointer

template<classTypeImpl>
bool corelinux::Singleton<TypeImpl>::operator== ( const Singleton<TypeImpl> & aSingleton ) const [inline]
 

Equality operator tests that theSingleton instances are equal.

Parameters:
Singleton   const reference
Returns:
bool true if equal


The documentation for this class was generated from the following file:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium