VR-Link API Documentation for HLA Evolved
Public Member Functions | Protected Member Functions | Protected Attributes
DtObjectIdHashlist Class Reference

Instances of DtObjectIdHashlist are hash lists, where you can store associations between DtObjectIds and arbitrary pieces of data. More...

+ Collaboration diagram for DtObjectIdHashlist:

List of all members.

Public Member Functions

 DtObjectIdHashlist (bool intrusive=false)
 Default constructor.
virtual ~DtObjectIdHashlist ()
 destructor
virtual DtListItemadd (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 DtListlist () 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
DtObjectIdHashlistoperator= (const DtObjectIdHashlist &orig)
 assignment operator

Protected Attributes

DtListmyList
DtHashlistmyHashlist

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.

destructor

copy constructor


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]
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.


Member Data Documentation


The documentation for this class was generated from the following file:

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)