Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CObjectRegistry Class Reference

#include <CObjectRegistry.h>

Inheritance diagram for CObjectRegistry:

CNamedObject List of all members.

Public Member Functions

 CObjectRegistry (STD(string) am_sName)
virtual ~CObjectRegistry ()
 STD (map)< STD(string)
CNamedObjectgetObjects () const
void Add (CNamedObject &rObject)
void Remove (const STD(string)&rName)
void Remove (const CNamedObject &rObject)
const ObjectIterator Find (const STD(string)&rObjectName) const
ObjectIterator begin ()
ObjectIterator end ()
virtual STD (string) DescribeSelf()

Protected Member Functions

void setObjects (STD(map)< STD(string), CNamedObject * > am_Objects)

Private Member Functions

 STD (map)< STD(string)

Private Attributes

CNamedObjectm_Objects

Detailed Description

Implements a registry of named objects. Registries allow you to determine which instances of particular types of objects exist. Typically a programmer wanting to allow this level of introspection will subclass a class hierarchy from CRegisteredObject such that the constructor of each class will register that class. One can then programmatically search for named instances of a class as well as iterate through the registry to determine which instances exist.

Definition at line 325 of file CObjectRegistry.h.


Constructor & Destructor Documentation

CObjectRegistry::CObjectRegistry STD(string)  am_sName  )  [inline]
 

STD(Map) containing the name key and a pointer to the object.

Definition at line 333 of file CObjectRegistry.h.

References CNamedObject::AppendClassInfo().

virtual CObjectRegistry::~CObjectRegistry  )  [inline, virtual]
 

Definition at line 338 of file CObjectRegistry.h.


Member Function Documentation

void CObjectRegistry::Add CNamedObject rObject  ) 
 

Adds an object to the object registry. The name of the object is gotten from the object itself.

Parameters:
rObject The object to add to the registry.

Definition at line 316 of file CObjectRegistry.cpp.

References m_Objects.

ObjectIterator CObjectRegistry::begin  ) 
 

Returns an iterator which 'points' to the beginning of the registry of objects. Traversing the registry through this iterator will visit all objects in name alphabetical order.

Definition at line 392 of file CObjectRegistry.cpp.

References m_Objects.

Referenced by CClassifiedObjectRegistry::beginregistry().

ObjectIterator CObjectRegistry::end  ) 
 

Returns an iterator which 'points' off the end of the registry of objects. Provided to allow clients to know when to terminate iteration through the registry.

Definition at line 403 of file CObjectRegistry.cpp.

References m_Objects.

Referenced by CClassifiedObjectRegistry::endregistry().

const ObjectIterator CObjectRegistry::Find const STD(string)&  rObjectName  )  const
 

CNamedObject* CObjectRegistry::getObjects  )  const [inline]
 

Definition at line 343 of file CObjectRegistry.h.

void CObjectRegistry::Remove const CNamedObject rObject  ) 
 

Removes an object from the object registry. The name of the object is obtained from the object itself. If the name does not exist in the registry, a CNoSuchObjectException is thrown.

Parameters:
rObject The object to be removed from the registry.

Definition at line 356 of file CObjectRegistry.cpp.

References m_Objects.

void CObjectRegistry::Remove const STD(string)&  rName  ) 
 

void CObjectRegistry::setObjects STD(map)< STD(string), CNamedObject * >  am_Objects  )  [inline, protected]
 

Definition at line 351 of file CObjectRegistry.h.

References m_Objects.

virtual CObjectRegistry::STD string   )  [virtual]
 

The name of the object

Reimplemented from CNamedObject.

CObjectRegistry::STD map   ) 
 

CObjectRegistry::STD map   )  [private]
 


Member Data Documentation

CNamedObject* CObjectRegistry::m_Objects [private]
 

Definition at line 327 of file CObjectRegistry.h.

Referenced by Add(), begin(), end(), Remove(), and setObjects().


The documentation for this class was generated from the following files:
Generated on Thu Jan 6 16:58:44 2005 for Spectrodaq External Event Framework by  doxygen 1.3.9.1