Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Data Structures | Public Member Functions
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > Class Template Reference

#include <NCollection_IndexedDataMap.hxx>

Inheritance diagram for NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >:
Inheritance graph
[legend]

Data Structures

class  IndexedDataMapNode
 Adaptation of the TListNode to the INDEXEDDatamap.
class  Iterator
 Implementation of the Iterator interface. More...

Public Member Functions

 NCollection_IndexedDataMap (const Standard_Integer NbBuckets=1, const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Constructor.
 NCollection_IndexedDataMap (const NCollection_IndexedDataMap &theOther)
 Copy constructor.
virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Assign another collection.
NCollection_IndexedDataMapoperator= (const NCollection_IndexedDataMap &theOther)
 = another map
void ReSize (const Standard_Integer N)
 ReSize.
Standard_Integer Add (const TheKeyType &theKey1, const TheItemType &theItem)
 Add.
Standard_Boolean Contains (const TheKeyType &theKey1) const
 Contains.
void Substitute (const Standard_Integer theIndex, const TheKeyType &theKey1, const TheItemType &theItem)
 Substitute.
void RemoveLast (void)
 RemoveLast.
const TheKeyType & FindKey (const Standard_Integer theKey2) const
 FindKey.
const TheItemType & FindFromIndex (const Standard_Integer theKey2) const
 FindFromIndex.
const TheItemType & operator() (const Standard_Integer theKey2) const
 operator ()
TheItemType & ChangeFromIndex (const Standard_Integer theKey2)
 ChangeFromIndex.
TheItemType & operator() (const Standard_Integer theKey2)
 operator ()
Standard_Integer FindIndex (const TheKeyType &theKey1) const
 FindIndex.
const TheItemType & FindFromKey (const TheKeyType &theKey1) const
 FindFromKey.
TheItemType & ChangeFromKey (const TheKeyType &theKey1)
 ChangeFromKey.
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_IndexedDataMap (void)
 Destructor.
virtual Standard_Integer Size (void) const
 Size.

Detailed Description

template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
class NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >

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. An Item is stored with each key.

This class is similar to IndexedMap from NCollection with the Item as a new feature. Note the important difference on the operator (). In the IndexedMap this operator returns the Key. In the IndexedDataMap this operator returns the Item.

See the class Map from NCollection for a discussion about the number of buckets.


Constructor & Destructor Documentation

template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const Standard_Integer  NbBuckets = 1,
const Handle< NCollection_BaseAllocator > &  theAllocator = 0L 
) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > &  theOther) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::~NCollection_IndexedDataMap ( void  ) [inline]

Member Function Documentation

template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Integer NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Add ( const TheKeyType &  theKey1,
const TheItemType &  theItem 
) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
virtual void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther) [inline, virtual]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeFromIndex ( const Standard_Integer  theKey2) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeFromKey ( const TheKeyType &  theKey1) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Clear ( const Standard_Boolean  doReleaseMemory = Standard_True) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Clear ( const Handle< NCollection_BaseAllocator > &  theAllocator) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Boolean NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Contains ( const TheKeyType &  theKey1) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromIndex ( const Standard_Integer  theKey2) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromKey ( const TheKeyType &  theKey1) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Integer NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindIndex ( const TheKeyType &  theKey1) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheKeyType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindKey ( const Standard_Integer  theKey2) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const Standard_Integer  theKey2) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const Standard_Integer  theKey2) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap& NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator= ( const NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > &  theOther) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::RemoveLast ( void  ) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ReSize ( const Standard_Integer  N) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
virtual Standard_Integer NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Size ( void  ) const [inline, virtual]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Substitute ( const Standard_Integer  theIndex,
const TheKeyType &  theKey1,
const TheItemType &  theItem 
) [inline]

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