RESTinio
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
restinio::router::express_route_entry_t< Regex_Engine > Class Template Reference

A single express route entry. More...

#include <express.hpp>

Public Member Functions

 express_route_entry_t (const express_route_entry_t &)=delete
 
express_route_entry_toperator= (const express_route_entry_t &)=delete
 
 express_route_entry_t ()=default
 
 express_route_entry_t (express_route_entry_t &&)=default
 
express_route_entry_toperator= (express_route_entry_t &&)=default
 
 express_route_entry_t (http_method_id_t method, string_view_t route_path, const path2regex::options_t &options, express_request_handler_t handler)
 
 express_route_entry_t (http_method_id_t method, string_view_t route_path, express_request_handler_t handler)
 
bool match (const http_request_header_t &h, route_params_t &params) const
 Checks if request header matches entry, and if so, set route params. More...
 
request_handling_status_t handle (request_handle_t rh, route_params_t rp) const
 Calls a handler of given request with given params. More...
 
request_handling_status_t try_to_handle (request_handle_t rh) const
 Try to match the entry and calls a handler with extracted params. More...
 

Private Types

using matcher_init_data_t = path2regex::impl::route_regex_matcher_data_t< impl::route_params_appender_t, Regex_Engine >
 

Private Member Functions

 express_route_entry_t (http_method_id_t method, matcher_init_data_t matcher_data, express_request_handler_t handler)
 

Private Attributes

impl::route_matcher_t< Regex_Engine > m_matcher
 
express_request_handler_t m_handler
 

Detailed Description

template<typename Regex_Engine = std_regex_engine_t>
class restinio::router::express_route_entry_t< Regex_Engine >

A single 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 416 of file express.hpp.

Member Typedef Documentation

◆ matcher_init_data_t

template<typename Regex_Engine = std_regex_engine_t>
using restinio::router::express_route_entry_t< Regex_Engine >::matcher_init_data_t = path2regex::impl::route_regex_matcher_data_t< impl::route_params_appender_t, Regex_Engine >
private

Definition at line 419 of file express.hpp.

Constructor & Destructor Documentation

◆ express_route_entry_t() [1/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( http_method_id_t  method,
matcher_init_data_t  matcher_data,
express_request_handler_t  handler 
)
inlineprivate

Definition at line 420 of file express.hpp.

◆ express_route_entry_t() [2/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( const express_route_entry_t< Regex_Engine > &  )
delete

◆ express_route_entry_t() [3/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( )
default

◆ express_route_entry_t() [4/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( express_route_entry_t< Regex_Engine > &&  )
default

◆ express_route_entry_t() [5/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( http_method_id_t  method,
string_view_t  route_path,
const path2regex::options_t options,
express_request_handler_t  handler 
)
inline

Definition at line 441 of file express.hpp.

◆ express_route_entry_t() [6/6]

template<typename Regex_Engine = std_regex_engine_t>
restinio::router::express_route_entry_t< Regex_Engine >::express_route_entry_t ( http_method_id_t  method,
string_view_t  route_path,
express_request_handler_t  handler 
)
inline

Definition at line 454 of file express.hpp.

Member Function Documentation

◆ handle()

template<typename Regex_Engine = std_regex_engine_t>
request_handling_status_t restinio::router::express_route_entry_t< Regex_Engine >::handle ( request_handle_t  rh,
route_params_t  rp 
) const
inline

Calls a handler of given request with given params.

Definition at line 475 of file express.hpp.

◆ match()

template<typename Regex_Engine = std_regex_engine_t>
bool restinio::router::express_route_entry_t< Regex_Engine >::match ( const http_request_header_t h,
route_params_t params 
) const
inline

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

Definition at line 468 of file express.hpp.

◆ operator=() [1/2]

template<typename Regex_Engine = std_regex_engine_t>
express_route_entry_t& restinio::router::express_route_entry_t< Regex_Engine >::operator= ( const express_route_entry_t< Regex_Engine > &  )
delete

◆ operator=() [2/2]

template<typename Regex_Engine = std_regex_engine_t>
express_route_entry_t& restinio::router::express_route_entry_t< Regex_Engine >::operator= ( express_route_entry_t< Regex_Engine > &&  )
default

◆ try_to_handle()

template<typename Regex_Engine = std_regex_engine_t>
request_handling_status_t restinio::router::express_route_entry_t< Regex_Engine >::try_to_handle ( request_handle_t  rh) const
inline

Try to match the entry and calls a handler with extracted params.

Definition at line 482 of file express.hpp.

Member Data Documentation

◆ m_handler

template<typename Regex_Engine = std_regex_engine_t>
express_request_handler_t restinio::router::express_route_entry_t< Regex_Engine >::m_handler
private

Definition at line 493 of file express.hpp.

◆ m_matcher

template<typename Regex_Engine = std_regex_engine_t>
impl::route_matcher_t< Regex_Engine > restinio::router::express_route_entry_t< Regex_Engine >::m_matcher
private

Definition at line 492 of file express.hpp.


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