40#include <ucommon-config.h>
106 key = (key << 1) ^ (*(
id++) & 0x1f);
137 for (
unsigned i = 0; obj == NULL && i <
range; i++)
151 for (
int i =
range - 1; obj == NULL && i >= 0; i--)
204 if(obj.
table ==
this)
The MapIndex allows linear access into a MapTable, that otherwise could have its elements being retri...
MapIndex & operator++()
Prefix increment operator, to be used in loops and such.
MapIndex & operator=(MapObject *theObject)
Assignment operator to avoid implicit cast.
The MapObject is a base class which can be used to make a derived class operate on a MapTable.
void detach(void)
Remove the object from it's current table.
MapObject(const char *id)
Save id, mark as not using any table.
A map table allows for entities to be mapped (hash index) onto it.
void addObject(MapObject &obj)
Map an object to our table.
virtual unsigned getIndex(const char *id)
Get index value from id string.
MapTable & operator+=(MapObject &obj)
An operator to map an object to the table.
MapTable(unsigned size)
Create a map table with a specified number of slots.
virtual ~MapTable()
Destroy the table, calls cleanup.
void * getObject(const char *id)
Lookup an object by id key.
void * getLast()
Get the last element into table, it is returned as void * for easy re-cast.
virtual MapTable & operator-=(MapObject &obj)
This operator is virtual in case it must also add the object to a managed free list.
void * getFirst()
Get the first element into table, it is returned as void * for easy re-cast.
void addFree(MapObject *obj)
Add an object to the managed free list.
void * getFree(void)
Get next object from managed free list.
Export interfaces for library interfaces.
Some object manipulation classes for smart pointers, linked lists, etc.
Common C++ thread class and sychronization objects.
int stricmp(const char *s1, const char *s2)