Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
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  Iterator
 Implementation of the Iterator interface. More...
 

Public Types

typedef TheKeyType key_type
 STL-compliant typedef for key type.
 
typedef TheItemType value_type
 STL-compliant typedef for value type.
 
typedef Hasher hasher
 
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, TheItemType, falseiterator
 Shorthand for a regular iterator type.
 
typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, TheItemType, trueconst_iterator
 Shorthand for a constant iterator type.
 
using KeyValueRef = NCollection_ItemsView::KeyValueRef<TheKeyType, TheItemType, false>
 Key-value pair reference for structured binding support. Enables: for (auto [key, value] : map.Items())
 
using ConstKeyValueRef = NCollection_ItemsView::KeyValueRef<TheKeyType, TheItemType, true>
 Const key-value pair reference for structured binding support.
 
using KeyValueIndexRef = NCollection_ItemsView::KeyValueIndexRef<TheKeyType, TheItemType, false>
 Key-value-index tuple reference for structured binding support. Enables: for (auto [key, value, index] : map.IndexedItems())
 
using ConstKeyValueIndexRef
 Const key-value-index tuple reference for structured binding support.
 
using ItemsView
 View class for key-value pair iteration (mutable).
 
using ConstItemsView
 View class for key-value pair iteration (const).
 
using IndexedItemsView
 View class for key-value-index tuple iteration (mutable).
 
using ConstIndexedItemsView
 View class for key-value-index tuple iteration (const).
 

Public Member Functions

iterator begin () const noexcept
 Returns an iterator pointing to the first element in the map.
 
iterator end () const noexcept
 Returns an iterator referring to the past-the-end element in the map.
 
const_iterator cbegin () const noexcept
 Returns a const iterator pointing to the first element in the map.
 
const_iterator cend () const noexcept
 Returns a const iterator referring to the past-the-end element in the map.
 
ItemsView Items ()
 Returns a view for key-value pair iteration. Usage: for (auto [aKey, aValue] : aMap.Items())
 
ConstItemsView Items () const
 Returns a const view for key-value pair iteration. Usage: for (const auto& [aKey, aValue] : aMap.Items())
 
IndexedItemsView IndexedItems ()
 Returns a view for key-value-index tuple iteration. Usage: for (auto [aKey, aValue, anIndex] : aMap.IndexedItems())
 
ConstIndexedItemsView IndexedItems () const
 Returns a const view for key-value-index tuple iteration. Usage: for (const auto& [aKey, aValue, anIndex] : aMap.IndexedItems())
 
 NCollection_IndexedDataMap ()
 Empty constructor.
 
 NCollection_IndexedDataMap (const size_t theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor.
 
 NCollection_IndexedDataMap (const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor (legacy int-taking).
 
 NCollection_IndexedDataMap (const Hasher &theHasher, const size_t theNbBuckets=1, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor with custom hasher (copy).
 
 NCollection_IndexedDataMap (const Hasher &theHasher, const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor with custom hasher (copy, legacy int-taking).
 
 NCollection_IndexedDataMap (Hasher &&theHasher, const size_t theNbBuckets=1, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor with custom hasher (move).
 
 NCollection_IndexedDataMap (Hasher &&theHasher, const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Constructor with custom hasher (move, legacy int-taking).
 
 NCollection_IndexedDataMap (const NCollection_IndexedDataMap &theOther)
 Copy constructor.
 
 NCollection_IndexedDataMap (NCollection_IndexedDataMap &&theOther) noexcept
 Move constructor.
 
void Exchange (NCollection_IndexedDataMap &theOther) noexcept
 Exchange the content of two maps without re-allocations. Notice that allocators will be swapped as well!
 
const Hasher & GetHasher () const noexcept
 Returns const reference to the hasher.
 
NCollection_IndexedDataMapAssign (const NCollection_IndexedDataMap &theOther)
 Assignment. This method does not change the internal allocator.
 
NCollection_IndexedDataMapoperator= (const NCollection_IndexedDataMap &theOther)
 Assignment operator.
 
NCollection_IndexedDataMapoperator= (NCollection_IndexedDataMap &&theOther) noexcept
 Move operator.
 
void ReSize (const size_t N)
 ReSize.
 
void ReSize (const int N)
 
int Add (const TheKeyType &theKey1, const TheItemType &theItem)
 Returns the Index of already bound Key or appends new Key with specified Item value.
 
int Add (TheKeyType &&theKey1, const TheItemType &theItem)
 Returns the Index of already bound Key or appends new Key with specified Item value.
 
int Add (const TheKeyType &theKey1, TheItemType &&theItem)
 Returns the Index of already bound Key or appends new Key with specified Item value.
 
int Add (TheKeyType &&theKey1, TheItemType &&theItem)
 Returns the Index of already bound Key or appends new Key with specified Item value.
 
TheItemTypeTryBound (const TheKeyType &theKey1, const TheItemType &theItem)
 TryBound binds Item to Key only if Key is not yet bound.
 
TheItemTypeTryBound (TheKeyType &&theKey1, const TheItemType &theItem)
 TryBound binds Item to Key only if Key is not yet bound.
 
TheItemTypeTryBound (const TheKeyType &theKey1, TheItemType &&theItem)
 TryBound binds Item to Key only if Key is not yet bound.
 
TheItemTypeTryBound (TheKeyType &&theKey1, TheItemType &&theItem)
 TryBound binds Item to Key only if Key is not yet bound.
 
bool TryBind (const TheKeyType &theKey1, const TheItemType &theItem)
 TryBind binds Item to Key only if Key is not yet bound.
 
bool TryBind (TheKeyType &&theKey1, const TheItemType &theItem)
 TryBind binds Item to Key only if Key is not yet bound.
 
bool TryBind (const TheKeyType &theKey1, TheItemType &&theItem)
 TryBind binds Item to Key only if Key is not yet bound.
 
bool TryBind (TheKeyType &&theKey1, TheItemType &&theItem)
 TryBind binds Item to Key only if Key is not yet bound.
 
bool Bind (const TheKeyType &theKey1, const TheItemType &theItem)
 Bind binds Item to Key in map; overwrites value if Key already exists.
 
bool Bind (TheKeyType &&theKey1, const TheItemType &theItem)
 Bind binds Item to Key in map; overwrites value if Key already exists.
 
bool Bind (const TheKeyType &theKey1, TheItemType &&theItem)
 Bind binds Item to Key in map; overwrites value if Key already exists.
 
bool Bind (TheKeyType &&theKey1, TheItemType &&theItem)
 Bind binds Item to Key in map; overwrites value if Key already exists.
 
TheItemTypeBound (const TheKeyType &theKey1, const TheItemType &theItem)
 Bound binds Item to Key in map; overwrites value if Key already exists.
 
TheItemTypeBound (TheKeyType &&theKey1, const TheItemType &theItem)
 Bound binds Item to Key in map; overwrites value if Key already exists.
 
TheItemTypeBound (const TheKeyType &theKey1, TheItemType &&theItem)
 Bound binds Item to Key in map; overwrites value if Key already exists.
 
TheItemTypeBound (TheKeyType &&theKey1, TheItemType &&theItem)
 Bound binds Item to Key in map; overwrites value if Key already exists.
 
template<typename K , typename... Args>
int Emplace (K &&theKey1, Args &&... theArgs)
 Emplace constructs value in-place; if key exists, overwrites value.
 
template<typename K , typename... Args>
TheItemTypeEmplaced (K &&theKey1, Args &&... theArgs)
 Emplaced constructs value in-place; if key exists, destroys and reconstructs value.
 
template<typename K , typename... Args>
int TryEmplace (K &&theKey1, Args &&... theArgs)
 TryEmplace constructs value in-place only if key not already bound.
 
template<typename K , typename... Args>
TheItemTypeTryEmplaced (K &&theKey1, Args &&... theArgs)
 TryEmplaced constructs value in-place only if key not already bound.
 
bool Contains (const TheKeyType &theKey1) const
 Contains.
 
std::optional< std::pair< std::reference_wrapper< const TheKeyType >, std::reference_wrapper< const TheItemType > > > Contained (const TheKeyType &theKey1) const
 Contained returns optional pair of const references to key and value. Returns std::nullopt if the key is not found.
 
std::optional< std::pair< std::reference_wrapper< const TheKeyType >, std::reference_wrapper< TheItemType > > > Contained (const TheKeyType &theKey1)
 Contained returns optional pair of const key reference and mutable value reference. Returns std::nullopt if the key is not found.
 
void Substitute (const size_t theIndex, const TheKeyType &theKey1, const TheItemType &theItem)
 Substitute.
 
void Substitute (const int theIndex, const TheKeyType &theKey1, const TheItemType &theItem)
 
void Swap (const size_t theIndex1, const size_t theIndex2)
 Swaps two elements with the given indices.
 
void Swap (const int theIndex1, const int theIndex2)
 
void RemoveLast ()
 RemoveLast.
 
void RemoveFromIndex (const size_t theIndex)
 Remove the key of the given index. Caution! The index of the last key can be changed.
 
void RemoveFromIndex (const int theIndex)
 
void RemoveKey (const TheKeyType &theKey1)
 Remove the given key. Caution! The index of the last key can be changed.
 
const TheKeyTypeFindKey (const size_t theIndex) const
 FindKey.
 
const TheKeyTypeFindKey (const int theIndex) const
 
const TheItemTypeFindFromIndex (const size_t theIndex) const
 FindFromIndex.
 
const TheItemTypeFindFromIndex (const int theIndex) const
 
const TheItemTypeoperator() (const size_t theIndex) const
 operator ()
 
const TheItemTypeoperator() (const int theIndex) const
 
TheItemTypeChangeFromIndex (const size_t theIndex)
 ChangeFromIndex.
 
TheItemTypeChangeFromIndex (const int theIndex)
 
TheItemTypeoperator() (const size_t theIndex)
 operator ()
 
TheItemTypeoperator() (const int theIndex)
 
int FindIndex (const TheKeyType &theKey1) const
 FindIndex.
 
const TheItemTypeFindFromKey (const TheKeyType &theKey1) const
 FindFromKey.
 
TheItemTypeChangeFromKey (const TheKeyType &theKey1)
 ChangeFromKey.
 
const TheItemTypeSeek (const TheKeyType &theKey1) const
 Seek returns pointer to Item by Key. Returns NULL if Key was not found.
 
TheItemTypeChangeSeek (const TheKeyType &theKey1)
 ChangeSeek returns modifiable pointer to Item by Key. Returns NULL if Key was not found.
 
bool FindFromKey (const TheKeyType &theKey1, TheItemType &theValue) const
 Find value for key with copying.
 
void Clear (const bool doReleaseMemory=false)
 Clear data. If doReleaseMemory is false then the table of buckets is not released and will be reused.
 
void Clear (const occ::handle< NCollection_BaseAllocator > &theAllocator)
 Clear data and reset allocator.
 
 ~NCollection_IndexedDataMap () override
 Destructor.
 
- Public Member Functions inherited from NCollection_BaseMap
size_t NbBuckets () const noexcept
 NbBuckets.
 
int Extent () const noexcept
 Extent (number of elements, legacy int-returning API).
 
int Length () const noexcept
 Length - number of elements (legacy int-returning API, synonym of Extent()).
 
size_t Size () const noexcept
 Size - number of elements.
 
bool IsEmpty () const noexcept
 IsEmpty.
 
const occ::handle< NCollection_BaseAllocator > & Allocator () const noexcept
 Returns attached allocator.
 

Protected Member Functions

bool lookup (const TheKeyType &theKey, IndexedDataMapNode *&theNode, size_t &theHash) const
 Lookup for particular key in map.
 
bool lookup (const TheKeyType &theKey, IndexedDataMapNode *&theNode) const
 Lookup for particular key in map.
 
bool IsEqual (const TheKeyType &theKey1, const TheKeyType &theKey2) const
 
size_t HashCode (const TheKeyType &theKey, const size_t theUpperBound) const
 
template<typename K , typename V >
int addImpl (K &&theKey1, V &&theItem)
 Implementation helper for Add (returns index).
 
template<typename K , bool IsTry, bool ReturnRef, typename... Args>
auto emplaceImpl (K &&theKey1, std::bool_constant< IsTry >, std::bool_constant< ReturnRef >, Args &&... theArgs) -> std::conditional_t< ReturnRef, TheItemType &, int >
 Implementation helper for Emplace/TryEmplace operations.
 
template<typename K , typename V , bool IsTry, bool ReturnRef>
auto bindImpl (K &&theKey1, V &&theItem, std::bool_constant< IsTry >, std::bool_constant< ReturnRef >) -> std::conditional_t< ReturnRef, TheItemType &, bool >
 Implementation helper for Bind/TryBind/Bound/TryBound operations.
 
- Protected Member Functions inherited from NCollection_BaseMap
 NCollection_BaseMap (const size_t theNbBuckets, const bool single, const occ::handle< NCollection_BaseAllocator > &theAllocator)
 Constructor.
 
 NCollection_BaseMap (NCollection_BaseMap &&theOther) noexcept
 Move Constructor.
 
virtual ~NCollection_BaseMap ()=default
 Destructor.
 
bool BeginResize (const size_t theExtent, size_t &theNewBuckets, NCollection_ListNode **&data1, NCollection_ListNode **&data2) const
 BeginResize.
 
void EndResize (const size_t theExtent, const size_t theNewBuckets, NCollection_ListNode **data1, NCollection_ListNode **data2) noexcept
 EndResize.
 
bool Resizable () const noexcept
 Resizable.
 
size_t Increment () noexcept
 Increment.
 
size_t Decrement () noexcept
 Decrement.
 
void Destroy (NCollection_DelMapNode fDel, bool doReleaseMemory=true)
 Destroy.
 
size_t NextPrimeForMap (const size_t N) const noexcept
 NextPrimeForMap.
 
void exchangeMapsData (NCollection_BaseMap &theOther) noexcept
 Exchange content of two maps without data copying.
 
NCollection_BaseMapoperator= (NCollection_BaseMap &&) noexcept=delete
 Move operator.
 
 NCollection_BaseMap (const NCollection_BaseMap &)=delete
 Copy Constructor.
 
NCollection_BaseMapoperator= (const NCollection_BaseMap &)=delete
 Assign operator.
 

Protected Attributes

Hasher myHasher
 
- Protected Attributes inherited from NCollection_BaseMap
occ::handle< NCollection_BaseAllocatormyAllocator
 
NCollection_ListNode ** myData1
 
NCollection_ListNode ** myData2
 

Additional Inherited Members

- Static Protected Member Functions inherited from NCollection_BaseMap
static size_t NbBucketsFromInt (const int theNbBuckets)
 Converts legacy int bucket count to size_t with validation.
 

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.

Member Typedef Documentation

◆ const_iterator

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
typedef NCollection_StlIterator<std::forward_iterator_tag, Iterator, TheItemType, true> NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::const_iterator

Shorthand for a constant iterator type.

◆ ConstIndexedItemsView

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ConstIndexedItemsView
Initial value:
NCollection_ItemsView::
View<NCollection_IndexedDataMap, ConstKeyValueIndexRef, ConstIndexedItemsExtractor, true>

View class for key-value-index tuple iteration (const).

◆ ConstItemsView

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ConstItemsView
Initial value:
NCollection_ItemsView::
View<NCollection_IndexedDataMap, ConstKeyValueRef, ConstItemsExtractor, true>

View class for key-value pair iteration (const).

◆ ConstKeyValueIndexRef

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ConstKeyValueIndexRef
Initial value:
Key-value-index tuple reference for structured binding support. Enables: for (auto [key,...
Definition NCollection_ItemsView.hxx:67

Const key-value-index tuple reference for structured binding support.

◆ ConstKeyValueRef

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ConstKeyValueRef = NCollection_ItemsView::KeyValueRef<TheKeyType, TheItemType, true>

Const key-value pair reference for structured binding support.

◆ hasher

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
typedef Hasher NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::hasher

◆ IndexedItemsView

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::IndexedItemsView
Initial value:
NCollection_ItemsView::
View<NCollection_IndexedDataMap, KeyValueIndexRef, IndexedItemsExtractor, false>

View class for key-value-index tuple iteration (mutable).

◆ ItemsView

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ItemsView
Initial value:
Generic view class for Items() iteration.
Definition NCollection_ItemsView.hxx:174

View class for key-value pair iteration (mutable).

◆ iterator

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
typedef NCollection_StlIterator<std::forward_iterator_tag, Iterator, TheItemType, false> NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::iterator

Shorthand for a regular iterator type.

◆ key_type

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
typedef TheKeyType NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::key_type

STL-compliant typedef for key type.

◆ KeyValueIndexRef

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::KeyValueIndexRef = NCollection_ItemsView::KeyValueIndexRef<TheKeyType, TheItemType, false>

Key-value-index tuple reference for structured binding support. Enables: for (auto [key, value, index] : map.IndexedItems())

◆ KeyValueRef

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
using NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::KeyValueRef = NCollection_ItemsView::KeyValueRef<TheKeyType, TheItemType, false>

Key-value pair reference for structured binding support. Enables: for (auto [key, value] : map.Items())

◆ value_type

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
typedef TheItemType NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::value_type

STL-compliant typedef for value type.

Constructor & Destructor Documentation

◆ NCollection_IndexedDataMap() [1/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( )
inline

Empty constructor.

◆ NCollection_IndexedDataMap() [2/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const size_t theNbBuckets,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor.

◆ NCollection_IndexedDataMap() [3/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const int theNbBuckets,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor (legacy int-taking).

◆ NCollection_IndexedDataMap() [4/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const Hasher & theHasher,
const size_t theNbBuckets = 1,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor with custom hasher (copy).

Parameters
theHashercustom hasher instance
theNbBucketsinitial number of buckets
theAllocatorcustom memory allocator

◆ NCollection_IndexedDataMap() [5/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( const Hasher & theHasher,
const int theNbBuckets,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor with custom hasher (copy, legacy int-taking).

◆ NCollection_IndexedDataMap() [6/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( Hasher && theHasher,
const size_t theNbBuckets = 1,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor with custom hasher (move).

Parameters
theHashercustom hasher instance (moved)
theNbBucketsinitial number of buckets
theAllocatorcustom memory allocator

◆ NCollection_IndexedDataMap() [7/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( Hasher && theHasher,
const int theNbBuckets,
const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr )
inlineexplicit

Constructor with custom hasher (move, legacy int-taking).

◆ NCollection_IndexedDataMap() [8/9]

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

Copy constructor.

◆ NCollection_IndexedDataMap() [9/9]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::NCollection_IndexedDataMap ( NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > && theOther)
inlinenoexcept

Move constructor.

◆ ~NCollection_IndexedDataMap()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::~NCollection_IndexedDataMap ( )
inlineoverride

Destructor.

Member Function Documentation

◆ Add() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Add ( const TheKeyType & theKey1,
const TheItemType & theItem )
inline

Returns the Index of already bound Key or appends new Key with specified Item value.

Parameters
theKey1Key to search (and to bind, if it was not bound already)
theItemItem value to set for newly bound Key; ignored if Key was already bound
Returns
index of Key

◆ Add() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Add ( const TheKeyType & theKey1,
TheItemType && theItem )
inline

Returns the Index of already bound Key or appends new Key with specified Item value.

Parameters
theKey1Key to search (and to bind, if it was not bound already)
theItemItem value to set for newly bound Key; ignored if Key was already bound
Returns
index of Key

◆ Add() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Add ( TheKeyType && theKey1,
const TheItemType & theItem )
inline

Returns the Index of already bound Key or appends new Key with specified Item value.

Parameters
theKey1Key to search (and to bind, if it was not bound already)
theItemItem value to set for newly bound Key; ignored if Key was already bound
Returns
index of Key

◆ Add() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Add ( TheKeyType && theKey1,
TheItemType && theItem )
inline

Returns the Index of already bound Key or appends new Key with specified Item value.

Parameters
theKey1Key to search (and to bind, if it was not bound already)
theItemItem value to set for newly bound Key; ignored if Key was already bound
Returns
index of Key

◆ addImpl()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename V >
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::addImpl ( K && theKey1,
V && theItem )
inlineprotected

Implementation helper for Add (returns index).

Template Parameters
Kforwarding reference type for key
Vforwarding reference type for value
Parameters
theKey1key to add
theItemitem to bind
Returns
index of the key (new or existing)

◆ Assign()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Assign ( const NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > & theOther)
inline

Assignment. This method does not change the internal allocator.

◆ begin()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
iterator NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::begin ( ) const
inlinenoexcept

Returns an iterator pointing to the first element in the map.

◆ Bind() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bind ( const TheKeyType & theKey1,
const TheItemType & theItem )
inline

Bind binds Item to Key in map; overwrites value if Key already exists.

Parameters
theKey1key to add/update
theItemnew item; overrides value previously bound to the key
Returns
true if Key was not bound already

◆ Bind() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bind ( const TheKeyType & theKey1,
TheItemType && theItem )
inline

Bind binds Item to Key in map; overwrites value if Key already exists.

◆ Bind() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bind ( TheKeyType && theKey1,
const TheItemType & theItem )
inline

Bind binds Item to Key in map; overwrites value if Key already exists.

◆ Bind() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bind ( TheKeyType && theKey1,
TheItemType && theItem )
inline

Bind binds Item to Key in map; overwrites value if Key already exists.

◆ bindImpl()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename V , bool IsTry, bool ReturnRef>
auto NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::bindImpl ( K && theKey1,
V && theItem,
std::bool_constant< IsTry > ,
std::bool_constant< ReturnRef >  ) -> std::conditional_t<ReturnRef, TheItemType&, bool>
inlineprotected

Implementation helper for Bind/TryBind/Bound/TryBound operations.

Template Parameters
Kforwarding reference type for key
Vforwarding reference type for value
IsTryif true, does not modify existing; if false, overwrites
ReturnRefif true, returns reference; if false, returns bool
Returns
bool or TheItemType& depending on ReturnRef

◆ Bound() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bound ( const TheKeyType & theKey1,
const TheItemType & theItem )
inline

Bound binds Item to Key in map; overwrites value if Key already exists.

Parameters
theKey1key to add/update
theItemnew item; overrides value previously bound to the key
Returns
pointer to modifiable Item

◆ Bound() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bound ( const TheKeyType & theKey1,
TheItemType && theItem )
inline

Bound binds Item to Key in map; overwrites value if Key already exists.

◆ Bound() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bound ( TheKeyType && theKey1,
const TheItemType & theItem )
inline

Bound binds Item to Key in map; overwrites value if Key already exists.

◆ Bound() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Bound ( TheKeyType && theKey1,
TheItemType && theItem )
inline

Bound binds Item to Key in map; overwrites value if Key already exists.

◆ cbegin()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const_iterator NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::cbegin ( ) const
inlinenoexcept

Returns a const iterator pointing to the first element in the map.

◆ cend()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const_iterator NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::cend ( ) const
inlinenoexcept

Returns a const iterator referring to the past-the-end element in the map.

◆ ChangeFromIndex() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeFromIndex ( const int theIndex)
inline

◆ ChangeFromIndex() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeFromIndex ( const size_t theIndex)
inline

ChangeFromIndex.

◆ ChangeFromKey()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeFromKey ( const TheKeyType & theKey1)
inline

ChangeFromKey.

◆ ChangeSeek()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ChangeSeek ( const TheKeyType & theKey1)
inline

ChangeSeek returns modifiable pointer to Item by Key. Returns NULL if Key was not found.

◆ Clear() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Clear ( const bool doReleaseMemory = false)
inline

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

◆ Clear() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Clear ( const occ::handle< NCollection_BaseAllocator > & theAllocator)
inline

Clear data and reset allocator.

◆ Contained() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
std::optional< std::pair< std::reference_wrapper< const TheKeyType >, std::reference_wrapper< TheItemType > > > NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Contained ( const TheKeyType & theKey1)
inline

Contained returns optional pair of const key reference and mutable value reference. Returns std::nullopt if the key is not found.

◆ Contained() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
std::optional< std::pair< std::reference_wrapper< const TheKeyType >, std::reference_wrapper< const TheItemType > > > NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Contained ( const TheKeyType & theKey1) const
inline

Contained returns optional pair of const references to key and value. Returns std::nullopt if the key is not found.

◆ Contains()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Contains ( const TheKeyType & theKey1) const
inline

Contains.

◆ Emplace()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename... Args>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Emplace ( K && theKey1,
Args &&... theArgs )
inline

Emplace constructs value in-place; if key exists, overwrites value.

Parameters
theKey1key to add/update
theArgsarguments forwarded to value constructor
Returns
index of the key (new or existing)

◆ Emplaced()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename... Args>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Emplaced ( K && theKey1,
Args &&... theArgs )
inline

Emplaced constructs value in-place; if key exists, destroys and reconstructs value.

Parameters
theKey1key to add/update
theArgsarguments forwarded to value constructor
Returns
reference to the value (existing reconstructed or newly added)

◆ emplaceImpl()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , bool IsTry, bool ReturnRef, typename... Args>
auto NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::emplaceImpl ( K && theKey1,
std::bool_constant< IsTry > ,
std::bool_constant< ReturnRef > ,
Args &&... theArgs ) -> std::conditional_t<ReturnRef, TheItemType&, int>
inlineprotected

Implementation helper for Emplace/TryEmplace operations.

Template Parameters
Kforwarding reference type for key
IsTryif true, does not modify existing; if false, overwrites
ReturnRefif true, returns reference; if false, returns int (index)
Parameters
theKey1key to add/update
theArgsarguments forwarded to value constructor
Returns
int (index) or TheItemType& depending on ReturnRef

◆ end()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
iterator NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::end ( ) const
inlinenoexcept

Returns an iterator referring to the past-the-end element in the map.

◆ Exchange()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Exchange ( NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > & theOther)
inlinenoexcept

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

◆ FindFromIndex() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromIndex ( const int theIndex) const
inline

◆ FindFromIndex() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromIndex ( const size_t theIndex) const
inline

FindFromIndex.

◆ FindFromKey() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromKey ( const TheKeyType & theKey1) const
inline

FindFromKey.

◆ FindFromKey() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindFromKey ( const TheKeyType & theKey1,
TheItemType & theValue ) const
inline

Find value for key with copying.

Returns
true if key was found

◆ FindIndex()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindIndex ( const TheKeyType & theKey1) const
inline

FindIndex.

◆ FindKey() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheKeyType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindKey ( const int theIndex) const
inline

◆ FindKey() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheKeyType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::FindKey ( const size_t theIndex) const
inline

FindKey.

◆ GetHasher()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const Hasher & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::GetHasher ( ) const
inlinenoexcept

Returns const reference to the hasher.

◆ HashCode()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
size_t NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::HashCode ( const TheKeyType & theKey,
const size_t theUpperBound ) const
inlineprotected

◆ IndexedItems() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
IndexedItemsView NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::IndexedItems ( )
inline

Returns a view for key-value-index tuple iteration. Usage: for (auto [aKey, aValue, anIndex] : aMap.IndexedItems())

◆ IndexedItems() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
ConstIndexedItemsView NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::IndexedItems ( ) const
inline

Returns a const view for key-value-index tuple iteration. Usage: for (const auto& [aKey, aValue, anIndex] : aMap.IndexedItems())

◆ IsEqual()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::IsEqual ( const TheKeyType & theKey1,
const TheKeyType & theKey2 ) const
inlineprotected

◆ Items() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
ItemsView NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Items ( )
inline

Returns a view for key-value pair iteration. Usage: for (auto [aKey, aValue] : aMap.Items())

◆ Items() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
ConstItemsView NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Items ( ) const
inline

Returns a const view for key-value pair iteration. Usage: for (const auto& [aKey, aValue] : aMap.Items())

◆ lookup() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::lookup ( const TheKeyType & theKey,
IndexedDataMapNode *& theNode ) const
inlineprotected

Lookup for particular key in map.

Parameters
[in]theKeykey to compute hash
[out]theNodethe detected node with equal key. Can be null.
Returns
true if key is found

◆ lookup() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::lookup ( const TheKeyType & theKey,
IndexedDataMapNode *& theNode,
size_t & theHash ) const
inlineprotected

Lookup for particular key in map.

Parameters
[in]theKeykey to compute hash
[out]theNodethe detected node with equal key. Can be null.
[out]theHashcomputed bounded hash code for current key.
Returns
true if key is found

◆ operator()() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const int theIndex)
inline

◆ operator()() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const int theIndex) const
inline

◆ operator()() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const size_t theIndex)
inline

operator ()

◆ operator()() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator() ( const size_t theIndex) const
inline

operator ()

◆ operator=() [1/2]

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

Assignment operator.

◆ operator=() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
NCollection_IndexedDataMap & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::operator= ( NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher > && theOther)
inlinenoexcept

Move operator.

◆ RemoveFromIndex() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::RemoveFromIndex ( const int theIndex)
inline

◆ RemoveFromIndex() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::RemoveFromIndex ( const size_t theIndex)
inline

Remove the key of the given index. Caution! The index of the last key can be changed.

◆ RemoveKey()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::RemoveKey ( const TheKeyType & theKey1)
inline

Remove the given key. Caution! The index of the last key can be changed.

◆ RemoveLast()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::RemoveLast ( )
inline

RemoveLast.

◆ ReSize() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ReSize ( const int N)
inline

◆ ReSize() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::ReSize ( const size_t N)
inline

ReSize.

◆ Seek()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
const TheItemType * NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Seek ( const TheKeyType & theKey1) const
inline

Seek returns pointer to Item by Key. Returns NULL if Key was not found.

◆ Substitute() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Substitute ( const int theIndex,
const TheKeyType & theKey1,
const TheItemType & theItem )
inline

◆ Substitute() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Substitute ( const size_t theIndex,
const TheKeyType & theKey1,
const TheItemType & theItem )
inline

Substitute.

◆ Swap() [1/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Swap ( const int theIndex1,
const int theIndex2 )
inline

◆ Swap() [2/2]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
void NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::Swap ( const size_t theIndex1,
const size_t theIndex2 )
inline

Swaps two elements with the given indices.

◆ TryBind() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBind ( const TheKeyType & theKey1,
const TheItemType & theItem )
inline

TryBind binds Item to Key only if Key is not yet bound.

Parameters
theKey1key to add
theItemitem to bind if Key is not yet bound
Returns
true if key was newly added, false if key already existed

◆ TryBind() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBind ( const TheKeyType & theKey1,
TheItemType && theItem )
inline

TryBind binds Item to Key only if Key is not yet bound.

◆ TryBind() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBind ( TheKeyType && theKey1,
const TheItemType & theItem )
inline

TryBind binds Item to Key only if Key is not yet bound.

◆ TryBind() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
bool NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBind ( TheKeyType && theKey1,
TheItemType && theItem )
inline

TryBind binds Item to Key only if Key is not yet bound.

◆ TryBound() [1/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBound ( const TheKeyType & theKey1,
const TheItemType & theItem )
inline

TryBound binds Item to Key only if Key is not yet bound.

Parameters
theKey1key to add
theItemitem to bind if Key is not yet bound
Returns
reference to existing or newly bound Item

◆ TryBound() [2/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBound ( const TheKeyType & theKey1,
TheItemType && theItem )
inline

TryBound binds Item to Key only if Key is not yet bound.

◆ TryBound() [3/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBound ( TheKeyType && theKey1,
const TheItemType & theItem )
inline

TryBound binds Item to Key only if Key is not yet bound.

◆ TryBound() [4/4]

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryBound ( TheKeyType && theKey1,
TheItemType && theItem )
inline

TryBound binds Item to Key only if Key is not yet bound.

◆ TryEmplace()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename... Args>
int NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryEmplace ( K && theKey1,
Args &&... theArgs )
inline

TryEmplace constructs value in-place only if key not already bound.

Parameters
theKey1key to add
theArgsarguments forwarded to value constructor
Returns
index of the key (new or existing)

◆ TryEmplaced()

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
template<typename K , typename... Args>
TheItemType & NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::TryEmplaced ( K && theKey1,
Args &&... theArgs )
inline

TryEmplaced constructs value in-place only if key not already bound.

Parameters
theKey1key to add
theArgsarguments forwarded to value constructor
Returns
reference to the value (existing or newly added)

Field Documentation

◆ myHasher

template<class TheKeyType , class TheItemType , class Hasher = NCollection_DefaultHasher<TheKeyType>>
Hasher NCollection_IndexedDataMap< TheKeyType, TheItemType, Hasher >::myHasher
protected

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