Open CASCADE Technology  7.1.0.beta
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...
 
methods related to bidirectional STL iterator
NCollection_StlIteratoroperator-- ()
 Prefix decrement. More...
 
NCollection_StlIterator operator-- (int)
 Postfix decrement. 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::enable_if<!Condition, ItemType & >::type Reference () const
 Test for equality. More...
 
template<bool Condition>
opencascade::enable_if< Condition, const ItemType & >::type Reference () const
 Test for equality. 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...
 

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

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

Default constructor.

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.

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

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.

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.

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.

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.

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

Prefix increment.

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

Postfix increment.

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.

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.

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.

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

Prefix decrement.

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

Postfix decrement.

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.

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

Dereferencing 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.

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.

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.

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.

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.

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.

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.

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

Test for equality.

template<class Category , class BaseIterator , class ItemType , bool IsConstant>
template<bool Condition>
opencascade::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: