OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    NCollection_IndexedMap< TheKeyType, Hasher > Class Template Reference

    #include <NCollection_IndexedMap.hxx>

    Inheritance diagram for NCollection_IndexedMap< TheKeyType, Hasher >:

    Data Structures

    class  IndexedMapNode
     Adaptation of the TListNode to the INDEXEDmap. More...
    class  Iterator

    Public Types

    typedef TheKeyType key_type
     STL-compliant typedef for key type.
    typedef NCollection_StlIterator< std::forward_iterator_tag, Iterator, TheKeyType, true > const_iterator
     Shorthand for a constant iterator type.
    typedef const_iterator iterator
     Shorthand for iterator type (same as const_iterator for key-only maps).
    using KeyIndexRef = NCollection_ItemsView::KeyIndexRef<TheKeyType>
     Key-index pair reference for structured binding support. Enables: for (auto [key, index] : map.IndexedItems()).
    using IndexedItemsView
     View class for key-index pair iteration.

    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.
    IndexedItemsView IndexedItems () const
     Returns a view for key-index pair iteration. Usage: for (auto [aKey, anIndex] : aMap.IndexedItems()).
     NCollection_IndexedMap ()
     Empty constructor.
     NCollection_IndexedMap (const size_t theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor.
     NCollection_IndexedMap (const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor (legacy int-taking).
     NCollection_IndexedMap (const Hasher &theHasher, const size_t theNbBuckets=1, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor with custom hasher (copy).
     NCollection_IndexedMap (const Hasher &theHasher, const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor with custom hasher (copy, legacy int-taking).
     NCollection_IndexedMap (Hasher &&theHasher, const size_t theNbBuckets=1, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor with custom hasher (move).
     NCollection_IndexedMap (Hasher &&theHasher, const int theNbBuckets, const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
     Constructor with custom hasher (move, legacy int-taking).
     NCollection_IndexedMap (const NCollection_IndexedMap &theOther)
     Copy constructor.
     NCollection_IndexedMap (NCollection_IndexedMap &&theOther) noexcept
     Move constructor.
    void Exchange (NCollection_IndexedMap &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_IndexedMapAssign (const NCollection_IndexedMap &theOther)
     Assign. This method does not change the internal allocator.
    NCollection_IndexedMapoperator= (const NCollection_IndexedMap &theOther)
     Assignment operator.
    NCollection_IndexedMapoperator= (NCollection_IndexedMap &&theOther) noexcept
     Move operator.
    void ReSize (const size_t theExtent)
     ReSize.
    void ReSize (const int theExtent)
    int Add (const TheKeyType &theKey1)
     Add adds a new key to the map.
    int Add (TheKeyType &&theKey1)
     Add adds a new key to the map.
    const TheKeyType & Added (const TheKeyType &theKey1)
     Added: add a new key if not yet in the map, and return reference to either newly added or previously existing key.
    const TheKeyType & Added (TheKeyType &&theKey1)
     Added: add a new key if not yet in the map, and return reference to either newly added or previously existing key.
    template<typename... Args>
    int Emplace (Args &&... theArgs)
     Emplace constructs key in-place; if key exists, destroys and reconstructs.
    template<typename... Args>
    const TheKeyType & Emplaced (Args &&... theArgs)
     Emplaced constructs key in-place; if key exists, overwrites.
    template<typename... Args>
    int TryEmplace (Args &&... theArgs)
     TryEmplace constructs key in-place only if not already present.
    template<typename... Args>
    const TheKeyType & TryEmplaced (Args &&... theArgs)
     TryEmplaced constructs key in-place only if not already present.
    bool Contains (const TheKeyType &theKey1) const
     Contains.
    std::optional< std::reference_wrapper< const TheKeyType > > Contained (const TheKeyType &theKey1) const
     Contained returns optional const reference to the key in the map. Returns std::nullopt if the key is not found.
    void Substitute (const size_t theIndex, const TheKeyType &theKey1)
     Substitute.
    void Substitute (const int theIndex, const TheKeyType &theKey1)
    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)
    bool RemoveKey (const TheKeyType &theKey1)
     Remove the given key. Caution! The index of the last key can be changed.
    const TheKeyType & FindKey (const size_t theIndex) const
     FindKey.
    const TheKeyType & FindKey (const int theIndex) const
    const TheKeyType & operator() (const size_t theIndex) const
     operator ()
    const TheKeyType & operator() (const int theIndex) const
    int FindIndex (const TheKeyType &theKey1) const
     FindIndex.
    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_IndexedMap () 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, IndexedMapNode *&theNode, size_t &theHash) const
     Lookup for particular key in map.
    bool lookup (const TheKeyType &theKey, IndexedMapNode *&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, bool ReturnRef>
    auto addImpl (K &&theKey1, std::bool_constant< ReturnRef >) -> std::conditional_t< ReturnRef, const TheKeyType &, int >
     Implementation helper for Add/Added (uses TryEmplace behavior - no modification on existing).
    template<bool IsTry, bool ReturnRef, typename... Args>
    auto emplaceImpl (std::bool_constant< IsTry >, std::bool_constant< ReturnRef >, Args &&... theArgs) -> std::conditional_t< ReturnRef, const TheKeyType &, int >
     Implementation helper for Emplace/Emplaced.
    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 Hasher = NCollection_DefaultHasher<TheKeyType>>
    class NCollection_IndexedMap< TheKeyType, 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. See the class Map from NCollection for a discussion about the number of buckets.

    Member Typedef Documentation

    ◆ const_iterator

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

    Shorthand for a constant iterator type.

    ◆ IndexedItemsView

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

    View class for key-index pair iteration.

    ◆ iterator

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    typedef const_iterator NCollection_IndexedMap< TheKeyType, Hasher >::iterator

    Shorthand for iterator type (same as const_iterator for key-only maps).

    ◆ key_type

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

    STL-compliant typedef for key type.

    ◆ KeyIndexRef

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    using NCollection_IndexedMap< TheKeyType, Hasher >::KeyIndexRef = NCollection_ItemsView::KeyIndexRef<TheKeyType>

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

    Constructor & Destructor Documentation

    ◆ NCollection_IndexedMap() [1/9]

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

    Empty constructor.

    ◆ NCollection_IndexedMap() [2/9]

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

    Constructor.

    ◆ NCollection_IndexedMap() [3/9]

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

    Constructor (legacy int-taking).

    ◆ NCollection_IndexedMap() [4/9]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    NCollection_IndexedMap< TheKeyType, Hasher >::NCollection_IndexedMap ( 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_IndexedMap() [5/9]

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

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

    ◆ NCollection_IndexedMap() [6/9]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    NCollection_IndexedMap< TheKeyType, Hasher >::NCollection_IndexedMap ( 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_IndexedMap() [7/9]

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

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

    ◆ NCollection_IndexedMap() [8/9]

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

    Copy constructor.

    ◆ NCollection_IndexedMap() [9/9]

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

    Move constructor.

    ◆ ~NCollection_IndexedMap()

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

    Destructor.

    Member Function Documentation

    ◆ Add() [1/2]

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

    Add adds a new key to the map.

    Parameters
    theKey1key to add
    Returns
    index of the key (new or existing)

    ◆ Add() [2/2]

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

    Add adds a new key to the map.

    Parameters
    theKey1key to add
    Returns
    index of the key (new or existing)

    ◆ Added() [1/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    const TheKeyType & NCollection_IndexedMap< TheKeyType, Hasher >::Added ( const TheKeyType & theKey1)
    inline

    Added: add a new key if not yet in the map, and return reference to either newly added or previously existing key.

    Parameters
    theKey1key to add
    Returns
    const reference to the key in the map

    ◆ Added() [2/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    const TheKeyType & NCollection_IndexedMap< TheKeyType, Hasher >::Added ( TheKeyType && theKey1)
    inline

    Added: add a new key if not yet in the map, and return reference to either newly added or previously existing key.

    Parameters
    theKey1key to add
    Returns
    const reference to the key in the map

    ◆ addImpl()

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    template<typename K, bool ReturnRef>
    auto NCollection_IndexedMap< TheKeyType, Hasher >::addImpl ( K && theKey1,
    std::bool_constant< ReturnRef >  ) -> std::conditional_t< ReturnRef, const TheKeyType &, int >
    inlineprotected

    Implementation helper for Add/Added (uses TryEmplace behavior - no modification on existing).

    Template Parameters
    Kforwarding reference type for key
    ReturnRefif true, returns const reference to key; if false, returns int (index)
    Parameters
    theKey1key to add
    Returns
    int (Add) or const TheKeyType& (Added)

    ◆ Assign()

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

    Assign. This method does not change the internal allocator.

    ◆ begin()

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

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

    ◆ cbegin()

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

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

    ◆ cend()

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

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

    ◆ Clear() [1/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, 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 Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, Hasher >::Clear ( const occ::handle< NCollection_BaseAllocator > & theAllocator)
    inline

    Clear data and reset allocator.

    ◆ Contained()

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

    Contained returns optional const reference to the key in the map. Returns std::nullopt if the key is not found.

    ◆ Contains()

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

    Contains.

    ◆ Emplace()

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

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

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

    ◆ Emplaced()

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    template<typename... Args>
    const TheKeyType & NCollection_IndexedMap< TheKeyType, Hasher >::Emplaced ( Args &&... theArgs)
    inline

    Emplaced constructs key in-place; if key exists, overwrites.

    Parameters
    theArgsarguments forwarded to key constructor
    Returns
    const reference to the key in the map

    ◆ emplaceImpl()

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

    Implementation helper for Emplace/Emplaced.

    Template Parameters
    IsTryif true, does not modify existing; if false, overwrites
    ReturnRefif true, returns const reference to key; if false, returns int (index)
    Parameters
    theArgsarguments forwarded to key constructor
    Returns
    int or const TheKeyType& depending on ReturnRef

    ◆ end()

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

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

    ◆ Exchange()

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

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

    ◆ FindIndex()

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

    FindIndex.

    ◆ FindKey() [1/2]

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

    ◆ FindKey() [2/2]

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

    FindKey.

    ◆ GetHasher()

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

    Returns const reference to the hasher.

    ◆ HashCode()

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

    ◆ IndexedItems()

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    IndexedItemsView NCollection_IndexedMap< TheKeyType, Hasher >::IndexedItems ( ) const
    inline

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

    ◆ IsEqual()

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

    ◆ lookup() [1/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    bool NCollection_IndexedMap< TheKeyType, Hasher >::lookup ( const TheKeyType & theKey,
    IndexedMapNode *& 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 Hasher = NCollection_DefaultHasher<TheKeyType>>
    bool NCollection_IndexedMap< TheKeyType, Hasher >::lookup ( const TheKeyType & theKey,
    IndexedMapNode *& 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/2]

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

    ◆ operator()() [2/2]

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

    operator ()

    ◆ operator=() [1/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    NCollection_IndexedMap & NCollection_IndexedMap< TheKeyType, Hasher >::operator= ( const NCollection_IndexedMap< TheKeyType, Hasher > & theOther)
    inline

    Assignment operator.

    ◆ operator=() [2/2]

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

    Move operator.

    ◆ RemoveFromIndex() [1/2]

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

    ◆ RemoveFromIndex() [2/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, 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 Hasher = NCollection_DefaultHasher<TheKeyType>>
    bool NCollection_IndexedMap< TheKeyType, 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 Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, Hasher >::RemoveLast ( )
    inline

    RemoveLast.

    ◆ ReSize() [1/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, Hasher >::ReSize ( const int theExtent)
    inline

    ◆ ReSize() [2/2]

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    void NCollection_IndexedMap< TheKeyType, Hasher >::ReSize ( const size_t theExtent)
    inline

    ReSize.

    ◆ Substitute() [1/2]

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

    ◆ Substitute() [2/2]

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

    Substitute.

    ◆ Swap() [1/2]

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

    ◆ Swap() [2/2]

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

    Swaps two elements with the given indices.

    ◆ TryEmplace()

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

    TryEmplace constructs key in-place only if not already present.

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

    ◆ TryEmplaced()

    template<class TheKeyType, class Hasher = NCollection_DefaultHasher<TheKeyType>>
    template<typename... Args>
    const TheKeyType & NCollection_IndexedMap< TheKeyType, Hasher >::TryEmplaced ( Args &&... theArgs)
    inline

    TryEmplaced constructs key in-place only if not already present.

    Parameters
    theArgsarguments forwarded to key constructor
    Returns
    const reference to the key (existing or newly added)

    Field Documentation

    ◆ myHasher

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

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