summaryrefslogtreecommitdiff
path: root/libdbpp/selectcommand.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-11-07 23:56:14 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-11-07 23:56:14 +0000
commit45c23ec13e3a7322cb446207e6994ae0d932bb94 (patch)
tree3eb29c0fe803d67dcfac8e830b8fe0e07dbed6bf /libdbpp/selectcommand.h
parentAdd typedefs for commands and connection smart pointers (diff)
downloadlibdbpp-45c23ec13e3a7322cb446207e6994ae0d932bb94.tar.bz2
libdbpp-45c23ec13e3a7322cb446207e6994ae0d932bb94.tar.xz
libdbpp-45c23ec13e3a7322cb446207e6994ae0d932bb94.zip
Add utility function for passing each row of a result set to a function accepting one parameter per column
Diffstat (limited to 'libdbpp/selectcommand.h')
-rw-r--r--libdbpp/selectcommand.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h
index 31ef9ca..1586357 100644
--- a/libdbpp/selectcommand.h
+++ b/libdbpp/selectcommand.h
@@ -7,6 +7,7 @@
#include <boost/multi_index/indexed_by.hpp>
#include <boost/multi_index/ordered_index_fwd.hpp>
#include <boost/multi_index/member.hpp>
+#include <boost/function/function_fwd.hpp>
#include <boost/shared_ptr.hpp>
#include <visibility.h>
@@ -31,6 +32,9 @@ namespace DB {
unsigned int columnCount() const;
/// Get the index of a column by name.
unsigned int getOrdinal(const Glib::ustring &) const;
+ /// Push each row through a function accepting one value per column
+ template<typename ... Fn, typename Func = boost::function<void(Fn...)>>
+ void forEachRow(const Func & func);
protected:
/// Helper function so clients need not know about boost::multi_index_container.