RESTinio
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t Class Referencefinal

Actual implementation of the controller interface. More...

Inheritance diagram for restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t:
restinio::async_chain::async_handling_controller_t< Extra_Data_Factory >

Public Member Functions

 actual_controller_t (actual_request_handle_t request, const schedulers_array_t &schedulers)
 Initializing constructor.
 
const actual_request_handle_trequest_handle () const noexcept override
 Get reference to the source request.
 
- Public Member Functions inherited from restinio::async_chain::async_handling_controller_t< Extra_Data_Factory >
virtual ~async_handling_controller_t ()=default
 

Private Member Functions

actual_on_next_result_t on_next () override
 Command to try find a next scheduler to be invoked.
 

Private Attributes

const actual_request_handle_t m_request
 The source request.
 
schedulers_array_t m_schedulers
 Request handlers.
 
std::size_t m_current {}
 Index of the current scheduler to be used.
 

Additional Inherited Members

- Public Types inherited from restinio::async_chain::async_handling_controller_t< Extra_Data_Factory >
using actual_request_handle_t
 Short alias for request_handle type.
 
using actual_async_request_scheduler_t
 Short alias for async_request_scheduler type.
 
using actual_on_next_result_t
 Short alias for the result type of on_next method.
 

Detailed Description

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
class restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t

Actual implementation of the controller interface.

Note
Object of this type holds a copy of the source array of schedulers.

Definition at line 204 of file fixed_size.hpp.

Constructor & Destructor Documentation

◆ actual_controller_t()

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::actual_controller_t ( actual_request_handle_t request,
const schedulers_array_t & schedulers )
inlineexplicit

Initializing constructor.

Definition at line 221 of file fixed_size.hpp.

Member Function Documentation

◆ on_next()

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
actual_on_next_result_t restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::on_next ( )
inlineoverrideprivatevirtual

Command to try find a next scheduler to be invoked.

Implementation of async_handling_controller_t should switch to the next scheduler in the chain and return the scheduler to be called next. If there are no such schedulers, no_more_schedulers_t must be returned.

Note
This method is intended to be called by next() function.

Implements restinio::async_chain::async_handling_controller_t< Extra_Data_Factory >.

Definition at line 235 of file fixed_size.hpp.

◆ request_handle()

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
const actual_request_handle_t & restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::request_handle ( ) const
inlineoverridevirtualnoexcept

Get reference to the source request.

Usage example:

{
// Get access to the source request.
const auto req = controller->request_handle();
if( restinio::http_method_get() == req->header().method() )
{
...
}
}
constexpr schedule_result_t ok() noexcept
Helper function to be used if scheduling was successful.
Definition common.hpp:49
schedule_result_t
Type for return value of a scheduler in a chain.
Definition common.hpp:25
std::unique_ptr< async_handling_controller_t< Extra_Data_Factory > > unique_async_handling_controller_t
Short alias for unique_ptr to async_handling_controller.
Definition common.hpp:84
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.

Implements restinio::async_chain::async_handling_controller_t< Extra_Data_Factory >.

Definition at line 230 of file fixed_size.hpp.

Member Data Documentation

◆ m_current

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
std::size_t restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::m_current {}
private

Index of the current scheduler to be used.

Note
May be equal to or greater than m_schedulers.size() in the case when all handlers are already processed.

Definition at line 217 of file fixed_size.hpp.

◆ m_request

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
const actual_request_handle_t restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::m_request
private

The source request.

Definition at line 208 of file fixed_size.hpp.

◆ m_schedulers

template<std::size_t Size, typename Extra_Data_Factory = no_extra_data_factory_t>
schedulers_array_t restinio::async_chain::fixed_size_chain_t< Size, Extra_Data_Factory >::actual_controller_t::m_schedulers
private

Request handlers.

Definition at line 210 of file fixed_size.hpp.


The documentation for this class was generated from the following file: