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

Class FirstMW

tests/unittest.cpp:853–870  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

851
852template<bool Local>
853struct FirstMW : public std::conditional<Local, crow::ILocalMiddleware, empty_type>::type
854{
855 struct context
856 {
857 std::vector<string> v;
858 };
859
860 void before_handle(request& /*req*/, response& /*res*/, context& ctx)
861 {
862 ctx.v.push_back("1 before");
863 }
864
865 void after_handle(request& /*req*/, response& /*res*/, context& ctx)
866 {
867 ctx.v.push_back("1 after");
868 test_middleware_context_vector = ctx.v;
869 }
870};
871
872template<bool Local>
873struct SecondMW : public std::conditional<Local, crow::ILocalMiddleware, empty_type>::type

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected