Open CASCADE Technology 6.6.0
Data Structures | Public Member Functions
NCollection_DataMap< TheKeyType, TheItemType, Hasher > Class Template Reference

#include <NCollection_DataMap.hxx>

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

Data Structures

class  DataMapNode
class  Iterator

Public Member Functions

 NCollection_DataMap (const Standard_Integer NbBuckets=1, const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Constructor.
 NCollection_DataMap (const NCollection_DataMap &theOther)
 Copy constructor.
virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Assign another collection.
NCollection_DataMapoperator= (const NCollection_DataMap &theOther)
 = another map
void ReSize (const Standard_Integer N)
 ReSize.
Standard_Boolean Bind (const TheKeyType &theKey, const TheItemType &theItem)
 Bind.
Standard_Boolean IsBound (const TheKeyType &K) const
 IsBound.
Standard_Boolean UnBind (const TheKeyType &K)
 UnBind.
const TheItemType & Find (const TheKeyType &theKey) const
 Find.
Standard_Boolean Find (const TheKeyType &theKey, TheItemType &theValue) const
 Find value for key with copying.
const TheItemType & operator() (const TheKeyType &theKey) const
 operator ()
TheItemType & ChangeFind (const TheKeyType &theKey)
 ChangeFind.
TheItemType & operator() (const TheKeyType &theKey)
 operator ()
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_DataMap (void)
 Destructor.
virtual Standard_Integer Size (void) const
 Size.

Detailed Description

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

Purpose: The DataMap is a Map to store keys with associated Items. See Map from NCollection for a discussion about the number of buckets.

The DataMap can be seen as an extended array where the Keys are the indices. For this reason the operator () is defined on DataMap to fetch an Item from a Key. So the following syntax can be used :

anItem = aMap(aKey); aMap(aKey) = anItem;

This analogy has its limit. aMap(aKey) = anItem can be done only if aKey was previously bound to an item in the map.


Constructor & Destructor Documentation

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

Member Function Documentation

template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
virtual void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther) [inline, virtual]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Bind ( const TheKeyType &  theKey,
const TheItemType &  theItem 
) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::ChangeFind ( const TheKeyType &  theKey) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Clear ( const Standard_Boolean  doReleaseMemory = Standard_True) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Clear ( const Handle< NCollection_BaseAllocator > &  theAllocator) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Find ( const TheKeyType &  theKey) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Find ( const TheKeyType &  theKey,
TheItemType &  theValue 
) const [inline]
Returns:
true if key was found
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::IsBound ( const TheKeyType &  K) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator() ( const TheKeyType &  theKey) const [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator() ( const TheKeyType &  theKey) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_DataMap& NCollection_DataMap< TheKeyType, TheItemType, Hasher >::operator= ( const NCollection_DataMap< TheKeyType, TheItemType, Hasher > &  theOther) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_DataMap< TheKeyType, TheItemType, Hasher >::ReSize ( const Standard_Integer  N) [inline]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
virtual Standard_Integer NCollection_DataMap< TheKeyType, TheItemType, Hasher >::Size ( void  ) const [inline, virtual]
template<class TheKeyType, class TheItemType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
Standard_Boolean NCollection_DataMap< TheKeyType, TheItemType, Hasher >::UnBind ( const TheKeyType &  K) [inline]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines