iNumReg Struct Reference
This interface is used for ID -> iCelEntity* registers in the physical layer. More...
#include <physicallayer/numreg.h>
Public Member Functions | |
virtual void | Clear ()=0 |
Removes all objects from the registry. | |
virtual void * | Get (uint id)=0 |
Returns the object with ID id from the list. | |
virtual size_t | Length ()=0 |
Returns the size of the buffer (This is NOT the count of objects in the registry). | |
virtual uint | Register (void *obj)=0 |
Registers an object in the registry and returns the new ID, in error case ID 0 is returned. | |
virtual void | RegisterWithID (void *obj, uint id)=0 |
Registers an object in the registry with the provided ID. | |
virtual bool | Remove (void *obj)=0 |
Removes an registered object from the registry (Note: this is slow, whatever the implementation you choose). | |
virtual bool | Remove (uint id)=0 |
Removes an registered object from the registry. |
Detailed Description
This interface is used for ID -> iCelEntity* registers in the physical layer.Currently, two implementations are available:
- cel.numreg.lists (using arrays) This version is more effective if you don't care of the IDs used and if all the ID will be contiguous. This is usually the case of a server or a single app.
- cel.numreg.hash (using hashs) This version is more effective if you want to allow any kind of ID used. This is usually the case of client apps.
You can choose between these two implementations with the iCelPlLayer::ChangeNumReg function.
Definition at line 41 of file numreg.h.
Member Function Documentation
|
Removes all objects from the registry.
|
|
Returns the object with ID id from the list.
|
|
Returns the size of the buffer (This is NOT the count of objects in the registry). It is the size of array if you use array implementation, the size of the hash otherwise. |
|
Registers an object in the registry and returns the new ID, in error case ID 0 is returned.
|
|
Registers an object in the registry with the provided ID. You should call this function only if you are sure the ID isn't allocated yet. It is also advised to use the hash implementation for memory reasons. |
|
Removes an registered object from the registry (Note: this is slow, whatever the implementation you choose).
|
|
Removes an registered object from the registry.
|
The documentation for this struct was generated from the following file:
- physicallayer/numreg.h
Generated for CEL: Crystal Entity Layer by doxygen 1.4.6