21 #ifndef bempp_concrete_range_entity_iterator_hpp
22 #define bempp_concrete_range_entity_iterator_hpp
24 #include "../common/common.hpp"
26 #include "entity_iterator.hpp"
27 #include "concrete_entity_decl.hpp"
42 template<
typename DuneEntityIt,
typename DuneEntityPo
inter>
44 DuneEntityIt::codimension>
47 DuneEntityIt m_begin, m_end, m_cur;
49 typename DuneEntityIt::Entity> m_entity;
54 m_entity.setDuneEntity(&*m_cur);
57 void updateFinished() {
58 this->m_finished = (m_cur == m_end);
64 const DuneEntityIt& end,
66 m_begin(begin), m_end(end), m_cur(begin), m_entity(domain_index),
67 m_domain_index(domain_index) {
82 virtual std::auto_ptr<EntityPointer<ConcreteRangeEntityIterator::codimension> >
frozen()
const {
83 const int codim = ConcreteRangeEntityIterator::codimension;
84 return std::auto_ptr<EntityPointer<codim> >(
86 *m_cur, m_domain_index));
ConcreteRangeEntityIterator(const DuneEntityIt &begin, const DuneEntityIt &end, const DomainIndex &domain_index)
Constructor. The iterator will go over the range [begin, end).
Definition: concrete_range_entity_iterator.hpp:63
virtual std::auto_ptr< EntityPointer< ConcreteRangeEntityIterator::codimension > > frozen() const
A stable pointer to the entity currently referenced by the iterator.
Definition: concrete_range_entity_iterator.hpp:82
Wrapper of a Dune entity pointer of type DuneEntityPointer.
Definition: concrete_entity_pointer.hpp:37
Abstract wrapper of an entity of codimension codim.
Definition: entity.hpp:46
Iterator over entities referenced by a range of Dune iterators of type DuneEntityIt.
Definition: concrete_range_entity_iterator.hpp:43
Wrapper of a Dune entity of type DuneEntity and codimension codim.
Definition: concrete_entity_decl.hpp:46
virtual void next()
Increment iterator.
Definition: concrete_range_entity_iterator.hpp:72
Definition: domain_index.hpp:32
virtual const Entity< ConcreteRangeEntityIterator::codimension > & entity() const
Read-only access to the entity referenced by the iterator.
Definition: concrete_range_entity_iterator.hpp:78
bool finished() const
True if iterator points past the end of the iteration range.
Definition: entity_iterator.hpp:68
Abstract base class for iterators over entities.
Definition: entity_iterator.hpp:59