Covalent Bond
0.0.1-alpha
'covalent bond' is a data middle office. As a 2022-2023 Fall SWE final project.
src
core
utils
cbWebserver.hpp
Go to the documentation of this file.
1
23
#ifndef __UTILS_CB_WEB_SERVER_HPP_
24
#define __UTILS_CB_WEB_SERVER_HPP_
25
26
#ifdef _WIN32
27
#if _MSC_VER > 1000
28
#pragma once
29
#endif
30
#endif
31
32
#if defined(__unix__) && defined(__clang__)
33
#pragma once
34
#endif
35
36
#include "../pch.hpp"
37
#include <signal.h>
38
#include <workflow/WFHttpServer.h>
39
#include <workflow/WFFacilities.h>
40
41
typedef
std::function<void(WFHttpTask*,
char
*)>
http_func_handle
;
42
43
namespace
cb
{
44
namespace
utils {
45
50
class
cbWebserver
{
51
public
:
52
cbWebserver
() =
default
;
53
60
cbWebserver
(
const
int32_t& port,
const
std::string& root);
61
~cbWebserver
();
62
67
void
execMain
();
68
73
void
stopMain
();
74
80
WFHttpServer*
getServer
();
81
82
private
:
83
static
void
signal_kill
(
int
signo);
84
85
int32_t
m_port
;
86
std::string
m_root
;
87
WFHttpServer*
m_server
;
88
};
89
90
}
// namespace utils
91
}
// namespace cb
92
93
#endif //! __UTILS_CB_WEB_SERVER_HPP_
cb::utils::cbWebserver::m_root
std::string m_root
Definition:
cbWebserver.hpp:86
cb::utils::cbWebserver::~cbWebserver
~cbWebserver()
Definition:
cbWebserver.cpp:16
cb::utils::cbWebserver::getServer
WFHttpServer * getServer()
Get the Server object.
Definition:
cbWebserver.cpp:101
cb
_WIN32
Definition:
api.cpp:4
cb::utils::cbWebserver::stopMain
void stopMain()
Definition:
cbWebserver.cpp:99
cb::utils::cbWebserver
Definition:
cbWebserver.hpp:50
cb::utils::cbWebserver::cbWebserver
cbWebserver()=default
cb::utils::cbWebserver::signal_kill
static void signal_kill(int signo)
Definition:
cbWebserver.cpp:103
cb::utils::cbWebserver::execMain
void execMain()
Definition:
cbWebserver.cpp:82
cb::utils::cbWebserver::m_port
int32_t m_port
Definition:
cbWebserver.hpp:85
http_func_handle
std::function< void(WFHttpTask *, char *)> http_func_handle
_WIN32
Definition:
cbWebserver.hpp:41
cb::utils::cbWebserver::m_server
WFHttpServer * m_server
Definition:
cbWebserver.hpp:87
Generated by
1.8.17