178 typename Extra_Data_Factory = no_extra_data_factory_t >
263 store_to( std::size_t index, Head && head, Tail && ...tail )
266 [scheduler = std::move(head)]
269 return scheduler( std::move(controller) );
272 if constexpr( 0u !=
sizeof...(tail) )
273 store_to( index + 1u, std::forward<Tail>(tail)... );
292 template<
typename... Schedulers >
295 static_assert( Size ==
sizeof...(schedulers),
296 "Wrong number of parameters for the constructor of "
297 "fixed_size_chain_t<Size>. Exact `Size` parameters expected" );
299 store_to( 0u, std::forward<Schedulers>(schedulers)... );
313 std::make_unique< actual_controller_t >(
316 next( std::move(controller) );
Interface of a controller of an async chan.
generic_request_handle_t< typename Extra_Data_Factory::data_t > actual_request_handle_t
Short alias for request_handle type.
on_next_result_t< Extra_Data_Factory > actual_on_next_result_t
Short alias for the result type of on_next method.
std::size_t m_current
Index of the current scheduler to be used.
const actual_request_handle_t & request_handle() const noexcept override
Get reference to the source request.
actual_controller_t(actual_request_handle_t request, const schedulers_array_t &schedulers)
Initializing constructor.
const actual_request_handle_t m_request
The source request.
actual_on_next_result_t on_next() override
Command to try find a next scheduler to be invoked.
schedulers_array_t m_schedulers
Request handlers.
unique_async_handling_controller_t< Extra_Data_Factory > unique_controller_t
Short alias for unique controller type.
schedulers_array_t m_schedulers
The array of schedulers.
fixed_size_chain_t(Schedulers &&...schedulers)
Initializing constructor.
fixed_size_chain_t()=delete
request_handling_status_t operator()(const actual_request_handle_t &req) const
typename async_handling_controller_t< Extra_Data_Factory >::actual_on_next_result_t actual_on_next_result_t
Short alias for the result of controller's on_next method.
std::array< scheduler_holder_t, Size > schedulers_array_t
Short alias for an array of request handlers.
generic_async_request_scheduler_t< Extra_Data_Factory > scheduler_holder_t
Short alias for a request handler.
typename async_handling_controller_t< Extra_Data_Factory >::actual_request_handle_t actual_request_handle_t
Short alias to a smart pointer to the source request.
void store_to(std::size_t index, Head &&head, Tail &&...tail)
Helper method to initialize the array of schedulers.
Common stuff for different types of async handlers chains.
std::function< schedule_result_t(unique_async_handling_controller_t< Extra_Data_Factory >) > generic_async_request_scheduler_t
Short alias for a type of a scheduler to be used in async chains.
void next(unique_async_handling_controller_t< Extra_Data_Factory > controller)
Command to try to switch to the next handler in an async chain.
schedule_result_t
Type for return value of a scheduler in a chain.
std::unique_ptr< async_handling_controller_t< Extra_Data_Factory > > unique_async_handling_controller_t
Short alias for unique_ptr to async_handling_controller.
constexpr request_handling_status_t request_accepted() noexcept
request_handling_status_t
Request handling status.
Special type to be used as an indicator that there are no more schedulers in an async chain.