9 #include <restinio/async_chain/common.hpp> 204 class actual_controller_t
final 205 :
public async_handling_controller_t< Extra_Data_Factory >
222 actual_request_handle_t request,
223 const schedulers_array_t & schedulers )
224 : m_request{ request }
225 , m_schedulers{ schedulers }
237 const auto index_to_use = m_current;
240 if( index_to_use >= m_schedulers.size() )
242 return { no_more_schedulers_t{} };
246 return { m_schedulers[ index_to_use ] };
263 store_to( std::size_t index, Head && head, Tail && ...tail )
272 if constexpr( 0u !=
sizeof...(
tail) )
292 template<
typename... Schedulers >
296 "Wrong number of parameters for the constructor of " 297 "fixed_size_chain_t<Size>. Exact `Size` parameters expected" );
const actual_request_handle_t m_request
The source request.
request_handling_status_t operator()(const actual_request_handle_t &req) const
fixed_size_chain_t(Schedulers &&...schedulers)
Initializing constructor.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, std::optional< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in std::optional<Value_Type> if parameter exis...
schedulers_array_t m_schedulers
Request handlers.
actual_on_next_result_t on_next() override
Command to try find a next scheduler to be invoked.
A holder of fixed-size chain of asynchronous handlers.
std::size_t m_current
Index of the current scheduler to be used.
fixed_size_chain_t()=delete
actual_controller_t(actual_request_handle_t request, const schedulers_array_t &schedulers)
Initializing constructor.
void store_to(std::size_t index, Head &&head, Tail &&...tail)
Helper method to initialize the array of schedulers.
const actual_request_handle_t & request_handle() const noexcept override
Get reference to the source request.
schedulers_array_t m_schedulers
The array of schedulers.