27 #ifndef SMDS_SetIterator_HeaderFile 28 #define SMDS_SetIterator_HeaderFile 38 template<
typename VALUE,
typename VALUE_SET_ITERATOR>
40 static VALUE
value(VALUE_SET_ITERATOR it) {
return (VALUE) *it; }
43 template<
typename VALUE,
typename VALUE_SET_ITERATOR>
45 static VALUE
value(VALUE_SET_ITERATOR it) {
return (VALUE) it->first; }
48 template<
typename VALUE,
typename VALUE_SET_ITERATOR>
50 static VALUE
value(VALUE_SET_ITERATOR it) {
return (VALUE) it->second; }
61 template<
typename VALUE,
62 typename VALUE_SET_ITERATOR,
67 VALUE_SET_ITERATOR _beg,
_end;
70 const VALUE_SET_ITERATOR & end)
71 { init ( begin, end ); }
74 virtual void init(
const VALUE_SET_ITERATOR & begin,
75 const VALUE_SET_ITERATOR & end)
76 { _beg = begin; _end = end; }
79 virtual bool more() {
return _beg != _end; }
82 virtual VALUE
next() {
return ACCESOR::value( _beg++ ); }
95 SMDS::ValueAccessor<typename M::mapped_type,
96 typename M::const_iterator> > {
97 typedef SMDS_SetIterator<
typename M::mapped_type,
typename M::const_iterator,
107 typename M::const_reverse_iterator,
108 SMDS::ValueAccessor<typename M::mapped_type,
109 typename M::const_reverse_iterator> > {
110 typedef SMDS_SetIterator<
typename M::mapped_type,
typename M::const_reverse_iterator,
120 SMDS::KeyAccessor<typename M::key_type,
121 typename M::const_iterator> > {
132 SMDS::KeyAccessor<typename M::key_type,
133 typename M::const_iterator> > {
SMDS_mapKeyIterator(const M &m)
SMDS_Iterator iterating over abstract set of values like STL containers.
SMDS_SetIterator< SMDS_pElement, std::vector< SMDS_pElement >::const_iterator > SMDS_ElementVectorIterator
SMDS_SetIterator< SMDS_pNode, std::vector< SMDS_pNode >::const_iterator > SMDS_NodeVectorIterator
iterator on keys of a map
static VALUE value(VALUE_SET_ITERATOR it)
SMDS_mapKeyReverseIterator(const M &m)
virtual VALUE next()
Return the current object and step to the next one.
virtual void init(const VALUE_SET_ITERATOR &begin, const VALUE_SET_ITERATOR &end)
Initialization.
SMDS_SetIterator(const VALUE_SET_ITERATOR &begin, const VALUE_SET_ITERATOR &end)
SMDS_SetIterator< SMDS_pElement, SMDS_pElement const * > SMDS_ElementArrayIterator
SMDS_SetIterator< typename M::mapped_type, typename M::const_reverse_iterator, SMDS::ValueAccessor< typename M::mapped_type, typename M::const_reverse_iterator > > parent_type
SMDS_SetIterator< typename M::key_type, typename M::const_iterator, SMDS::KeyAccessor< typename M::key_type, typename M::const_iterator > > parent_type
SMDS_SetIterator< SMDS_pNode, SMDS_pNode const *> SMDS_NodeArrayIterator
const SMDS_MeshNode * SMDS_pNode
virtual bool more()
Return true if and only if there are other object in this iterator.
reverse iterator on values of a map
const SMDS_MeshElement * SMDS_pElement
static VALUE value(VALUE_SET_ITERATOR it)
SMDS_SetIterator< typename M::key_type, typename M::const_iterator, SMDS::KeyAccessor< typename M::key_type, typename M::const_iterator > > parent_type
Abstract class for iterators.
SMDS_mapReverseIterator(const M &m)
SMDS_mapIterator(const M &m)
SMDS_SetIterator< SMDS_pElement, SMDS_pNode const *> SMDS_NodeArrayElemIterator
static VALUE value(VALUE_SET_ITERATOR it)
Accessors to value pointed by iterator.
SMDS_SetIterator< SMDS_pElement, std::vector< SMDS_pNode >::const_iterator > SMDS_NodeVectorElemIterator
SMDS_SetIterator< typename M::mapped_type, typename M::const_iterator, SMDS::ValueAccessor< typename M::mapped_type, typename M::const_iterator > > parent_type
reverse iterator on keys of a map