Go to the documentation of this file.
6 #ifndef scannerConnectors_hh
7 #define scannerConnectors_hh
17 #define JoinerConstr_D 0
18 #define JoinerDestr_D 0
34 operator int() {
return !
eos(); }
37 virtual bool eos()
const = 0;
46 template<
class T,
unsigned nlnk>
49 template<
class T,
unsigned nlnk>
72 template<
class T,
unsigned nlnk>
74 friend std::ostream& operator<< <>(std::ostream& os,
124 template <
class T,
unsigned nlnk>
128 for(uint i = 0; i < nlnk - 1; ++i)
130 lnk_[nlnk - 1] = lnk;
134 template <
class T,
unsigned nlnk>
138 if (j) {destructor_(j); j = 0;}
144 if (values)
delete foo->
val_;
151 template <
class T,
unsigned nlnk>
153 for(uint i = 0; i < nlnk; i++) {
154 if (j->
lnk_[i]) destructor_(j->
lnk_[i]);
156 if (values)
delete j->
val_;
160 template<
class T,
unsigned nlnk>
162 os <<
"J(" << j.
val_ <<
" -> [" << std::flush;
163 for(uint i = 0; i < nlnk-1; ++i)
165 os << *j.
lnk_[i] <<
", " << std::flush;
167 os << *j.
lnk_[nlnk-1] << std::flush;
168 return os <<
"])" << std::flush;
204 tmp = current_->value();
205 current_ = (*current_)[0];
206 if ((eos_ = current_ == 0)) current_ = head_;
242 T& tmp = current_->value();
245 current_ = (*current_)[0];
246 if ((eos_ = current_ == 0)) current_ = head_;
260 :
i_(v.begin()),
last_(v.end()) {}
262 typename std::vector<T*>::const_iterator last)
270 typename std::vector<T*>::iterator
i_;
271 typename std::vector<T*>::const_iterator
last_;
280 template <class T, class ItType = typename std::vector<T*>::const_iterator >
379 #endif // scannerConnectors_hh
uint size() const
Returns the requested size of the array.
T & operator++(int)
Returns the next element in the scanned set.
A scanner over a single element.
Scanner working on std::vector elements.
std::vector< T * > Vector
bool eos_
Is true if the end of the list is reached.
virtual bool eos() const =0
Returns true if the end of the scanned set is reached.
bool eos() const
Returns true if the end of the scanned set is reached.
Joiner< T *, 1 > * head_
Pointer to the head of the list.
ListScan(Joiner< T, 1 > &cnr)
Constructor.
bool eos() const
Returns true if the end of the scanned set is reached.
PStlVectorScan< T > * clone() const
Returns a clone of the scanner.
Joiner class with multiple successors, i.e.
T & operator++()
pre-increment operator
StlVectorScan * clone() const
Returns a clone of the scanner.
bool eos() const
Returns true if the end of the scanned set is reached.
ArrayScan(Array< T > &container)
#define conceptsAssert(cond, exc)
Assert that a certain condition is fulfilled.
Joiner *& operator[](uint i)
Index operator for the container.
virtual T & operator++(int)=0
Returns the next element in the scanned set.
Scanner for a STL container std::vector of pointers.
std::vector< T * >::iterator i_
SingletonScan(T &singleton)
bool eos() const
Returns true if the end of the scanned set is reached.
#define DEBUGL(doit, msg)
Joiner(const Joiner &)
Copy constructor.
T & operator++(int)
Returns the next element in the scanned set.
T & operator++(int)
Returns the next element in the scanned set.
std::vector< T * >::const_iterator last_
Joiner(const T &val, Joiner *lnk=0)
Constructor.
Joiner< T, 1 > * head_
Pointer to the head of the list.
Exception class for assertions.
PStlVectorScan(typename std::vector< T * >::iterator first, typename std::vector< T * >::const_iterator last)
bool eos() const
Returns true if the end of the scanned set is reached.
PStlVectorScan(typename std::vector< T * > &v)
T & operator++(int)
post-increment operator
~Joiner()
Empty destructor.
std::ostream & operator<<(std::ostream &os, const Level< dim > &c)
virtual Scan * clone() const =0
Returns a clone of the scanner.
An abstract class for scanning a mesh (a set of cells) or a space (a set of elements).
Joiner< T, nlnk > * lnk_[nlnk]
Array of the successors.
T val_
The content of the container.
PListScan< T > * clone() const
Returns a clone of the scanner.
StlVectorScan(Vector &vec)
Constructor.
PStlVectorScan(const PStlVectorScan< T > &scan)
Joiner< T, 1 > * current_
Pointer to the current element.
Joiner< T *, 1 > * current_
Pointer to the current element.
T & operator++(int)
Returns the next element in the scanned set.
PListScan(Joiner< T *, 1 > &cnr)
Constructor.
T & value()
Returns the content of the container.
SingletonScan(const SingletonScan &other)
static void destructor(Joiner< T, nlnk > *&j, bool values=true)
Static function to delete the list/tree.
bool eos() const
Returns true if the end of the scanned set is reached.
SingletonScan * clone() const
Returns a clone of the scanner.
static void destructor_(Joiner< T, nlnk > *j, bool values=true)
Recursive destructor.
void operator=(const Joiner &)
StlVectorScan(const Vector &vec, ItType it)
Constructor.
bool eos_
Is true if the end of the list is reached.
T & operator++(int)
Returns the next element in the scanned set.
Scan< T > * clone() const
Returns a clone of the scanner.
ArrayScan(const ArrayScan &scan)
Basic namespace for Concepts-2.
Scanner for a list of pointers.
ListScan< T > * clone() const
Returns a clone of the scanner.