CompleteDB Embedded: Direct C++ API  2.4.2
Iterator.hpp
Go to the documentation of this file.
1 #ifndef COMPLETEDB_ITERATOR_HPP
2 #define COMPLETEDB_ITERATOR_HPP
3 
4 #include "CompleteDb.h"
6 #include "completedb/Object.hpp"
7 
8 namespace completedb {
9 
15 class Iterator
16 : public virtual Object
17 {
18 
19 public: // override Object iface
20 
24  virtual bool cast(const Object& from) { return completedb_Iterator_cast(&m, from.get(), from.getClassType()); }
28  virtual bool isConnected() const { return completedb_Iterator_isConnected(m); }
32  virtual bool isDisconnected() const { return completedb_Iterator_isDisconnected(m); }
41 
42 public: // iface
43 
47  virtual bool next() { return completedb_Iterator_next(m); }
51  virtual void reset() { completedb_Iterator_reset(m); }
52 
53 public: // factory lvalue
54 
55  Iterator& operator=(const Iterator& src) { completedb_Iterator_assign(&m, src.m, src.getClassType()); return *this; }
57 
58 public: // factory
59 
62 
63 private: // factory
64 
65  Iterator(void* src) : Object(src) {}
66 
67 };
68 
69 } // namespace
70 
71 #endif /* COMPLETEDB_ITERATOR_HPP */