#include <NCollection_DataMap.hxx>
Inheritance diagram for NCollection_DataMap< TheKeyType, TheItemType >:
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. | |
Private Member Functions | |
virtual TYPENAME NCollection_BaseCollection< TheItemType >::Iterator & | CreateIterator (void) const |
Creates Iterator for use on BaseCollection. | |
Data Structures | |
class | DataMapNode |
class | Iterator |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|