CEL

Public API Reference

iNumReg Struct Reference

This interface is used for ID -> iCelEntity* registers in the physical layer. More...

#include <physicallayer/numreg.h>

List of all members.

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 a registered object from the registry (Note: this is slow, whatever the implementation you choose).
virtual bool Remove (uint id)=0
 Removes a registered object from the registry.


Detailed Description

This interface is used for ID -> iCelEntity* registers in the physical layer.

Currently, two implementations are available:

You can choose between these two implementations with the iCelPlLayer::ChangeNumReg function.

Definition at line 41 of file numreg.h.


Member Function Documentation

virtual void iNumReg::Clear (  )  [pure virtual]

Removes all objects from the registry.

virtual void* iNumReg::Get ( uint  id  )  [pure virtual]

Returns the object with ID id from the list.

virtual size_t iNumReg::Length (  )  [pure virtual]

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.

virtual uint iNumReg::Register ( void *  obj  )  [pure virtual]

Registers an object in the registry and returns the new ID, in error case ID 0 is returned.

virtual void iNumReg::RegisterWithID ( void *  obj,
uint  id 
) [pure virtual]

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.

virtual bool iNumReg::Remove ( void *  obj  )  [pure virtual]

Removes a registered object from the registry (Note: this is slow, whatever the implementation you choose).

virtual bool iNumReg::Remove ( uint  id  )  [pure virtual]

Removes a registered object from the registry.


The documentation for this struct was generated from the following file:
Generated for CEL: Crystal Entity Layer by doxygen 1.4.7