Public Member Functions

zeus::ISingletonManager Class Reference

#include <ISingletonManager.hpp>

Inheritance diagram for zeus::ISingletonManager:
zeus::IZUnknown zeus::TSingletonManager

List of all members.

Public Member Functions

virtual Retval MQUALIFIER addSingleton (const IString &rstrName, IZUnknown &rIface)=0
virtual Retval MQUALIFIER getSingleton (const IString &rstrName, IZUnknown *&rpIface)=0
virtual Retval MQUALIFIER removeSingleton (const IString &rstrName)=0

Detailed Description

This interface is used to define the singleton manager. Each loaded module will receive such an interface, to access the singletons of the system.


Member Function Documentation

virtual Retval MQUALIFIER zeus::ISingletonManager::addSingleton ( const IString rstrName,
IZUnknown rIface 
) [pure virtual]

adds a singleton to the registry. A singleton can be added only once using the name.

Parameters:
rstrName,:Name of the singleton object
rIface,:Reference to the singleton object
Return values:
RET_NOERROR,:Singleton added
RET_REQUEST_FAILED,:Could not add singleton

Implemented in zeus::TSingletonManager.

virtual Retval MQUALIFIER zeus::ISingletonManager::getSingleton ( const IString rstrName,
IZUnknown *&  rpIface 
) [pure virtual]

Gets a singleton object referenced by the name of the object.

Parameters:
rstrName,:Name of the singleton object
rpIface,:Return parameter. Reference to the singleton object
Return values:
RET_NOERROR,:Singleton returned
RET_REQUEST_FAILED,:Could not find singleton with this name

Implemented in zeus::TSingletonManager.

virtual Retval MQUALIFIER zeus::ISingletonManager::removeSingleton ( const IString rstrName ) [pure virtual]

Removes a singleton. If an added singleton is not removed manually, the manager will remove it when the application terminates. For singletons provided in code modules (shared libraries) its important, that the user (programmer) removes it manually before the code module has been unloaded.

Parameters:
rstrName,:Name of the object to be removed
Return values:
RET_NOERROR,:Singleton removed
RET_REQUEST_FAILED,:Could not find singleton with this name

Implemented in zeus::TSingletonManager.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:36