Purpose: An indexed map is used to store keys and to bind an index to them. More...
#include <SMESH_IndexedMap.hxx>
Data Structures | |
class | IndexedMapNode |
class | Iterator |
Public Member Functions | |
SMESH_IndexedMap (const Standard_Integer NbBuckets=1, const Handle(NCollection_BaseAllocator)&theAllocator=0L) | |
Constructor. | |
SMESH_IndexedMap (const SMESH_IndexedMap &theOther) | |
Copy constructor. | |
virtual void | Assign (const NCollection_BaseCollection< TheKeyType > &theOther) |
Assign another collection. | |
SMESH_IndexedMap & | operator= (const SMESH_IndexedMap &theOther) |
= another map | |
void | ReSize (const Standard_Integer N) |
ReSize. | |
Standard_Integer | Add (const TheKeyType &theKey1) |
Add. | |
Standard_Boolean | Contains (const TheKeyType &theKey1) const |
Contains. | |
void | Substitute (const Standard_Integer theIndex, const TheKeyType &theKey1) |
Substitute. | |
void | RemoveLast (void) |
RemoveLast. | |
const TheKeyType & | FindKey (const Standard_Integer theKey2) const |
FindKey. | |
const TheKeyType & | operator() (const Standard_Integer theKey2) const |
operator () | |
Standard_Integer | FindIndex (const TheKeyType &theKey1) const |
FindIndex. | |
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. | |
~SMESH_IndexedMap (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. |
Purpose: An indexed map is used to store keys and to bind an index to them.
Each new key stored in the map gets an index. Index are incremented as keys are stored in the map. A key can be found by the index and an index by the key. No key but the last can be removed so the indices are in the range 1..Extent. See the class Map from NCollection for a discussion about the number of buckets.
Definition at line 35 of file SMESH_IndexedMap.hxx.
SMESH_IndexedMap< TheKeyType >.SMESH_IndexedMap | ( | const Standard_Integer | NbBuckets = 1 , |
|
const Handle(NCollection_BaseAllocator)& | theAllocator = 0L | |||
) |
Constructor.
Definition at line 127 of file SMESH_IndexedMap.hxx.
SMESH_IndexedMap< TheKeyType >.SMESH_IndexedMap | ( | const SMESH_IndexedMap< TheKeyType > & | theOther | ) |
Copy constructor.
Definition at line 133 of file SMESH_IndexedMap.hxx.
SMESH_IndexedMap< TheKeyType >.~SMESH_IndexedMap | ( | void | ) |
Destructor.
Definition at line 398 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.Clear().
virtual void SMESH_IndexedMap< TheKeyType >.Assign | ( | const NCollection_BaseCollection< TheKeyType > & | theOther | ) | [virtual] |
Assign another collection.
Definition at line 139 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.Add(), SMESH_IndexedMap< TheKeyType >.Clear(), and SMESH_IndexedMap< TheKeyType >.ReSize().
SMESH_IndexedMap& SMESH_IndexedMap< TheKeyType >.operator= | ( | const SMESH_IndexedMap< TheKeyType > & | theOther | ) |
= another map
Definition at line 152 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.Clear(), HashCode(), and SMESH_IndexedMap< TheKeyType >.ReSize().
void SMESH_IndexedMap< TheKeyType >.ReSize | ( | const Standard_Integer | N | ) |
ReSize.
Definition at line 176 of file SMESH_IndexedMap.hxx.
References HashCode(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Next2().
Referenced by SMESH_IndexedMap< TheKeyType >.Add(), SMESH_IndexedMap< TheKeyType >.Assign(), and SMESH_IndexedMap< TheKeyType >.operator=().
Standard_Integer SMESH_IndexedMap< TheKeyType >.Add | ( | const TheKeyType & | theKey1 | ) |
Add.
Definition at line 220 of file SMESH_IndexedMap.hxx.
References HashCode(), IsEqual(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2(), and SMESH_IndexedMap< TheKeyType >.ReSize().
Referenced by SMESH_IndexedMap< TheKeyType >.Assign().
Standard_Boolean SMESH_IndexedMap< TheKeyType >.Contains | ( | const TheKeyType & | theKey1 | ) | const |
Contains.
Definition at line 243 of file SMESH_IndexedMap.hxx.
References HashCode(), IsEqual(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1().
void SMESH_IndexedMap< TheKeyType >.Substitute | ( | const Standard_Integer | theIndex, | |
const TheKeyType & | theKey1 | |||
) |
Substitute.
Definition at line 260 of file SMESH_IndexedMap.hxx.
References HashCode(), IsEqual(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Next2().
void SMESH_IndexedMap< TheKeyType >.RemoveLast | ( | void | ) |
RemoveLast.
Definition at line 307 of file SMESH_IndexedMap.hxx.
References HashCode(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Next2().
const TheKeyType& SMESH_IndexedMap< TheKeyType >.FindKey | ( | const Standard_Integer | theKey2 | ) | const |
FindKey.
Definition at line 347 of file SMESH_IndexedMap.hxx.
References HashCode(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Next2().
Referenced by SMESH_IndexedMap< TheKeyType >.operator()(), and SMESH_IndexedMap< TheKeyType >.Iterator.Value().
const TheKeyType& SMESH_IndexedMap< TheKeyType >.operator() | ( | const Standard_Integer | theKey2 | ) | const |
operator ()
Definition at line 366 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.FindKey().
Standard_Integer SMESH_IndexedMap< TheKeyType >.FindIndex | ( | const TheKeyType & | theKey1 | ) | const |
FindIndex.
Definition at line 370 of file SMESH_IndexedMap.hxx.
References HashCode(), IsEqual(), SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key1(), and SMESH_IndexedMap< TheKeyType >.IndexedMapNode.Key2().
void SMESH_IndexedMap< TheKeyType >.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.
Definition at line 386 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.IndexedMapNode.delNode().
Referenced by SMESH_IndexedMap< TheKeyType >.Assign(), SMESH_IndexedMap< TheKeyType >.Clear(), SMESH_IndexedMap< TheKeyType >.operator=(), and SMESH_IndexedMap< TheKeyType >.~SMESH_IndexedMap().
void SMESH_IndexedMap< TheKeyType >.Clear | ( | const Handle(NCollection_BaseAllocator)& | theAllocator | ) |
Clear data and reset allocator.
Definition at line 390 of file SMESH_IndexedMap.hxx.
References SMESH_IndexedMap< TheKeyType >.Clear().
virtual Standard_Integer SMESH_IndexedMap< TheKeyType >.Size | ( | void | ) | const [virtual] |
Size.
Definition at line 402 of file SMESH_IndexedMap.hxx.
virtual TYPENAME NCollection_BaseCollection<TheKeyType>::Iterator& SMESH_IndexedMap< TheKeyType >.CreateIterator | ( | void | ) | const [private, virtual] |
Creates Iterator for use on BaseCollection.
Definition at line 410 of file SMESH_IndexedMap.hxx.