Open CASCADE Technology  6.9.0
Data Structures | Public Member Functions

NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 > Class Template Reference

#include <NCollection_DoubleMap.hxx>

Inheritance diagram for NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >:
Inheritance graph
[legend]

Data Structures

class  DoubleMapNode
 
class  Iterator
 

Public Member Functions

 NCollection_DoubleMap (const Standard_Integer NbBuckets=1, const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Constructor. More...
 
 NCollection_DoubleMap (const NCollection_DoubleMap &theOther)
 Copy constructor. More...
 
void Exchange (NCollection_DoubleMap &theOther)
 Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well! More...
 
NCollection_DoubleMapAssign (const NCollection_DoubleMap &theOther)
 Assignment. This method does not change the internal allocator. More...
 
NCollection_DoubleMapoperator= (const NCollection_DoubleMap &theOther)
 Assignment operator. More...
 
void ReSize (const Standard_Integer N)
 ReSize. More...
 
void Bind (const TheKey1Type &theKey1, const TheKey2Type &theKey2)
 Bind. More...
 
Standard_Boolean AreBound (const TheKey1Type &theKey1, const TheKey2Type &theKey2) const
 
Standard_Boolean IsBound1 (const TheKey1Type &theKey1) const
 IsBound1. More...
 
Standard_Boolean IsBound2 (const TheKey2Type &theKey2) const
 IsBound2. More...
 
Standard_Boolean UnBind1 (const TheKey1Type &theKey1)
 UnBind1. More...
 
Standard_Boolean UnBind2 (const TheKey2Type &theKey2)
 UnBind2. More...
 
const TheKey2Type & Find1 (const TheKey1Type &theKey1) const
 Find1. More...
 
const TheKey1Type & Find2 (const TheKey2Type &theKey2) const
 Find2. More...
 
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. More...
 
void Clear (const Handle< NCollection_BaseAllocator > &theAllocator)
 Clear data and reset allocator. More...
 
 ~NCollection_DoubleMap (void)
 Destructor. More...
 
Standard_Integer Size (void) const
 Size. More...
 
- Public Member Functions inherited from NCollection_BaseMap
Standard_Integer NbBuckets () const
 NbBuckets. More...
 
Standard_Integer Extent () const
 Extent. More...
 
Standard_Boolean IsEmpty () const
 IsEmpty. More...
 
void Statistics (Standard_OStream &S) const
 Statistics. More...
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_BaseMap
 NCollection_BaseMap (const Standard_Integer NbBuckets, const Standard_Boolean single, const Handle< NCollection_BaseAllocator > &theAllocator)
 Constructor. More...
 
Standard_Boolean BeginResize (const Standard_Integer NbBuckets, Standard_Integer &NewBuckets, NCollection_ListNode **&data1, NCollection_ListNode **&data2) const
 BeginResize. More...
 
void EndResize (const Standard_Integer NbBuckets, const Standard_Integer NewBuckets, NCollection_ListNode **data1, NCollection_ListNode **data2)
 EndResize. More...
 
Standard_Boolean Resizable () const
 Resizable. More...
 
void Increment ()
 Increment. More...
 
void Decrement ()
 Decrement. More...
 
void Destroy (NCollection_DelMapNode fDel, Standard_Boolean doReleaseMemory=Standard_True)
 Destroy. More...
 
Standard_Integer NextPrimeForMap (const Standard_Integer N) const
 NextPrimeForMap. More...
 
void exchangeMapsData (NCollection_BaseMap &theOther)
 Exchange content of two maps without data copying. More...
 
- Protected Attributes inherited from NCollection_BaseMap
Handle< NCollection_BaseAllocatormyAllocator
 
NCollection_ListNode ** myData1
 
NCollection_ListNode ** myData2
 

Detailed Description

template<class TheKey1Type, class TheKey2Type, class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
class NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >

Purpose: The DoubleMap is used to bind pairs (Key1,Key2) and retrieve them in linear time.

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

Constructor & Destructor Documentation

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::NCollection_DoubleMap ( const Standard_Integer  NbBuckets = 1,
const Handle< NCollection_BaseAllocator > &  theAllocator = 0L 
)
inline

Constructor.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::NCollection_DoubleMap ( const NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 > &  theOther)
inline

Copy constructor.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::~NCollection_DoubleMap ( void  )
inline

Destructor.

Member Function Documentation

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Boolean NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::AreBound ( const TheKey1Type &  theKey1,
const TheKey2Type &  theKey2 
) const
inline
  • AreBound
template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
NCollection_DoubleMap& NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Assign ( const NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 > &  theOther)
inline

Assignment. This method does not change the internal allocator.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
void NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Bind ( const TheKey1Type &  theKey1,
const TheKey2Type &  theKey2 
)
inline

Bind.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
void NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Clear ( const Standard_Boolean  doReleaseMemory = Standard_True)
inline

Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
void NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Clear ( const Handle< NCollection_BaseAllocator > &  theAllocator)
inline

Clear data and reset allocator.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
void NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Exchange ( NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 > &  theOther)
inline

Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well!

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
const TheKey2Type& NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Find1 ( const TheKey1Type &  theKey1) const
inline

Find1.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
const TheKey1Type& NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Find2 ( const TheKey2Type &  theKey2) const
inline

Find2.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Boolean NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::IsBound1 ( const TheKey1Type &  theKey1) const
inline

IsBound1.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Boolean NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::IsBound2 ( const TheKey2Type &  theKey2) const
inline

IsBound2.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
NCollection_DoubleMap& NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::operator= ( const NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 > &  theOther)
inline

Assignment operator.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
void NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::ReSize ( const Standard_Integer  N)
inline

ReSize.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Integer NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::Size ( void  ) const
inline

Size.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Boolean NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::UnBind1 ( const TheKey1Type &  theKey1)
inline

UnBind1.

template<class TheKey1Type , class TheKey2Type , class Hasher1 = NCollection_DefaultHasher<TheKey1Type>, class Hasher2 = NCollection_DefaultHasher<TheKey2Type>>
Standard_Boolean NCollection_DoubleMap< TheKey1Type, TheKey2Type, Hasher1, Hasher2 >::UnBind2 ( const TheKey2Type &  theKey2)
inline

UnBind2.


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