aboutsummaryrefslogtreecommitdiff
path: root/umosapi.h
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-08-06 13:34:33 +0200
committerneodarz <neodarz@neodarz.net>2019-08-06 13:38:38 +0200
commit7bc35f9268522474753e37325ba12f1bf7134c5a (patch)
treeae8be51449e9370e221b2b2297f1023a805c2096 /umosapi.h
parent31281b7c470c80ede636620e29f598596a4b3e1f (diff)
downloadumosapicpp-7bc35f9268522474753e37325ba12f1bf7134c5a.tar.xz
umosapicpp-7bc35f9268522474753e37325ba12f1bf7134c5a.zip
Separate interface from implementation for UmosapiService
Diffstat (limited to 'umosapi.h')
-rw-r--r--umosapi.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/umosapi.h b/umosapi.h
new file mode 100644
index 0000000..fe30db5
--- /dev/null
+++ b/umosapi.h
@@ -0,0 +1,29 @@
+#define UmosapiService_H_
+
+#include <pistache/http.h>
+#include <pistache/description.h>
+#include <pistache/endpoint.h>
+
+using namespace Pistache;
+
+class UmosapiService {
+ public:
+
+ UmosapiService(Address addr);
+ virtual ~UmosapiService() {};
+
+ void init(size_t thr);
+
+ void start(std::string swaggerui);
+
+ private:
+ void createDescription();
+
+ void retrieveAll(const Rest::Request& request, Http::ResponseWriter response);
+
+ void addUObject(const Rest::Request& request, Http::ResponseWriter response);
+
+ std::shared_ptr<Http::Endpoint> httpEndpoint;
+ Rest::Description desc;
+ Rest::Router router;
+};