Instances of DtObjectIdHashlist are hash lists, where you can store associations between DtObjectIds and arbitrary pieces of data.
More...
Detailed Description
Instances of DtObjectIdHashlist are hash lists, where you can store associations between DtObjectIds and arbitrary pieces of data.
Constructor & Destructor Documentation
| 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 |
Member Function Documentation
| 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[]().
| void * DtObjectIdHashlist::operator[] |
( |
const DtObjectId & |
key | ) |
const |
|
inlinevirtual |
| 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.
Member Data Documentation
| DtList* DtObjectIdHashlist::myList |
|
protected |
The documentation for this class was generated from the following file: