diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-17 19:38:26 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-17 19:38:26 +0100 |
commit | d22eea2fd6130b431bc11694410775b993c5ab7a (patch) | |
tree | bfa00edd5135dcbee8bffe7d9ddd25c6cc0697a6 /lib/dbRecordSet.h | |
parent | Change m4 quoting for genstmt (diff) | |
download | mygrate-d22eea2fd6130b431bc11694410775b993c5ab7a.tar.bz2 mygrate-d22eea2fd6130b431bc11694410775b993c5ab7a.tar.xz mygrate-d22eea2fd6130b431bc11694410775b993c5ab7a.zip |
Make RecordSet foreach ready
Diffstat (limited to 'lib/dbRecordSet.h')
-rw-r--r-- | lib/dbRecordSet.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/dbRecordSet.h b/lib/dbRecordSet.h index e430e58..a9da882 100644 --- a/lib/dbRecordSet.h +++ b/lib/dbRecordSet.h @@ -25,6 +25,11 @@ namespace MyGrate { return std::make_unique<S>((*this)[I + O]...); } + bool operator==(const RowView &) const; + RowView & operator++(); + const RowView & operator*() const; + std::size_t currentRow() const; + private: const RecordSet * recordSet; std::size_t row; @@ -39,6 +44,9 @@ namespace MyGrate { virtual DbValue at(std::size_t, std::size_t) const = 0; RowView operator[](std::size_t row) const; DbValue operator*() const; + + RowView begin() const; + RowView end() const; }; using RecordSetPtr = std::unique_ptr<RecordSet>; } |