diff options
| author | Rutger Broekhoff | 2026-08-28 21:12:55 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-08-28 21:12:55 +0200 |
| commit | a5d95afb96eb9a3b65d82f5f84bf8e4a4fb4c8ac (patch) | |
| tree | b4e0ec57c3799e9f649c6bfe27cb6c3313b97364 /server/src/req_ctx.cppm | |
| parent | 973aec43ea54bbf95b64fbcb636403401d1ca60e (diff) | |
| download | routemon-a5d95afb96eb9a3b65d82f5f84bf8e4a4fb4c8ac.tar.gz routemon-a5d95afb96eb9a3b65d82f5f84bf8e4a4fb4c8ac.zip | |
clang-format C++ sources
Diffstat (limited to 'server/src/req_ctx.cppm')
| -rw-r--r-- | server/src/req_ctx.cppm | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/server/src/req_ctx.cppm b/server/src/req_ctx.cppm index 797c51d..4a64d7d 100644 --- a/server/src/req_ctx.cppm +++ b/server/src/req_ctx.cppm | |||
| @@ -10,42 +10,39 @@ import :trace; | |||
| 10 | 10 | ||
| 11 | namespace routemon { | 11 | namespace routemon { |
| 12 | 12 | ||
| 13 | export class req_ctx { | 13 | export class req_ctx |
| 14 | trace::id tid_; | 14 | { |
| 15 | std::locale locale_; | 15 | trace::id tid_; |
| 16 | http::verb_set route_verbs_; | 16 | std::locale locale_; |
| 17 | bool keep_alive_; | 17 | http::verb_set route_verbs_; |
| 18 | bhttp::request_header<bhttp::fields> const& req_header_; | 18 | bool keep_alive_; |
| 19 | bhttp::request_header<bhttp::fields> const& req_header_; | ||
| 19 | 20 | ||
| 20 | public: | 21 | public: |
| 21 | explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bool keep_alive, bhttp::request_header<bhttp::fields> const& req_header) | 22 | explicit req_ctx( |
| 22 | : tid_{tid}, locale_{locale}, route_verbs_{route_verbs}, keep_alive_{keep_alive}, req_header_{req_header} | 23 | trace::id tid, std::locale locale, http::verb_set route_verbs, |
| 23 | {} | 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 | } | ||
| 24 | 29 | ||
| 25 | template<typename ReqBody> | 30 | template <typename ReqBody> |
| 26 | explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bhttp::request<ReqBody> const& req) | 31 | explicit req_ctx( |
| 27 | : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()} | 32 | trace::id tid, std::locale locale, http::verb_set route_verbs, |
| 28 | {} | 33 | bhttp::request<ReqBody> const& req) |
| 34 | : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()} | ||
| 35 | { | ||
| 36 | } | ||
| 29 | 37 | ||
| 30 | auto trace_id() const -> trace::id { | 38 | auto trace_id() const -> trace::id { return tid_; } |
| 31 | return tid_; | 39 | auto locale() const -> std::locale { return locale_; } |
| 32 | } | 40 | auto route_verbs() const -> http::verb_set { return route_verbs_; } |
| 33 | 41 | auto keep_alive() const -> bool { return keep_alive_; } | |
| 34 | auto locale() const -> std::locale { | 42 | auto req_header() const -> bhttp::request_header<bhttp::fields> const& |
| 35 | return locale_; | 43 | { |
| 36 | } | 44 | return req_header_; |
| 37 | 45 | } | |
| 38 | auto route_verbs() const -> http::verb_set { | 46 | }; |
| 39 | return route_verbs_; | ||
| 40 | } | ||
| 41 | |||
| 42 | auto keep_alive() const -> bool { | ||
| 43 | return keep_alive_; | ||
| 44 | } | ||
| 45 | |||
| 46 | auto req_header() const -> bhttp::request_header<bhttp::fields> const& { | ||
| 47 | return req_header_; | ||
| 48 | } | ||
| 49 | }; | ||
| 50 | 47 | ||
| 51 | } // namespace routemon | 48 | } // namespace routemon |