Open CASCADE Technology  7.5.0
Public Member Functions | Protected Member Functions | Protected Attributes

TCollection_BasicMap Class Reference

Root class of all the maps, provides utilitites for managing the buckets. Maps are dynamically extended data structures where data is quickly accessed with a key. General properties of maps. More...

#include <TCollection_BasicMap.hxx>

Inheritance diagram for TCollection_BasicMap:
Inheritance graph
[legend]

Public Member Functions

Standard_Integer NbBuckets () const
 Returns the number of buckets in <me>. More...
 
Standard_Integer Extent () const
 Returns the number of keys already stored in <me>. More...
 
Standard_Boolean IsEmpty () const
 Returns True when the map contains no keys. This is exactly Extent() == 0. More...
 
void Statistics (Standard_OStream &S) const
 Prints on <S> usefull statistics about the map <me>. It can be used to test the quality of the hashcoding. More...
 

Protected Member Functions

 TCollection_BasicMap (const Standard_Integer NbBuckets, const Standard_Boolean single)
 Initialize the map. Single is True when the map uses only one table of buckets. More...
 
Standard_Boolean BeginResize (const Standard_Integer NbBuckets, Standard_Integer &NewBuckets, Standard_Address &data1, Standard_Address &data2) const
 Tries to resize the Map with NbBuckets. Returns True if possible, NewBuckts is the new nuber of buckets. data1 and data2 are the new tables of buckets where the data must be copied. More...
 
void EndResize (const Standard_Integer NbBuckets, const Standard_Integer NewBuckets, const Standard_Address data1, const Standard_Address data2)
 If BeginResize was succesfull after copying the data to data1 and data2 this methods update the tables and destroys the old ones. More...
 
Standard_Boolean Resizable () const
 Returns True if resizing the map should be considered. More...
 
void Increment ()
 Decrement the extent of the map. More...
 
void Decrement ()
 Decrement the extent of the map. More...
 
void Destroy ()
 Destroys the buckets. More...
 

Protected Attributes

Standard_Address myData1
 
Standard_Address myData2
 

Detailed Description

Root class of all the maps, provides utilitites for managing the buckets. Maps are dynamically extended data structures where data is quickly accessed with a key. General properties of maps.

Constructor & Destructor Documentation

◆ TCollection_BasicMap()

TCollection_BasicMap::TCollection_BasicMap ( const Standard_Integer  NbBuckets,
const Standard_Boolean  single 
)
protected

Initialize the map. Single is True when the map uses only one table of buckets.

One table : Map, DataMap Two tables : DoubleMap, IndexedMap, IndexedDataMap

Member Function Documentation

◆ BeginResize()

Standard_Boolean TCollection_BasicMap::BeginResize ( const Standard_Integer  NbBuckets,
Standard_Integer NewBuckets,
Standard_Address data1,
Standard_Address data2 
) const
protected

Tries to resize the Map with NbBuckets. Returns True if possible, NewBuckts is the new nuber of buckets. data1 and data2 are the new tables of buckets where the data must be copied.

◆ Decrement()

void TCollection_BasicMap::Decrement ( )
protected

Decrement the extent of the map.

◆ Destroy()

void TCollection_BasicMap::Destroy ( )
protected

Destroys the buckets.

◆ EndResize()

void TCollection_BasicMap::EndResize ( const Standard_Integer  NbBuckets,
const Standard_Integer  NewBuckets,
const Standard_Address  data1,
const Standard_Address  data2 
)
protected

If BeginResize was succesfull after copying the data to data1 and data2 this methods update the tables and destroys the old ones.

◆ Extent()

Standard_Integer TCollection_BasicMap::Extent ( ) const

Returns the number of keys already stored in <me>.

◆ Increment()

void TCollection_BasicMap::Increment ( )
protected

Decrement the extent of the map.

◆ IsEmpty()

Standard_Boolean TCollection_BasicMap::IsEmpty ( ) const

Returns True when the map contains no keys. This is exactly Extent() == 0.

◆ NbBuckets()

Standard_Integer TCollection_BasicMap::NbBuckets ( ) const

Returns the number of buckets in <me>.

◆ Resizable()

Standard_Boolean TCollection_BasicMap::Resizable ( ) const
protected

Returns True if resizing the map should be considered.

◆ Statistics()

void TCollection_BasicMap::Statistics ( Standard_OStream S) const

Prints on <S> usefull statistics about the map <me>. It can be used to test the quality of the hashcoding.

Field Documentation

◆ myData1

Standard_Address TCollection_BasicMap::myData1
protected

◆ myData2

Standard_Address TCollection_BasicMap::myData2
protected

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