Version: 6.3.1
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]

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 250 of file SMESHDS_SubMesh.cxx.


Constructor & Destructor Documentation

template<class ELEM , typename TSET >
MySetIterator< ELEM, TSET >.MySetIterator ( const TSET &  table)

Definition at line 256 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 ( ) [virtual]

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

Implements SMDS_Iterator< ELEM >.

Definition at line 265 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 ( ) [virtual]

Return the current object and step to the next one.

Implements SMDS_Iterator< ELEM >.

Definition at line 272 of file SMESHDS_SubMesh.cxx.

  {
    ELEM e = *_it;
    _it++;
    return e;
  }
virtual void SMDS_Iterator< ELEM >.remove ( ) [virtual, inherited]

Delete the current element and step to the next one.

Definition at line 44 of file SMDS_Iterator.hxx.

{}

Field Documentation

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

Definition at line 253 of file SMESHDS_SubMesh.cxx.

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

Definition at line 253 of file SMESHDS_SubMesh.cxx.

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

Definition at line 254 of file SMESHDS_SubMesh.cxx.

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS