RESTinio
Loading...
Searching...
No Matches
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory > Class Template Reference

A single generic express route entry. More...

#include <express.hpp>

Public Types

using actual_request_handler_t
using actual_request_handle_t

Public Member Functions

 generic_express_route_entry_t (const generic_express_route_entry_t &)=delete
generic_express_route_entry_toperator= (const generic_express_route_entry_t &)=delete
 generic_express_route_entry_t ()=default
 generic_express_route_entry_t (generic_express_route_entry_t &&)=default
generic_express_route_entry_toperator= (generic_express_route_entry_t &&)=default
template<typename Method_Matcher>
 generic_express_route_entry_t (Method_Matcher &&method_matcher, string_view_t route_path, const path2regex::options_t &options, actual_request_handler_t handler)
template<typename Method_Matcher>
 generic_express_route_entry_t (Method_Matcher &&method_matcher, string_view_t route_path, actual_request_handler_t handler)
bool match (const http_request_header_t &h, impl::target_path_holder_t &target_path, route_params_t &params) const
 Checks if request header matches entry, and if so, set route params.
request_handling_status_t handle (actual_request_handle_t rh, route_params_t rp) const
 Calls a handler of given request with given params.

Private Types

using matcher_init_data_t

Private Member Functions

template<typename Method_Matcher>
 generic_express_route_entry_t (Method_Matcher &&method_matcher, matcher_init_data_t matcher_data, actual_request_handler_t handler)

Private Attributes

impl::route_matcher_t< Regex_Engine > m_matcher
actual_request_handler_t m_handler

Detailed Description

template<typename Regex_Engine, typename Extra_Data_Factory>
class restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >

A single generic express route entry.

Might be helpful for use without express_router_t, if only a single route is needed. It gives the same help with route parameters.

Definition at line 475 of file express.hpp.

Member Typedef Documentation

◆ actual_request_handle_t

template<typename Regex_Engine, typename Extra_Data_Factory>
using restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::actual_request_handle_t
Initial value:
typename Extra_Data_Factory::data_t
>
std::shared_ptr< generic_request_t< Extra_Data > > generic_request_handle_t
An alias for shared-pointer to incoming request.

Definition at line 481 of file express.hpp.

◆ actual_request_handler_t

template<typename Regex_Engine, typename Extra_Data_Factory>
using restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::actual_request_handler_t
Initial value:
typename Extra_Data_Factory::data_t
>
std::function< request_handling_status_t( generic_request_handle_t< Extra_Data >, route_params_t) > generic_express_request_handler_t
Type of generic handler for one route.
Definition express.hpp:442

Definition at line 478 of file express.hpp.

◆ matcher_init_data_t

template<typename Regex_Engine, typename Extra_Data_Factory>
using restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::matcher_init_data_t
private
Initial value:
Regex_Engine >
Helper class for gthering parameters from route.
Definition express.hpp:244
Resulting regex and param extraction for a specific route.

Definition at line 486 of file express.hpp.

Constructor & Destructor Documentation

◆ generic_express_route_entry_t() [1/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
template<typename Method_Matcher>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( Method_Matcher && method_matcher,
matcher_init_data_t matcher_data,
actual_request_handler_t handler )
inlineprivate

Definition at line 492 of file express.hpp.

◆ generic_express_route_entry_t() [2/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( const generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory > & )
delete

◆ generic_express_route_entry_t() [3/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( )
default

◆ generic_express_route_entry_t() [4/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory > && )
default

◆ generic_express_route_entry_t() [5/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
template<typename Method_Matcher>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( Method_Matcher && method_matcher,
string_view_t route_path,
const path2regex::options_t & options,
actual_request_handler_t handler )
inline

Definition at line 518 of file express.hpp.

◆ generic_express_route_entry_t() [6/6]

template<typename Regex_Engine, typename Extra_Data_Factory>
template<typename Method_Matcher>
restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::generic_express_route_entry_t ( Method_Matcher && method_matcher,
string_view_t route_path,
actual_request_handler_t handler )
inline

Definition at line 532 of file express.hpp.

Member Function Documentation

◆ handle()

template<typename Regex_Engine, typename Extra_Data_Factory>
request_handling_status_t restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::handle ( actual_request_handle_t rh,
route_params_t rp ) const
inlinenodiscard

Calls a handler of given request with given params.

Definition at line 558 of file express.hpp.

◆ match()

template<typename Regex_Engine, typename Extra_Data_Factory>
bool restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::match ( const http_request_header_t & h,
impl::target_path_holder_t & target_path,
route_params_t & params ) const
inlinenodiscard

Checks if request header matches entry, and if so, set route params.

Definition at line 547 of file express.hpp.

◆ operator=() [1/2]

template<typename Regex_Engine, typename Extra_Data_Factory>
generic_express_route_entry_t & restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::operator= ( const generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory > & )
delete

◆ operator=() [2/2]

template<typename Regex_Engine, typename Extra_Data_Factory>
generic_express_route_entry_t & restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::operator= ( generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory > && )
default

Member Data Documentation

◆ m_handler

template<typename Regex_Engine, typename Extra_Data_Factory>
actual_request_handler_t restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::m_handler
private

Definition at line 565 of file express.hpp.

◆ m_matcher

template<typename Regex_Engine, typename Extra_Data_Factory>
impl::route_matcher_t< Regex_Engine > restinio::router::generic_express_route_entry_t< Regex_Engine, Extra_Data_Factory >::m_matcher
private

Definition at line 564 of file express.hpp.


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