3#include "crow/utility.h"
4#include "crow/http_request.h"
5#include "crow/http_response.h"
13 template <
typename ... Middlewares>
18 using parent_context =
typename black_magic::pop_back<Middlewares...>::template rebind<::crow::detail::partial_context>;
20 using partial =
typename std::conditional<N ==
sizeof...(Middlewares)-1,
partial_context,
typename parent_context::template partial<N>>::type;
23 typename T::context& get()
25 return static_cast<typename T::context&
>(*this);
40 template <
int N,
typename Context,
typename Container,
typename CurrentMW,
typename ... Middlewares>
41 bool middleware_call_helper(Container& middlewares,
request& req,
response& res, Context& ctx);
45 template <
typename ... Middlewares>
49 template <
int N,
typename Context,
typename Container>
50 friend typename std::enable_if<(N==0)>::type after_handlers_call_helper(Container& middlewares, Context& ctx,
request& req,
response& res);
51 template <
int N,
typename Context,
typename Container>
52 friend typename std::enable_if<(N>0)>::type after_handlers_call_helper(Container& middlewares, Context& ctx,
request& req,
response& res);
54 template <
int N,
typename Context,
typename Container,
typename CurrentMW,
typename ... Middlewares2>
55 friend bool middleware_call_helper(Container& middlewares,
request& req,
response& res, Context& ctx);
58 typename T::context& get()
60 return static_cast<typename T::context&
>(*this);
64 using partial =
typename partial_context<Middlewares...>::template partial<N>;
Definition: utility.h:320
Definition: utility.h:366
Definition: middleware_context.h:48
Definition: middleware_context.h:17
An HTTP request.
Definition: http_request.h:27
HTTP response.
Definition: http_response.h:24