![]() |
VR-Link API Documentation for DIS
|
Instances of DtObjectIdHashlist are hash lists, where you can store associations between DtObjectIds and arbitrary pieces of data. More...
Collaboration diagram for DtObjectIdHashlist:Public Member Functions | |
| DtObjectIdHashlist (bool intrusive=false) | |
| Default constructor. | |
| virtual | ~DtObjectIdHashlist () |
| destructor | |
| virtual DtListItem * | add (const DtObjectId &key, void *data, void **oldData=NULL) |
| Add something to the list. | |
| virtual void * | remove (const DtObjectId &key) |
| Remove the current association involving key from the list. | |
| virtual void * | lookup (const DtObjectId &key) const |
| Look up the data associated with key. | |
| virtual void * | operator[] (const DtObjectId &key) const |
| virtual const DtList * | list () const |
| Get a DtList containing all of the void* data that you have listed, regardless of keys. | |
| virtual void | empty () |
| Empty all keys and data from the hash list. | |
Protected Member Functions | |
| DtObjectIdHashlist (const DtObjectIdHashlist &orig) | |
| copy constructor | |
| DtObjectIdHashlist & | operator= (const DtObjectIdHashlist &orig) |
| assignment operator | |
Protected Attributes | |
| DtList * | myList |
| DtHashlist * | myHashlist |
Instances of DtObjectIdHashlist are hash lists, where you can store associations between DtObjectIds and arbitrary pieces of data.
| DtObjectIdHashlist::DtObjectIdHashlist | ( | bool | intrusive = false | ) |
Default constructor.
Pass true only if the data that you are listing are instances of a class derived from DtListedObject.
| virtual DtObjectIdHashlist::~DtObjectIdHashlist | ( | ) | [virtual] |
destructor
| DtObjectIdHashlist::DtObjectIdHashlist | ( | const DtObjectIdHashlist & | orig | ) | [protected] |
copy constructor
| virtual DtListItem* DtObjectIdHashlist::add | ( | const DtObjectId & | key, |
| void * | data, | ||
| void ** | oldData = NULL |
||
| ) | [virtual] |
Add something to the list.
The actual pointer is stored, so you should make sure the pointer remains valid until after you remove the data from the hash list. At any given time, only one data item may be associated with a particular key. If add is called with a key with which an item is already associated, the old item is replaced with the new, and the old item is returned in the optional oldData argument for deletion by the user. Otherwise, oldData will be set to NULL.
| virtual void DtObjectIdHashlist::empty | ( | ) | [virtual] |
Empty all keys and data from the hash list.
| virtual const DtList* DtObjectIdHashlist::list | ( | ) | const [virtual] |
Get a DtList containing all of the void* data that you have listed, regardless of keys.
| virtual void* DtObjectIdHashlist::lookup | ( | const DtObjectId & | key | ) | const [virtual] |
Look up the data associated with key.
Referenced by operator[]().
| DtObjectIdHashlist& DtObjectIdHashlist::operator= | ( | const DtObjectIdHashlist & | orig | ) | [protected] |
assignment operator
| void * DtObjectIdHashlist::operator[] | ( | const DtObjectId & | key | ) | const [inline, virtual] |
References lookup().
| virtual void* DtObjectIdHashlist::remove | ( | const DtObjectId & | key | ) | [virtual] |
Remove the current association involving key from the list.
Returns the data that was associated with key.
DtHashlist* DtObjectIdHashlist::myHashlist [protected] |
DtList* DtObjectIdHashlist::myList [protected] |