Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csObjectRegistry Class Reference

This is an implementation of iObjectRegistry. More...

#include <objreg.h>

Inheritance diagram for csObjectRegistry:

iObjectRegistry iBase List of all members.

Public Methods

 csObjectRegistry ()
virtual ~csObjectRegistry ()
 Client must explicitly call Clear().

virtual void Clear ()
 Clear the object registry and release all references.

virtual bool Register (iBase *obj, char const *tag=NULL)
 Register an object with this registry. More...

virtual void Unregister (iBase *obj, char const *tag=NULL)
 Unregister an object with this registry. More...

virtual iBaseGet (char const *tag)
 Get the registered object corresponding with the given tag. More...

virtual iBaseGet (char const *tag, scfInterfaceID id, int version)
 Get the registered object corresponding with the given tag and implementing the specified interface. More...

virtual iObjectRegistryIteratorGet (scfInterfaceID id, int version)
 Get an iterator with all objects implementing the given interface.

virtual iObjectRegistryIteratorGet ()
 Get an iterator with all objects in this object registry.


Public Attributes

 SCF_DECLARE_IBASE

Detailed Description

This is an implementation of iObjectRegistry.


Member Function Documentation

virtual iBase* csObjectRegistry::Get ( char const * tag,
scfInterfaceID id,
int version ) [virtual]
 

Get the registered object corresponding with the given tag and implementing the specified interface.

The iBase pointers returned by the iterator will be the requested interface itself so there is no need to do further QueryInterface(). This function will increase the ref count of the returned object.

Reimplemented from iObjectRegistry.

virtual iBase* csObjectRegistry::Get ( char const * tag ) [virtual]
 

Get the registered object corresponding with the given tag.

This function will increase the ref count of the returned object.

Reimplemented from iObjectRegistry.

virtual bool csObjectRegistry::Register ( iBase * obj,
char const * tag = NULL ) [virtual]
 

Register an object with this registry.

The same object can be registered multiple times but in that case it is probably best to have different tags so they can be distinguished. This function will increase the ref count of the given object.

Note that a given tag (if non-NULL) may only be registered once. This function will return false otherwise.

This function will also fail if this object registry is being cleared.

Reimplemented from iObjectRegistry.

virtual void csObjectRegistry::Unregister ( iBase * obj,
char const * tag = NULL ) [virtual]
 

Unregister an object with this registry.

If 'tag' is not given then it will unregister all occurances of the given object in the registry (i.e. for all tags). If 'tag' is given then only the object that has that tag will be unregistered. This function will decrease the ref count of the given object.

Reimplemented from iObjectRegistry.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000