Back to index

salome-smesh  6.5.0
Public Member Functions | Protected Attributes
SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS > Class Template Reference

SMDS_Iterator iterating over all elements provided by other iterators. More...

#include <SMDS_IteratorOnIterators.hxx>

Inheritance diagram for SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >:
Inheritance graph
[legend]
Collaboration diagram for SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SMDS_IteratorOnIterators (const CONTAINER_OF_ITERATORS &iterators)
virtual bool more ()
 Return true iff there are other object in this iterator.
virtual VALUE next ()
 Return the current object and step to the next one.
virtual void remove ()
 Delete the current element and step to the next one.

Protected Attributes

CONTAINER_OF_ITERATORS _iterators
CONTAINER_OF_ITERATORS::iterator _beg
CONTAINER_OF_ITERATORS::iterator _end

Detailed Description

template<typename VALUE, typename CONTAINER_OF_ITERATORS>
class SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >

SMDS_Iterator iterating over all elements provided by other iterators.

Other iterators must implement SMDS_Iterator iterface and must be provided within a stl-like container BE CAREFUL: iterator pointed value is static_cast'ed to VALUE ////////////////////////////////////////////////////////////////////////////

Definition at line 42 of file SMDS_IteratorOnIterators.hxx.


Constructor & Destructor Documentation

template<typename VALUE , typename CONTAINER_OF_ITERATORS >
SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::SMDS_IteratorOnIterators ( const CONTAINER_OF_ITERATORS &  iterators) [inline]

Definition at line 48 of file SMDS_IteratorOnIterators.hxx.

                                                                   :
    _iterators( iterators ), _beg( _iterators.begin()), _end(_iterators.end() )
  {
    while ( _beg != _end && !(*_beg)->more()) ++_beg;
  }

Member Function Documentation

template<typename VALUE , typename CONTAINER_OF_ITERATORS >
virtual bool SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::more ( ) [inline, virtual]

Return true iff there are other object in this iterator.

Implements SMDS_Iterator< VALUE >.

Definition at line 55 of file SMDS_IteratorOnIterators.hxx.

{ return _beg != _end && (*_beg)->more(); }
template<typename VALUE , typename CONTAINER_OF_ITERATORS >
virtual VALUE SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::next ( ) [inline, virtual]

Return the current object and step to the next one.

Implements SMDS_Iterator< VALUE >.

Definition at line 58 of file SMDS_IteratorOnIterators.hxx.

  {
    VALUE __v = (VALUE)(*_beg)->next();
    while ( _beg != _end && !(*_beg)->more())
      ++_beg;
    return __v;
  }
template<typename VALUE>
virtual void SMDS_Iterator< VALUE >::remove ( ) [inline, virtual, inherited]

Delete the current element and step to the next one.

Definition at line 44 of file SMDS_Iterator.hxx.

{}

Member Data Documentation

template<typename VALUE , typename CONTAINER_OF_ITERATORS >
CONTAINER_OF_ITERATORS::iterator SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::_beg [protected]

Definition at line 46 of file SMDS_IteratorOnIterators.hxx.

template<typename VALUE , typename CONTAINER_OF_ITERATORS >
CONTAINER_OF_ITERATORS::iterator SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::_end [protected]

Definition at line 46 of file SMDS_IteratorOnIterators.hxx.

template<typename VALUE , typename CONTAINER_OF_ITERATORS >
CONTAINER_OF_ITERATORS SMDS_IteratorOnIterators< VALUE, CONTAINER_OF_ITERATORS >::_iterators [protected]

Definition at line 45 of file SMDS_IteratorOnIterators.hxx.


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