SMESH_IndexedMap< TheKeyType > Class Template Reference

Purpose: An indexed map is used to store keys and to bind an index to them. More...

#include <SMESH_IndexedMap.hxx>

Classes

class  Iterator
 

Public Member Functions

Standard_Integer Add (const TheKeyType &theKey1)
 Add. More...
 
virtual void Assign (const NCollection_BaseCollection< TheKeyType > &theOther)
 Assign another collection. More...
 
void Clear (const Handle(NCollection_BaseAllocator)&theAllocator)
 Clear data and reset allocator. More...
 
void Clear (const Standard_Boolean doReleaseMemory=Standard_True)
 Clear data. More...
 
Standard_Boolean Contains (const TheKeyType &theKey1) const
 Contains. More...
 
Standard_Integer FindIndex (const TheKeyType &theKey1) const
 FindIndex. More...
 
const TheKeyType & FindKey (const Standard_Integer theKey2) const
 FindKey. More...
 
const TheKeyType & operator() (const Standard_Integer theKey2) const
 operator () More...
 
SMESH_IndexedMapoperator= (const SMESH_IndexedMap &theOther)
 = another map More...
 
void RemoveLast (void)
 RemoveLast. More...
 
void ReSize (const Standard_Integer N)
 ReSize. More...
 
virtual Standard_Integer Size (void) const
 Size. More...
 
 SMESH_IndexedMap (const SMESH_IndexedMap &theOther)
 Copy constructor. More...
 
 SMESH_IndexedMap (const Standard_Integer NbBuckets=1, const Handle(NCollection_BaseAllocator)&theAllocator=0L)
 Constructor. More...
 
void Substitute (const Standard_Integer theIndex, const TheKeyType &theKey1)
 Substitute. More...
 
 ~SMESH_IndexedMap (void)
 Destructor. More...
 

Detailed Description

template<class TheKeyType>
class SMESH_IndexedMap< TheKeyType >

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.

Constructor & Destructor Documentation

◆ SMESH_IndexedMap() [1/2]

template<class TheKeyType >
SMESH_IndexedMap< TheKeyType >::SMESH_IndexedMap ( const Standard_Integer  NbBuckets = 1,
const Handle(NCollection_BaseAllocator)&  theAllocator = 0L 
)

Constructor.

◆ SMESH_IndexedMap() [2/2]

template<class TheKeyType >
SMESH_IndexedMap< TheKeyType >::SMESH_IndexedMap ( const SMESH_IndexedMap< TheKeyType > &  theOther)

Copy constructor.

◆ ~SMESH_IndexedMap()

template<class TheKeyType >
SMESH_IndexedMap< TheKeyType >::~SMESH_IndexedMap ( void  )

Destructor.

References SMESH_IndexedMap< TheKeyType >::Clear().

Member Function Documentation

◆ Add()

template<class TheKeyType >
Standard_Integer SMESH_IndexedMap< TheKeyType >::Add ( const TheKeyType &  theKey1)

◆ Assign()

template<class TheKeyType >
virtual void SMESH_IndexedMap< TheKeyType >::Assign ( const NCollection_BaseCollection< TheKeyType > &  theOther)
virtual

◆ Clear() [1/2]

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::Clear ( const Handle(NCollection_BaseAllocator)&  theAllocator)

Clear data and reset allocator.

References SMESH_IndexedMap< TheKeyType >::Clear().

◆ Clear() [2/2]

template<class TheKeyType >
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.

Referenced by SMESH_IndexedMap< TheKeyType >::Assign(), SMESH_IndexedMap< TheKeyType >::Clear(), SMESH_IndexedMap< TheKeyType >::operator=(), and SMESH_IndexedMap< TheKeyType >::~SMESH_IndexedMap().

◆ Contains()

template<class TheKeyType >
Standard_Boolean SMESH_IndexedMap< TheKeyType >::Contains ( const TheKeyType &  theKey1) const

Contains.

◆ FindIndex()

template<class TheKeyType >
Standard_Integer SMESH_IndexedMap< TheKeyType >::FindIndex ( const TheKeyType &  theKey1) const

FindIndex.

◆ FindKey()

template<class TheKeyType >
const TheKeyType & SMESH_IndexedMap< TheKeyType >::FindKey ( const Standard_Integer  theKey2) const

◆ operator()()

template<class TheKeyType >
const TheKeyType & SMESH_IndexedMap< TheKeyType >::operator() ( const Standard_Integer  theKey2) const

◆ operator=()

template<class TheKeyType >
SMESH_IndexedMap & SMESH_IndexedMap< TheKeyType >::operator= ( const SMESH_IndexedMap< TheKeyType > &  theOther)

◆ RemoveLast()

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::RemoveLast ( void  )

RemoveLast.

◆ ReSize()

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::ReSize ( const Standard_Integer  N)

◆ Size()

template<class TheKeyType >
virtual Standard_Integer SMESH_IndexedMap< TheKeyType >::Size ( void  ) const
virtual

Size.

◆ Substitute()

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::Substitute ( const Standard_Integer  theIndex,
const TheKeyType &  theKey1 
)

Substitute.


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