summaryrefslogtreecommitdiff
path: root/server/src/queryhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/queryhandler.h')
-rw-r--r--server/src/queryhandler.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/server/src/queryhandler.h b/server/src/queryhandler.h
index 2de62ae..14e97c2 100644
--- a/server/src/queryhandler.h
+++ b/server/src/queryhandler.h
@@ -27,20 +27,41 @@
#ifndef __PRACRO_QUERYHANDLER_H__
#define __PRACRO_QUERYHANDLER_H__
-class Query {};
+#include "tcpsocket.h"
+
+#include <vector>
+#include <string>
+
+/**
+ * Query specific values. This is the in-memory representation of a query transaction.
+ */
+class Query {
+public:
+ Query(std::string id, std::string type) :
+ device_id(id), device_type(type) {}
+ std::string device_id;
+ std::string device_type;
+};
+
/**
* This class handles the query of external data.
*/
class QueryHandler {
public:
- QueryHandler();
+ QueryHandler(TCPSocket *socket, std::string cpr);
// Add a query to the query queue
- void addQuery(Query &query) {}
+ void addQuery(Query &query);
+
+ // Execute all queries.
+ std::string exec();
+
+private:
+ TCPSocket *socket;
+ std::string cpr;
- // Execute all queries in parallel, for speed improv.
- void exec() {}
+ std::vector< Query > queries;
};
#endif/*__PRACRO_QUERYHANDLER_H__*/