EpcTools
An event based multi-threaded C++ development framework.
|
Go to the documentation of this file.
24 #include <pistache/endpoint.h>
25 #include <pistache/http_header.h>
26 #include <pistache/router.h>
28 #define RAPIDJSON_NAMESPACE epctoolsrapidjson
30 #include "rapidjson/rapidjson.h"
31 #include "rapidjson/document.h"
50 void parse(
const std::string &data)
57 void write(std::ostream &os)
const
106 virtual Void
process(
const Pistache::Http::Request& request, Pistache::Http::ResponseWriter &response) = 0;
111 Void
handler(
const Pistache::Http::Request& request, Pistache::Http::ResponseWriter response);
151 Void init(
size_t thrds);
153 std::shared_ptr<Pistache::Http::Endpoint> m_endpoint;
154 Pistache::Rest::Router m_router;
156 static Bool m_username_header_registered;
159 #endif // #ifndef __EMGMT_H
Implemts the HTTP server endpoint.
Definition: emgmt.h:130
Void handler(const Pistache::Http::Request &request, Pistache::Http::ResponseWriter response)
HTTP handler that will be called by the Pistache framework.
Definition: emgmt.cpp:34
const EString & path()
Returns the route path for this HTTP handler.
Definition: emgmt.h:114
Defines the logging related classes.
Void start()
Starts the endpoint.
Definition: emgmt.cpp:86
HttpMethod httpMethod()
Returns the HTTP method for this HTTP handler.
Definition: emgmt.h:116
Provides class for manipulating time of day values.
Defines a logger.
Definition: elogger.h:78
Pistache::Rest::Route::Handler getHandler()
Definition: emgmt.cpp:63
Void registerHandler(EManagementHandler &hndlr)
Registers a REST handler.
Definition: emgmt.cpp:103
virtual Void process(const Pistache::Http::Request &request, Pistache::Http::ResponseWriter &response)=0
Pure virtual method that will be called by handler() to perform the processing.
HttpMethod
Represents the type of the handler.
Definition: emgmt.h:76
Pure virtual base class for an administrative management interface handler.
Definition: emgmt.h:70
String class.
Definition: estring.h:30
Void shutdown()
Stops and shuts down the endpoint.
Definition: emgmt.cpp:98
Encapsulates and extends a std::string object.
EManagementEndpoint(uint16_t port, size_t thrds=1)
Class constructor.
Definition: emgmt.cpp:73