Back to index

salome-smesh  6.5.0
Public Member Functions | Protected Attributes
MySetIterator< ELEM, TSET > Class Template Reference

template class used for iteration on submesh elements. More...

Inheritance diagram for MySetIterator< ELEM, TSET >:
Inheritance graph
[legend]
Collaboration diagram for MySetIterator< ELEM, TSET >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MySetIterator (const TSET &table)
virtual bool more ()
 Return true if and only if there are other object in this iterator.
virtual ELEM 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

TSET::const_iterator _it
TSET::const_iterator _end
TSET _table

Detailed Description

template<class ELEM, typename TSET>
class MySetIterator< ELEM, TSET >

template class used for iteration on submesh elements.

Interface of iterator remains unchanged after redesign of SMDS to avoid modification everywhere in SMESH. instances are stored in shared_ptr for automatic destruction. Container is copied for iteration, because original can be modified by addition of elements, for instance, and then reallocated (vector)

Definition at line 255 of file SMESHDS_SubMesh.cxx.


Constructor & Destructor Documentation

template<class ELEM , typename TSET >
MySetIterator< ELEM, TSET >::MySetIterator ( const TSET &  table) [inline]

Definition at line 261 of file SMESHDS_SubMesh.cxx.

  {
    _table = table;
    _it = _table.begin();
    _end = _table.end();
    while ((_it != _end) && (*_it == 0))
      _it++;
  }

Member Function Documentation

template<class ELEM , typename TSET >
virtual bool MySetIterator< ELEM, TSET >::more ( ) [inline, virtual]

Return true if and only if there are other object in this iterator.

Implements SMDS_Iterator< ELEM >.

Definition at line 270 of file SMESHDS_SubMesh.cxx.

  {
    while ((_it != _end) && (*_it == 0))
      _it++;
    return (_it != _end);
  }
template<class ELEM , typename TSET >
virtual ELEM MySetIterator< ELEM, TSET >::next ( ) [inline, virtual]

Return the current object and step to the next one.

Implements SMDS_Iterator< ELEM >.

Definition at line 277 of file SMESHDS_SubMesh.cxx.

  {
    ELEM e = *_it;
    _it++;
    return e;
  }
virtual void SMDS_Iterator< ELEM >::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<class ELEM , typename TSET >
TSET::const_iterator MySetIterator< ELEM, TSET >::_end [protected]

Definition at line 258 of file SMESHDS_SubMesh.cxx.

template<class ELEM , typename TSET >
TSET::const_iterator MySetIterator< ELEM, TSET >::_it [protected]

Definition at line 258 of file SMESHDS_SubMesh.cxx.

template<class ELEM , typename TSET >
TSET MySetIterator< ELEM, TSET >::_table [protected]

Definition at line 259 of file SMESHDS_SubMesh.cxx.


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