3 #include "crow/utility.h"
4 #include "crow/http_request.h"
5 #include "crow/http_response.h"
13 template<
typename... Middlewares>
14 struct partial_context :
public black_magic::pop_back<Middlewares...>::template rebind<partial_context>,
public black_magic::last_element_type<Middlewares...>::type::context
16 using parent_context =
typename black_magic::pop_back<Middlewares...>::template rebind<::crow::detail::partial_context>;
18 using partial =
typename std::conditional<N ==
sizeof...(Middlewares) - 1,
partial_context,
typename parent_context::template partial<N>>::type;
21 typename T::context& get()
23 return static_cast<typename T::context&
>(*this);
37 template<
typename... Middlewares>
41 template<
typename CallCriteria,
int N,
typename Context,
typename Container>
42 friend typename std::enable_if<(N == 0)>::type after_handlers_call_helper(
const CallCriteria& cc, Container& middlewares, Context& ctx,
request& req,
response& res);
43 template<
typename CallCriteria,
int N,
typename Context,
typename Container>
44 friend typename std::enable_if<(N > 0)>::type after_handlers_call_helper(
const CallCriteria& cc, Container& middlewares, Context& ctx,
request& req,
response& res);
46 template<
typename CallCriteria,
int N,
typename Context,
typename Container>
47 friend typename std::enable_if<(N < std::tuple_size<typename std::remove_reference<Container>::type>::value),
bool>::type
48 middleware_call_helper(
const CallCriteria& cc, Container& middlewares,
request& req,
response& res, Context& ctx);
51 typename T::context& get()
53 return static_cast<typename T::context&
>(*this);
57 using partial =
typename partial_context<Middlewares...>::template partial<N>;
The main namespace of the library. In this namespace is defined the most important classes and functi...
Definition: middleware_context.h:40
Definition: middleware_context.h:15
An HTTP request.
Definition: http_request.h:36
HTTP response.
Definition: http_response.h:34