CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iObjectRegistry Struct Reference
[Shared Class Facility (SCF)]

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. More...

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 csPtr< iObjectRegistryIteratorGet (scfInterfaceID id, int version)=0
 Get an iterator with all objects implementing the given interface. More...

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


Detailed Description

This interface serves as a registry of other objects.

The object registry is thread-safe.

Definition at line 49 of file iutil/objreg.h.


Member Function Documentation

virtual void iObjectRegistry::Clear   [pure virtual]
 

Clear the object registry and release all references.

Implemented in csObjectRegistry.

virtual csPtr<iObjectRegistryIterator> iObjectRegistry::Get   [pure virtual]
 

Get an iterator with all objects in this object registry.

Note that the iterator iterates over a copy of the elements in the object registry so no thread-locking on the object registry happens except at the time the iterator is created.

Implemented in csObjectRegistry.

virtual csPtr<iObjectRegistryIterator> iObjectRegistry::Get scfInterfaceID    id,
int    version
[pure virtual]
 

Get an iterator with all objects implementing the given interface.

Note that the iterator iterates over a copy of the elements in the object registry so no thread-locking on the object registry happens except at the time the iterator is created.

Implemented in csObjectRegistry.

virtual 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.

Implemented in csObjectRegistry.

virtual 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.

Implemented in csObjectRegistry.

virtual bool iObjectRegistry::Register iBase  ,
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.

Implemented in csObjectRegistry.

virtual void iObjectRegistry::Unregister iBase  ,
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.

Implemented in csObjectRegistry.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14