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_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > Class Template Reference

    Helper class that allows to use NCollection iterators as STL iterators. NCollection iterator can be extended to STL iterator of any category by adding necessary methods: STL forward iterator requires IsEqual method, STL bidirectional iterator requires Previous method, and STL random access iterator requires Offset and Differ methods. See NCollection_DynamicArray as example of declaring custom STL iterators. More...

    #include <NCollection_IndexedIterator.hxx>

    Public Types

    using iterator_category = Category
    using value_type = ItemType
    using difference_type = ptrdiff_t
    using pointer = typename std::conditional<IsConstant, const ItemType*, ItemType*>::type
    using reference = typename std::conditional<IsConstant, const ItemType&, ItemType&>::type

    Public Member Functions

     NCollection_IndexedIterator () noexcept
     Default constructor.
     NCollection_IndexedIterator (const BaseIndexedMap &theMap) noexcept
     Constructor from NCollection_Indexed*Map.
     NCollection_IndexedIterator (const size_t theIndex, const BaseIndexedMap &theMap) noexcept
     Constructor from NCollection_Indexed*Map.
     NCollection_IndexedIterator (const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, false > &theOther) noexcept
     Cast from non-const variant to const one.
    NCollection_IndexedIteratoroperator= (const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, false > &theOther) noexcept
     Assignment of non-const iterator to const one.
    methods related to bidirectional STL iterator

    Prefix decrement

    NCollection_IndexedIteratoroperator-- () noexcept
     Postfix decrement.
    NCollection_IndexedIterator operator-- (int) noexcept
     Postfix decrement.

    methods related to random access STL iterator

    Move forward

    NCollection_IndexedIteratoroperator+= (typename NCollection_IndexedIterator::difference_type theOffset) noexcept
     NCollection iterator.
    NCollection_IndexedIterator operator+ (typename NCollection_IndexedIterator::difference_type theOffset) const noexcept
     Addition.
    NCollection_IndexedIteratoroperator-= (typename NCollection_IndexedIterator::difference_type theOffset) noexcept
     Move backward.
    NCollection_IndexedIterator operator- (typename NCollection_IndexedIterator::difference_type theOffset) const noexcept
     Decrease.
    NCollection_IndexedIterator::difference_type operator- (const NCollection_IndexedIterator &theOther) const noexcept
     Difference.
    NCollection_IndexedIterator::reference operator[] (typename NCollection_IndexedIterator::difference_type theOffset) const
     Get item at offset from current.
    bool operator< (const NCollection_IndexedIterator &theOther) const noexcept
     Comparison.
    bool operator> (const NCollection_IndexedIterator &theOther) const noexcept
     Comparison.
    bool operator<= (const NCollection_IndexedIterator &theOther) const noexcept
     Comparison.
    bool operator>= (const NCollection_IndexedIterator &theOther) const noexcept
     Comparison.

    methods related to forward STL iterator

    Test for equality

    bool operator== (const NCollection_IndexedIterator &theOther) const noexcept
     Test for inequality.
    template<bool theOtherIsConstant>
    bool operator== (const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, theOtherIsConstant > &theOther) const noexcept
     Test for inequality.
    template<bool theOtherIsConstant>
    bool operator!= (const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, theOtherIsConstant > &theOther) const noexcept
     Test for inequality.
    bool operator!= (const NCollection_IndexedIterator &theOther) const noexcept
     Test for inequality.
    NCollection_IndexedIterator::reference operator* () const
     Get reference to current item.
    NCollection_IndexedIterator::pointer operator-> () const
     Dereferencing operator.
    NCollection_IndexedIteratoroperator++ () noexcept
     Prefix increment.
    NCollection_IndexedIterator operator++ (int) noexcept
     Postfix increment.
    template<bool Condition>
    std::enable_if<!Condition, ItemType & >::type Reference () const
     Test for inequality.
    template<bool Condition>
    std::enable_if< Condition, constItemType & >::type Reference () const
     Test for inequality.

    Detailed Description

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    class NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >

    Helper class that allows to use NCollection iterators as STL iterators. NCollection iterator can be extended to STL iterator of any category by adding necessary methods: STL forward iterator requires IsEqual method, STL bidirectional iterator requires Previous method, and STL random access iterator requires Offset and Differ methods. See NCollection_DynamicArray as example of declaring custom STL iterators.

    Member Typedef Documentation

    ◆ difference_type

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    using NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type = ptrdiff_t

    ◆ iterator_category

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    using NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::iterator_category = Category

    ◆ pointer

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    using NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::pointer = typename std::conditional<IsConstant, const ItemType*, ItemType*>::type

    ◆ reference

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    using NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::reference = typename std::conditional<IsConstant, const ItemType&, ItemType&>::type

    ◆ value_type

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    using NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::value_type = ItemType

    Constructor & Destructor Documentation

    ◆ NCollection_IndexedIterator() [1/4]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::NCollection_IndexedIterator ( )
    inlinenoexcept

    Default constructor.

    ◆ NCollection_IndexedIterator() [2/4]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::NCollection_IndexedIterator ( const BaseIndexedMap & theMap)
    inlinenoexcept

    Constructor from NCollection_Indexed*Map.

    ◆ NCollection_IndexedIterator() [3/4]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::NCollection_IndexedIterator ( const size_t theIndex,
    const BaseIndexedMap & theMap )
    inlinenoexcept

    Constructor from NCollection_Indexed*Map.

    ◆ NCollection_IndexedIterator() [4/4]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::NCollection_IndexedIterator ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, false > & theOther)
    inlinenoexcept

    Cast from non-const variant to const one.

    Member Function Documentation

    ◆ operator!=() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator!= ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Test for inequality.

    ◆ operator!=() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    template<bool theOtherIsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator!= ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, theOtherIsConstant > & theOther) const
    inlinenoexcept

    Test for inequality.

    ◆ operator*()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator::reference NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator* ( ) const
    inline

    Get reference to current item.

    ◆ operator+()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator+ ( typename NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type theOffset) const
    inlinenoexcept

    Addition.

    ◆ operator++() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator & NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator++ ( )
    inlinenoexcept

    Prefix increment.

    ◆ operator++() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator++ ( int )
    inlinenoexcept

    Postfix increment.

    ◆ operator+=()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator & NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator+= ( typename NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type theOffset)
    inlinenoexcept

    NCollection iterator.

    ◆ operator-() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator::difference_type NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator- ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Difference.

    ◆ operator-() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator- ( typename NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type theOffset) const
    inlinenoexcept

    Decrease.

    ◆ operator--() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator & NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator-- ( )
    inlinenoexcept

    Postfix decrement.

    ◆ operator--() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator-- ( int )
    inlinenoexcept

    Postfix decrement.

    ◆ operator-=()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator & NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator-= ( typename NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type theOffset)
    inlinenoexcept

    Move backward.

    ◆ operator->()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator::pointer NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator-> ( ) const
    inline

    Dereferencing operator.

    ◆ operator<()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator< ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Comparison.

    ◆ operator<=()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator<= ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Comparison.

    ◆ operator=()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator & NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator= ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, false > & theOther)
    inlinenoexcept

    Assignment of non-const iterator to const one.

    ◆ operator==() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator== ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Test for inequality.

    ◆ operator==() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    template<bool theOtherIsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator== ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, theOtherIsConstant > & theOther) const
    inlinenoexcept

    Test for inequality.

    ◆ operator>()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator> ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Comparison.

    ◆ operator>=()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    bool NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator>= ( const NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant > & theOther) const
    inlinenoexcept

    Comparison.

    ◆ operator[]()

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    NCollection_IndexedIterator::reference NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::operator[] ( typename NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::difference_type theOffset) const
    inline

    Get item at offset from current.

    ◆ Reference() [1/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    template<bool Condition>
    std::enable_if< Condition, constItemType & >::type NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::Reference ( ) const
    inlineprotected

    Test for inequality.

    ◆ Reference() [2/2]

    template<class Category, class BaseIndexedMap, class ItemType, bool IsConstant>
    template<bool Condition>
    std::enable_if<!Condition, ItemType & >::type NCollection_IndexedIterator< Category, BaseIndexedMap, ItemType, IsConstant >::Reference ( ) const
    inlineprotected

    Test for inequality.


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