summaryrefslogtreecommitdiff
path: root/lib/dbRecordSet.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-06-17 19:38:26 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-06-17 19:38:26 +0100
commitd22eea2fd6130b431bc11694410775b993c5ab7a (patch)
treebfa00edd5135dcbee8bffe7d9ddd25c6cc0697a6 /lib/dbRecordSet.h
parentChange m4 quoting for genstmt (diff)
downloadmygrate-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.h8
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>;
}