Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

iObjectRegistry Struct Reference

This interface serves as a registry of other objects. More...

#include <objreg.h>

Inheritance diagram for iObjectRegistry:

iBase csObjectRegistry List of all members.

Public Methods

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

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

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

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

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

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

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


Detailed Description

This interface serves as a registry of other objects.


Member Function Documentation

iBase * iObjectRegistry::Get ( char const * tag,
scfInterfaceID id,
int version ) [pure 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 in csObjectRegistry.

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

Get the registered object corresponding with the given tag.

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

Reimplemented in csObjectRegistry.

bool iObjectRegistry::Register ( iBase * obj,
char const * tag = NULL ) [pure 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 in csObjectRegistry.

void iObjectRegistry::Unregister ( iBase * obj,
char const * tag = NULL ) [pure 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 in csObjectRegistry.


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