VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | 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:

Public Member Functions

 DtObjectIdHashlist (bool intrusive=false)
 Default constructor. More...
 
virtual ~DtObjectIdHashlist ()
 destructor More...
 
virtual DtListItemadd (const DtObjectId &key, void *data, void **oldData=NULL)
 Add something to the list. More...
 
virtual void * remove (const DtObjectId &key)
 Remove the current association involving key from the list. More...
 
virtual void * lookup (const DtObjectId &key) const
 Look up the data associated with key. More...
 
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. More...
 
virtual void empty ()
 Empty all keys and data from the hash list. More...
 

Protected Member Functions

 DtObjectIdHashlist (const DtObjectIdHashlist &orig)
 copy constructor More...
 
DtObjectIdHashlistoperator= (const DtObjectIdHashlist &orig)
 assignment operator More...
 

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.

virtual DtObjectIdHashlist::~DtObjectIdHashlist ( )
virtual

destructor

DtObjectIdHashlist::DtObjectIdHashlist ( const DtObjectIdHashlist orig)
protected

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

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
inlinevirtual

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

DtHashlist* DtObjectIdHashlist::myHashlist
protected
DtList* DtObjectIdHashlist::myList
protected

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

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)