Open CASCADE Technology
6.5.4
|
#include <NCollection_DataMap.hxx>
Data Structures | |
class | DataMapNode |
class | Iterator |
Public Member Functions | |
NCollection_DataMap (const Standard_Integer NbBuckets=1, const Handle< NCollection_BaseAllocator > &theAllocator=0L) | |
Constructor. | |
NCollection_DataMap (const NCollection_DataMap &theOther) | |
Copy constructor. | |
virtual void | Assign (const NCollection_BaseCollection< TheItemType > &theOther) |
Assign another collection. | |
NCollection_DataMap & | operator= (const NCollection_DataMap &theOther) |
= another map | |
void | ReSize (const Standard_Integer N) |
ReSize. | |
Standard_Boolean | Bind (const TheKeyType &theKey, const TheItemType &theItem) |
Bind. | |
Standard_Boolean | IsBound (const TheKeyType &K) const |
IsBound. | |
Standard_Boolean | UnBind (const TheKeyType &K) |
UnBind. | |
const TheItemType & | Find (const TheKeyType &theKey) const |
Find. | |
const TheItemType & | operator() (const TheKeyType &theKey) const |
operator () | |
TheItemType & | ChangeFind (const TheKeyType &theKey) |
ChangeFind. | |
TheItemType & | operator() (const TheKeyType &theKey) |
operator () | |
void | Clear (const Standard_Boolean doReleaseMemory=Standard_True) |
Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused. | |
void | Clear (const Handle< NCollection_BaseAllocator > &theAllocator) |
Clear data and reset allocator. | |
~NCollection_DataMap (void) | |
Destructor. | |
virtual Standard_Integer | Size (void) const |
Size. |
Purpose: The DataMap is a Map to store keys with associated Items. See Map from NCollection for a discussion about the number of buckets.
The DataMap can be seen as an extended array where the Keys are the indices. For this reason the operator () is defined on DataMap to fetch an Item from a Key. So the following syntax can be used :
anItem = aMap(aKey); aMap(aKey) = anItem;
This analogy has its limit. aMap(aKey) = anItem can be done only if aKey was previously bound to an item in the map.
NCollection_DataMap< TheKeyType, TheItemType, Hasher >::NCollection_DataMap | ( | const Standard_Integer | NbBuckets = 1 , |
const Handle< NCollection_BaseAllocator > & | theAllocator = 0L |
||
) | [inline] |
NCollection_DataMap< TheKeyType, TheItemType, Hasher >::NCollection_DataMap | ( | const NCollection_DataMap< TheKeyType, TheItemType, Hasher > & | theOther | ) | [inline] |
NCollection_DataMap< TheKeyType, TheItemType, Hasher >::~NCollection_DataMap | ( | void | ) | [inline] |
virtual void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Bind | ( | const TheKeyType & | theKey, |
const TheItemType & | theItem | ||
) | [inline] |
TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::ChangeFind | ( | const TheKeyType & | theKey | ) | [inline] |
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Clear | ( | const Standard_Boolean | doReleaseMemory = Standard_True | ) | [inline] |
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Clear | ( | const Handle< NCollection_BaseAllocator > & | theAllocator | ) | [inline] |
const TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Find | ( | const TheKeyType & | theKey | ) | const [inline] |
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::IsBound | ( | const TheKeyType & | K | ) | const [inline] |
const TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator() | ( | const TheKeyType & | theKey | ) | const [inline] |
TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator() | ( | const TheKeyType & | theKey | ) | [inline] |
NCollection_DataMap& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator= | ( | const NCollection_DataMap< TheKeyType, TheItemType, Hasher > & | theOther | ) | [inline] |
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::ReSize | ( | const Standard_Integer | N | ) | [inline] |
virtual Standard_Integer NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Size | ( | void | ) | const [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::UnBind | ( | const TheKeyType & | K | ) | [inline] |