Open CASCADE Technology 7.8.0
|
#include <NCollection_DataMap.hxx>
Data Structures | |
class | DataMapNode |
class | Iterator |
Public Types | |
typedef TheKeyType | key_type |
STL-compliant typedef for key type. | |
typedef TheItemType | value_type |
STL-compliant typedef for value type. | |
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, TheItemType, false > | iterator |
Shorthand for a regular iterator type. | |
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, TheItemType, true > | const_iterator |
Shorthand for a constant iterator type. | |
Public Member Functions | |
iterator | begin () const |
Returns an iterator pointing to the first element in the map. | |
iterator | end () const |
Returns an iterator referring to the past-the-end element in the map. | |
const_iterator | cbegin () const |
Returns a const iterator pointing to the first element in the map. | |
const_iterator | cend () const |
Returns a const iterator referring to the past-the-end element in the map. | |
NCollection_DataMap () | |
Empty Constructor. | |
NCollection_DataMap (const Standard_Integer theNbBuckets, const Handle< NCollection_BaseAllocator > &theAllocator=0L) | |
Constructor. | |
NCollection_DataMap (const NCollection_DataMap &theOther) | |
Copy constructor. | |
NCollection_DataMap (NCollection_DataMap &&theOther) noexcept | |
Move constructor. | |
void | Exchange (NCollection_DataMap &theOther) |
Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well! | |
NCollection_DataMap & | Assign (const NCollection_DataMap &theOther) |
Assignment. This method does not change the internal allocator. | |
NCollection_DataMap & | operator= (const NCollection_DataMap &theOther) |
Assignment operator. | |
NCollection_DataMap & | operator= (NCollection_DataMap &&theOther) noexcept |
Move operator. | |
void | ReSize (const Standard_Integer N) |
ReSize. | |
Standard_Boolean | Bind (const TheKeyType &theKey, const TheItemType &theItem) |
Bind binds Item to Key in map. | |
Standard_Boolean | Bind (TheKeyType &&theKey, const TheItemType &theItem) |
Bind binds Item to Key in map. | |
Standard_Boolean | Bind (const TheKeyType &theKey, TheItemType &&theItem) |
Bind binds Item to Key in map. | |
Standard_Boolean | Bind (TheKeyType &&theKey, TheItemType &&theItem) |
Bind binds Item to Key in map. | |
TheItemType * | Bound (const TheKeyType &theKey, const TheItemType &theItem) |
Bound binds Item to Key in map. | |
TheItemType * | Bound (TheKeyType &&theKey, const TheItemType &theItem) |
Bound binds Item to Key in map. | |
TheItemType * | Bound (const TheKeyType &theKey, TheItemType &&theItem) |
Bound binds Item to Key in map. | |
TheItemType * | Bound (TheKeyType &&theKey, TheItemType &&theItem) |
Bound binds Item to Key in map. | |
Standard_Boolean | IsBound (const TheKeyType &theKey) const |
IsBound. | |
Standard_Boolean | UnBind (const TheKeyType &theKey) |
UnBind removes Item Key pair from map. | |
const TheItemType * | Seek (const TheKeyType &theKey) const |
Seek returns pointer to Item by Key. Returns NULL is Key was not bound. | |
const TheItemType & | Find (const TheKeyType &theKey) const |
Find returns the Item for Key. Raises if Key was not bound. | |
Standard_Boolean | Find (const TheKeyType &theKey, TheItemType &theValue) const |
Find Item for key with copying. | |
const TheItemType & | operator() (const TheKeyType &theKey) const |
operator () | |
TheItemType * | ChangeSeek (const TheKeyType &theKey) |
ChangeSeek returns modifiable pointer to Item by Key. Returns NULL is Key was not bound. | |
TheItemType & | ChangeFind (const TheKeyType &theKey) |
ChangeFind returns mofifiable Item by Key. Raises if Key was not bound. | |
TheItemType & | operator() (const TheKeyType &theKey) |
operator () | |
void | Clear (const Standard_Boolean doReleaseMemory=Standard_False) |
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. | |
virtual | ~NCollection_DataMap (void) |
Destructor. | |
Standard_Integer | Size (void) const |
Size. | |
![]() | |
Standard_Integer | NbBuckets () const |
NbBuckets. | |
Standard_Integer | Extent () const |
Extent. | |
Standard_Boolean | IsEmpty () const |
IsEmpty. | |
void | Statistics (Standard_OStream &S) const |
Statistics. | |
const Handle< NCollection_BaseAllocator > & | Allocator () const |
Returns attached allocator. | |
Additional Inherited Members | |
![]() | |
Handle< NCollection_BaseAllocator > | myAllocator |
NCollection_ListNode ** | myData1 |
NCollection_ListNode ** | myData2 |
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.
typedef NCollection_StlIterator<std::forward_iterator_tag, Iterator, TheItemType, true> NCollection_DataMap< TheKeyType, TheItemType, Hasher >::const_iterator |
Shorthand for a constant iterator type.
typedef NCollection_StlIterator<std::forward_iterator_tag, Iterator, TheItemType, false> NCollection_DataMap< TheKeyType, TheItemType, Hasher >::iterator |
Shorthand for a regular iterator type.
typedef TheKeyType NCollection_DataMap< TheKeyType, TheItemType, Hasher >::key_type |
STL-compliant typedef for key type.
typedef TheItemType NCollection_DataMap< TheKeyType, TheItemType, Hasher >::value_type |
STL-compliant typedef for value type.
|
inline |
Empty Constructor.
|
inlineexplicit |
Constructor.
|
inline |
Copy constructor.
|
inlinenoexcept |
Move constructor.
|
inlinevirtual |
Destructor.
|
inline |
Assignment. This method does not change the internal allocator.
|
inline |
Returns an iterator pointing to the first element in the map.
|
inline |
Bind binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bind binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bind binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bind binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bound binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bound binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bound binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Bound binds Item to Key in map.
theKey | key to add/update |
theItem | new item; overrides value previously bound to the key |
|
inline |
Returns a const iterator pointing to the first element in the map.
|
inline |
Returns a const iterator referring to the past-the-end element in the map.
|
inline |
ChangeFind returns mofifiable Item by Key. Raises if Key was not bound.
|
inline |
ChangeSeek returns modifiable pointer to Item by Key. Returns NULL is Key was not bound.
|
inline |
Clear data and reset allocator.
|
inline |
Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused.
|
inline |
Returns an iterator referring to the past-the-end element in the map.
|
inline |
Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well!
|
inline |
Find returns the Item for Key. Raises if Key was not bound.
|
inline |
Find Item for key with copying.
|
inlineprotected |
|
inline |
IsBound.
|
inlineprotected |
|
inlineprotected |
Lookup for particular key in map.
[in] | theKey | key to compute hash |
[out] | theNode | the detected node with equal key. Can be null. |
|
inlineprotected |
Lookup for particular key in map.
[in] | theKey | key to compute hash |
[out] | theNode | the detected node with equal key. Can be null. |
[out] | theHash | computed bounded hash code for current key. |
|
inline |
operator ()
|
inline |
operator ()
|
inline |
Assignment operator.
|
inlinenoexcept |
Move operator.
|
inline |
ReSize.
|
inline |
Seek returns pointer to Item by Key. Returns NULL is Key was not bound.
|
inline |
Size.
|
inline |
UnBind removes Item Key pair from map.