module; #include #include export module routemon:req_ctx; import :http.common; import :trace; namespace routemon { export class req_ctx { trace::id tid_; std::locale locale_; http::verb_set route_verbs_; bool keep_alive_; bhttp::request_header const& req_header_; public: explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bool keep_alive, bhttp::request_header const& req_header) : tid_{tid}, locale_{locale}, route_verbs_{route_verbs}, keep_alive_{keep_alive}, req_header_{req_header} {} template explicit req_ctx(trace::id tid, std::locale locale, http::verb_set route_verbs, bhttp::request const& req) : req_ctx{tid, locale, route_verbs, req.keep_alive(), req.base()} {} auto trace_id() const -> trace::id { return tid_; } auto locale() const -> std::locale { return locale_; } auto route_verbs() const -> http::verb_set { return route_verbs_; } auto keep_alive() const -> bool { return keep_alive_; } auto req_header() const -> bhttp::request_header const& { return req_header_; } }; } // namespace routemon