|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_DATA_RANGE_H_
22 #define ELM_DATA_RANGE_H_
31 typedef typename I::t
t;
39 inline Iter(
const Range& collection): c(collection), i(c._begin) { }
40 inline Iter(
const Range& collection,
const I& ii): c(collection), i(ii) { }
41 inline bool ended(
void)
const {
return i.equals(c._end); }
42 inline typename I::return_t
item(
void)
const {
return i.item(); }
43 inline void next(
void) { i.next(); }
44 inline bool equals(
const Iter& ii)
const {
return i.equals(ii.i); }
53 inline bool isEmpty(
void)
const {
return _begin.equals(_end); }
55 {
int c = 0;
for(
Iter i(*
this); i(); i++) c++;
return c; }
60 {
for(
typename C::Iter i(c); i; i++)
if(!
contains(*i))
return false;
return true; }
I::t t
Definition: Range.h:31
bool isEmpty(void) const
Definition: Range.h:53
int count(void) const
Definition: Range.h:54
void next(void)
Definition: Range.h:43
Iter(const Range &collection, const I &ii)
Definition: Range.h:40
Iter begin() const
Definition: Range.h:50
Range< I > range(const I &begin, const I &end)
Definition: Range.h:67
Range collec_t
Definition: Range.h:38
bool containsAll(const C &c)
Definition: Range.h:59
bool equals(const Iter &ii) const
Definition: Range.h:44
I::return_t item(void) const
Definition: Range.h:42
bool contains(const t &v)
Definition: Range.h:57
Range(const I &begin, const I &end)
Definition: Range.h:33
bool ended(void) const
Definition: Range.h:41
Iter(const Range &collection)
Definition: Range.h:39
Iter end() const
Definition: Range.h:51