MCPcopy Create free account
hub / github.com/CrowCpp/Crow / SecondMW

Class SecondMW

tests/unittest.cpp:873–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871
872template<bool Local>
873struct SecondMW : public std::conditional<Local, crow::ILocalMiddleware, empty_type>::type
874{
875 struct context
876 {};
877 template<typename AllContext>
878 void before_handle(request& req, response& res, context&, AllContext& all_ctx)
879 {
880 all_ctx.template get<FirstMW<Local>>().v.push_back("2 before");
881 if (req.url.find("/break") != std::string::npos) res.end();
882 }
883
884 template<typename AllContext>
885 void after_handle(request&, response&, context&, AllContext& all_ctx)
886 {
887 all_ctx.template get<FirstMW<Local>>().v.push_back("2 after");
888 }
889};
890
891template<bool Local>
892struct ThirdMW : public std::conditional<Local, crow::ILocalMiddleware, empty_type>::type

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected