diff options
author | neodarz <neodarz@neodarz.net> | 2019-08-06 13:34:33 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-08-06 13:38:38 +0200 |
commit | 7bc35f9268522474753e37325ba12f1bf7134c5a (patch) | |
tree | ae8be51449e9370e221b2b2297f1023a805c2096 /umosapi.h | |
parent | 31281b7c470c80ede636620e29f598596a4b3e1f (diff) | |
download | umosapicpp-7bc35f9268522474753e37325ba12f1bf7134c5a.tar.xz umosapicpp-7bc35f9268522474753e37325ba12f1bf7134c5a.zip |
Separate interface from implementation for UmosapiService
Diffstat (limited to 'umosapi.h')
-rw-r--r-- | umosapi.h | 29 |
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; +}; |