crystalspace.jbind.interfaces.iutil.objreg
Interface iObjectRegistry

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csObjectRegistry

public interface iObjectRegistry
extends iBase

This interface serves as a registry of other objects. The object registry is thread-safe.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiObjectRegistry.php

Method Summary
 void clear()
          Clear the object registry and release all references.
 iObjectRegistryIterator get()
          Get an iterator with all objects in this object registry.
 iObjectRegistryIterator get(long id, int version)
          Get an iterator with all objects implementing the given interface.
 iBase get(java.lang.String tag)
          Get the registered object corresponding with the given tag.
 iBase get(java.lang.String tag, long id, int version)
          Get the registered object corresponding with the given tag and implementing the specified interface.
 boolean register(iBase base, java.lang.String tag)
          Register an object with this registry.
 void unregister(iBase base, java.lang.String tag)
          Unregister an object with this registry.
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

clear

public void clear()
Clear the object registry and release all references. Implemented in csObjectRegistry.


register

public boolean register(iBase base,
                        java.lang.String tag)
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-0) 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.

Parameters:
base -
tag -
Returns:

unregister

public void unregister(iBase base,
                       java.lang.String tag)
Unregister an object with this registry. If 'tag' is not given then it will unregister all occurrences 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.

Parameters:
base -
tag -

get

public iBase get(java.lang.String tag)
Get the registered object corresponding with the given tag. This function will increase the ref count of the returned object. Implemented in csObjectRegistry.

Parameters:
tag -
Returns:

get

public iBase get(java.lang.String tag,
                 long id,
                 int version)
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.

Parameters:
tag -
id -
version -
Returns:

get

public iObjectRegistryIterator get(long id,
                                   int version)
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

Parameters:
id -
version -
Returns:

get

public iObjectRegistryIterator get()
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

Returns: