-
Notifications
You must be signed in to change notification settings - Fork 2
/
TheServer.h
43 lines (35 loc) · 1.14 KB
/
TheServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
class TheServer
{
public:
TheServer(std::wstring url);
virtual ~TheServer();
void Init();
void Close();
static void RequestVerbPing(http_request message);
static void RequestVerbGetData(http_request message);
static void RequestVerbSetData(http_request message);
static void RequestVerbGetData64(http_request message);
static void RequestVerbSetData64(http_request message);
static void RequestUsage(http_request message);
public:
pplx::task<void> open() { return m_listener.open(); }
pplx::task<void> close() { return m_listener.close(); }
private:
static void PrintRequest(http_request request);
static void handle_get(http_request message);
static void handle_post(http_request message);
static void handle_del(http_request message);
static void handle_put(http_request message);
static std::shared_ptr<CLMDBWrapperEx> GetLMDBWrapper(std::wstring dbName);
private:
http_listener m_listener;
public:
static std::wstring _server;
static std::wstring _port;
static std::wstring _name;
public:
static std::map<std::wstring, std::shared_ptr<CLMDBWrapperEx>> _mapWrapper;
std::unique_ptr<TheServer> _http;
std::wstring _url;
};