#include <NCollection_Map.hxx>
Inheritance diagram for NCollection_Map< TheKeyType >:
Public Member Functions | |
NCollection_Map (const Standard_Integer NbBuckets=1, const Handle(NCollection_BaseAllocator)&theAllocator=0L) | |
Constructor. | |
NCollection_Map (const NCollection_Map &theOther) | |
Copy constructor. | |
virtual void | Assign (const NCollection_BaseCollection< TheKeyType > &theOther) |
Assign another collection. | |
NCollection_Map & | operator= (const NCollection_Map &theOther) |
= another map | |
void | ReSize (const Standard_Integer N) |
ReSize. | |
Standard_Boolean | Add (const TheKeyType &K) |
Add. | |
const TheKeyType & | Added (const TheKeyType &K) |
Added: add a new key if not yet in the map, and return reference to either newly added or previously existing object. | |
Standard_Boolean | Contains (const TheKeyType &K) const |
Contains. | |
Standard_Boolean | Remove (const TheKeyType &K) |
Remove. | |
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_Map (void) | |
Destructor. | |
virtual Standard_Integer | Size (void) const |
Size. | |
Private Member Functions | |
virtual TYPENAME NCollection_BaseCollection< TheKeyType >::Iterator & | CreateIterator (void) const |
Creates Iterator for use on BaseCollection. | |
Data Structures | |
class | Iterator |
Implementation of the Iterator interface. More... | |
class | MapNode |
Adaptation of the TListNode to the map notations. More... |
The ::Iterator class can be used to explore the content of the map. It is not wise to iterate and modify a map in parallel.
To compute the hashcode of the key the function HashCode must be defined in the global namespace
To compare two keys the function IsEqual must be defined in the global namespace.
The performance of a Map is conditionned by its number of buckets that should be kept greater to the number of keys. This map has an automatic management of the number of buckets. It is resized when the number of Keys becomes greater than the number of buckets.
If you have a fair idea of the number of objects you can save on automatic resizing by giving a number of buckets at creation or using the ReSize method. This should be consider only for crucial optimisation issues.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheKeyType >. |
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheKeyType >. |