summaryrefslogtreecommitdiffstats
path: root/server/src/req_ctx.cppm
diff options
context:
space:
mode:
authorRutger Broekhoff2026-08-29 12:01:42 +0200
committerRutger Broekhoff2026-08-29 12:01:42 +0200
commit52b3cd46c76fd4be18aeb8422a08a073484b9fad (patch)
treeb4f23957c096e6bce5369bb94a4e8e23de71761a /server/src/req_ctx.cppm
parent35878b76049b9c3e752480e9f298b7e2da6fdf1f (diff)
downloadroutemon-52b3cd46c76fd4be18aeb8422a08a073484b9fad.tar.gz
routemon-52b3cd46c76fd4be18aeb8422a08a073484b9fad.zip
More module implementation partition units
Diffstat (limited to 'server/src/req_ctx.cppm')
-rw-r--r--server/src/req_ctx.cppm48
1 files changed, 0 insertions, 48 deletions
diff --git a/server/src/req_ctx.cppm b/server/src/req_ctx.cppm
deleted file mode 100644
index 4a64d7d..0000000
--- a/server/src/req_ctx.cppm
+++ /dev/null
@@ -1,48 +0,0 @@
1module;
2
3#include <boost/beast/http/message.hpp>
4#include <boost/beast/http/verb.hpp>
5
6export module routemon:req_ctx;
7
8import :http.common;
9import :trace;
10
11namespace routemon {
12
13export class req_ctx
14{
15 trace::id tid_;
16 std::locale locale_;
17 http::verb_set route_verbs_;
18 bool keep_alive_;
19 bhttp::request_header<bhttp::fields> const& req_header_;
20
21public:
22 explicit req_ctx(
23 trace::id tid, std::locale locale, http::verb_set route_verbs,
24 bool keep_alive, bhttp::request_header<bhttp::fields> const& req_header)
25 : tid_{tid}, locale_{locale}, route_verbs_{route_verbs},
26 keep_alive_{keep_alive}, req_header_{req_header}
27 {
28 }
29
30 template <typename ReqBody>
31 explicit req_ctx(
32 trace::id tid, std::locale locale, http::verb_set route_verbs,
33 bhttp::request<ReqBody> const& req)
34 : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()}
35 {
36 }
37
38 auto trace_id() const -> trace::id { return tid_; }
39 auto locale() const -> std::locale { return locale_; }
40 auto route_verbs() const -> http::verb_set { return route_verbs_; }
41 auto keep_alive() const -> bool { return keep_alive_; }
42 auto req_header() const -> bhttp::request_header<bhttp::fields> const&
43 {
44 return req_header_;
45 }
46};
47
48} // namespace routemon