From 070ce923574dcc57435cb3fb2dfe86b6a38cd249 Mon Sep 17 00:00:00 2001 From: MDBijman Date: Tue, 24 Jan 2017 12:15:26 +0100 Subject: Initial code commit with organized dependencies --- Simulator/include/database/QueryResult.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Simulator/include/database/QueryResult.h (limited to 'Simulator/include/database/QueryResult.h') diff --git a/Simulator/include/database/QueryResult.h b/Simulator/include/database/QueryResult.h new file mode 100644 index 00000000..c1534be3 --- /dev/null +++ b/Simulator/include/database/QueryResult.h @@ -0,0 +1,25 @@ +#pragma once +#include + +namespace Database +{ + template + class QueryResult + { + public: + explicit QueryResult(ReturnTypes... returnValues) : values(returnValues...) {} + explicit QueryResult(std::tuple returnValues) : values(returnValues) {} + + /* + Returns the item at the given index. + ReturnType must be the same as the type of the item at position Index in the tuple. + */ + template + ReturnType get() + { + return std::get(values); + } + + std::tuple values; + }; +} -- cgit v1.2.3