SALOME - SMESH
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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>

Inheritance diagram for SMESH_IndexedMap< TheKeyType >:
Inheritance graph
Collaboration diagram for SMESH_IndexedMap< TheKeyType >:
Collaboration graph

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_IndexedMapoperator= (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.
 

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.

Definition at line 35 of file SMESH_IndexedMap.hxx.

Constructor & Destructor Documentation

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

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

Copy constructor.

Definition at line 133 of file SMESH_IndexedMap.hxx.

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

Destructor.

Definition at line 398 of file SMESH_IndexedMap.hxx.

References SMESH_IndexedMap< TheKeyType >::Clear().

Here is the call graph for this function:

Member Function Documentation

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

Here is the call graph for this function:

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

Here is the call graph for this function:

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::ReSize ( const Standard_Integer  N)
template<class TheKeyType >
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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::Substitute ( const Standard_Integer  theIndex,
const TheKeyType &  theKey1 
)
template<class TheKeyType >
void SMESH_IndexedMap< TheKeyType >::RemoveLast ( void  )
template<class TheKeyType >
const TheKeyType& SMESH_IndexedMap< TheKeyType >::FindKey ( const Standard_Integer  theKey2) const
template<class TheKeyType >
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().

Here is the call graph for this function:

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

Here is the call graph for this function:

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.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Size.

Definition at line 402 of file SMESH_IndexedMap.hxx.

template<class TheKeyType >
virtual TYPENAME NCollection_BaseCollection<TheKeyType>::Iterator& SMESH_IndexedMap< TheKeyType >::CreateIterator ( void  ) const
privatevirtual

Creates Iterator for use on BaseCollection.

Definition at line 410 of file SMESH_IndexedMap.hxx.