Open CASCADE Technology  7.6.0
Public Member Functions

NCollection_StlIterator< Category, BaseIterator, 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_Vector as example of declaring custom STL iterators. More...

#include <NCollection_StlIterator.hxx>

Inheritance diagram for NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >:
Inheritance graph
[legend]

Public Member Functions

 NCollection_StlIterator ()
 Default constructor. More...
 
 NCollection_StlIterator (const BaseIterator &theIterator)
 Constructor from NCollection iterator. More...
 
 NCollection_StlIterator (const NCollection_StlIterator< Category, BaseIterator, ItemType, false > &theIterator)
 Cast from non-const variant to const one. More...
 
NCollection_StlIteratoroperator= (const NCollection_StlIterator< Category, BaseIterator, ItemType, false > &theIterator)
 Assignment of non-const iterator to const one. More...
 
const BaseIterator & Iterator () const
 Access to NCollection iterator instance. More...
 
BaseIterator & ChangeIterator ()
 Access to NCollection iterator instance. More...
 
methods related to bidirectional STL iterator
NCollection_StlIteratoroperator-- ()
 Prefix decrement. More...
 
NCollection_StlIterator operator-- (int)
 Postfix decrement. More...
 

methods related to random access STL iterator

NCollection_StlIteratoroperator+= (typename NCollection_StlIterator::difference_type theOffset)
 Move forward. More...
 
NCollection_StlIterator operator+ (typename NCollection_StlIterator::difference_type theOffset) const
 Addition. More...
 
NCollection_StlIteratoroperator-= (typename NCollection_StlIterator::difference_type theOffset)
 Move backward. More...
 
NCollection_StlIterator operator- (typename NCollection_StlIterator::difference_type theOffset) const
 Decrease. More...
 
NCollection_StlIterator::difference_type operator- (const NCollection_StlIterator &theOther) const
 Difference. More...
 
NCollection_StlIterator::reference operator[] (typename NCollection_StlIterator::difference_type theOffset) const
 Get item at offset from current. More...
 
bool operator< (const NCollection_StlIterator &theOther) const
 Comparison. More...
 
bool operator> (const NCollection_StlIterator &theOther) const
 Comparison. More...
 
bool operator<= (const NCollection_StlIterator &theOther) const
 Comparison. More...
 
bool operator>= (const NCollection_StlIterator &theOther) const
 Comparison. More...
 

methods related to forward STL iterator

bool operator== (const NCollection_StlIterator &theOther) const
 Test for equality. More...
 
bool operator!= (const NCollection_StlIterator &theOther) const
 Test for inequality. More...
 
NCollection_StlIterator::reference operator* () const
 Get reference to current item. More...
 
NCollection_StlIterator::pointer operator-> () const
 Dereferencing operator. More...
 
NCollection_StlIteratoroperator++ ()
 Prefix increment. More...
 
NCollection_StlIterator operator++ (int)
 Postfix increment. More...
 
template<bool Condition>
opencascade::std::enable_if<!Condition, ItemType & >::type Reference () const
 Test for equality. More...
 
template<bool Condition>
opencascade::std::enable_if< Condition, const ItemType & >::type Reference () const
 Test for equality. More...
 

Detailed Description

template<class Category, class BaseIterator, class ItemType, bool IsConstant>
class NCollection_StlIterator< Category, BaseIterator, 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_Vector as example of declaring custom STL iterators.

Constructor & Destructor Documentation

◆ NCollection_StlIterator() [1/3]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::NCollection_StlIterator ( )
inline

Default constructor.

◆ NCollection_StlIterator() [2/3]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::NCollection_StlIterator ( const BaseIterator &  theIterator)
inline

Constructor from NCollection iterator.

◆ NCollection_StlIterator() [3/3]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::NCollection_StlIterator ( const NCollection_StlIterator< Category, BaseIterator, ItemType, false > &  theIterator)
inline

Cast from non-const variant to const one.

Member Function Documentation

◆ ChangeIterator()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
BaseIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::ChangeIterator ( )
inline

Access to NCollection iterator instance.

◆ Iterator()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
const BaseIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::Iterator ( ) const
inline

Access to NCollection iterator instance.

◆ operator!=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator!= ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Test for inequality.

◆ operator*()

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

Get reference to current item.

◆ operator+()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator+ ( typename NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::difference_type  theOffset) const
inline

Addition.

◆ operator++() [1/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator++ ( )
inline

Prefix increment.

◆ operator++() [2/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator++ ( int  )
inline

Postfix increment.

◆ operator+=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator+= ( typename NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::difference_type  theOffset)
inline

Move forward.

◆ operator-() [1/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator::difference_type NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator- ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Difference.

◆ operator-() [2/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator- ( typename NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::difference_type  theOffset) const
inline

Decrease.

◆ operator--() [1/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator-- ( )
inline

Prefix decrement.

◆ operator--() [2/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator-- ( int  )
inline

Postfix decrement.

◆ operator-=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator-= ( typename NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::difference_type  theOffset)
inline

Move backward.

◆ operator->()

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

Dereferencing operator.

◆ operator<()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator< ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Comparison.

◆ operator<=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator<= ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Comparison.

◆ operator=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
NCollection_StlIterator& NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator= ( const NCollection_StlIterator< Category, BaseIterator, ItemType, false > &  theIterator)
inline

Assignment of non-const iterator to const one.

◆ operator==()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator== ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Test for equality.

◆ operator>()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator> ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Comparison.

◆ operator>=()

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
bool NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::operator>= ( const NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant > &  theOther) const
inline

Comparison.

◆ operator[]()

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

Get item at offset from current.

◆ Reference() [1/2]

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

Test for equality.

◆ Reference() [2/2]

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
template<bool Condition>
opencascade::std::enable_if<Condition, const ItemType&>::type NCollection_StlIterator< Category, BaseIterator, ItemType, IsConstant >::Reference ( ) const
inlineprotected

Test for equality.


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