MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / BaseIterator

Class BaseIterator

src/common/classes/GenericMap.h:60–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58private:
59 template <typename TGenericMap, typename TAccessor, typename TKeyValuePair>
60 class BaseIterator
61 {
62 public:
63 BaseIterator(TGenericMap* map, bool initFinished = false)
64 : accessor(map),
65 finished(initFinished)
66 {
67 if (!initFinished)
68 finished = !accessor.getFirst();
69 }
70
71 public:
72 bool operator !=(const BaseIterator& o)
73 {
74 return !(
75 (finished && o.finished) ||
76 ((!finished && !o.finished && accessor.current() == o.accessor.current())));
77 }
78
79 void operator ++()
80 {
81 fb_assert(!finished);
82 finished = !accessor.getNext();
83 }
84
85 TKeyValuePair& operator *()
86 {
87 fb_assert(!finished);
88 return *accessor.current();
89 }
90
91 private:
92 TAccessor accessor;
93 bool finished;
94 };
95
96public:
97 typedef typename KeyValuePair::first_type KeyType;

Callers

nothing calls this directly

Calls 1

currentMethod · 0.45

Tested by

no test coverage detected