biterable.hpp
Go to the documentation of this file.
1
2// nested class of bicontainable.hpp
3class iterable {
4 BY_ME(iterable)
5
6protected:
7 enum iterationType {
8 NEXT,
9 PREV,
10 FORWARD,
11 BACKWARD
12 };
13
14public:
15 virtual ~iterable() {}
16
17 virtual nbool isEnd() const = 0;
18
19 virtual nbool isReversed() const = 0;
20
21 virtual void rel() = 0;
22
29 virtual ncnt next(ncnt step) { return isReversed() ? stepBackward(step) : stepForward(step); }
30
31 virtual ncnt prev(ncnt step) { return isReversed() ? stepForward(step) : stepBackward(step); }
32
33 virtual ncnt stepForward(ncnt step) = 0;
34 virtual ncnt stepBackward(ncnt step) = 0;
35
36 virtual const K* getKey() const = 0;
37
38 virtual V* getVal() = 0;
39 const V* getVal() const BY_CONST_FUNC(getVal())
40
41 virtual void setVal(const V& newVal) = 0;
42 void setVal(const V* it) BY_SIDE_FUNC(setVal);
43
44 virtual nbool isFrom(const tbicontainable& it) const = 0;
45 nbool isFrom(const tbicontainable* it) const BY_SIDE_FUNC(isFrom);
46
47 virtual tbicontainable<K, V>* getContainer() = 0;
48 const tbicontainable<K, V>* getContainer() const BY_CONST_FUNC(getContainer())
49};
Definition: biterable.hpp:3
virtual ncnt next(ncnt step)
Definition: biterable.hpp:29