summaryrefslogtreecommitdiff
path: root/libdbpp/selectcommand.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-10-05 19:46:21 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-10-05 19:46:21 +0100
commit1050f6f2cfab16d71a99c638d8358e4297321689 (patch)
treeb717be9f21aa044314ddde048568ec3624406f9c /libdbpp/selectcommand.h
parentAdd new projects to default build (diff)
downloadlibdbpp-1050f6f2cfab16d71a99c638d8358e4297321689.tar.bz2
libdbpp-1050f6f2cfab16d71a99c638d8358e4297321689.tar.xz
libdbpp-1050f6f2cfab16d71a99c638d8358e4297321689.zip
Add doxygen commentslibdbpp-0.9
Diffstat (limited to 'libdbpp/selectcommand.h')
-rw-r--r--libdbpp/selectcommand.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libdbpp/selectcommand.h b/libdbpp/selectcommand.h
index ff6f529..3887088 100644
--- a/libdbpp/selectcommand.h
+++ b/libdbpp/selectcommand.h
@@ -11,24 +11,37 @@
namespace DB {
class Column;
+ /// Represents a command expected to return data to the client.
class DLL_PUBLIC SelectCommand : public virtual Command {
public:
+ /// Creates a new command from the given SQL.
SelectCommand(const std::string & sql);
~SelectCommand();
+
+ /// Fetch the next row from the result set. Returns false when no further rows are availabile.
virtual bool fetch() = 0;
+ /// Execute the statement, but don't fetch the first row.
virtual void execute() = 0;
+ /// Get a column reference by index.
const Column & operator[](unsigned int col) const;
+ /// Get a column reference by name.
const Column & operator[](const Glib::ustring &) const;
+ /// Get the number of columns in the result set.
unsigned int columnCount() const;
+ /// Get the index of a column by name.
unsigned int getOrdinal(const Glib::ustring &) const;
+
+ protected:
+ /// Helper function so clients need not know about boost::multi_index_container.
ColumnPtr insertColumn(ColumnPtr);
+ /// Friendly typedef cos boost::multi_index_container definitions are massive.
typedef boost::multi_index_container<ColumnPtr, boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<boost::multi_index::member<DB::Column, const unsigned int, &DB::Column::colNo>>,
boost::multi_index::ordered_unique<boost::multi_index::member<DB::Column, const Glib::ustring, &DB::Column::name>>
>> Columns;
- protected:
+ /// Columns in the result set.
Columns * columns;
};
}