RESTinio
Public Member Functions | Private Attributes | List of all members
restinio::router::dynamic_none_of_methods_matcher_t Class Reference

An implementation of method_matcher that allows a method if it isn't found in a dynamic list of disabled methods. More...

#include <method_matcher.hpp>

Inheritance diagram for restinio::router::dynamic_none_of_methods_matcher_t:
restinio::router::method_matcher_t

Public Member Functions

 dynamic_none_of_methods_matcher_t ()=default
 
RESTINIO_NODISCARD bool match (const http_method_id_t &method) const noexcept override
 Is the specified method can be applied to a route? More...
 
dynamic_none_of_methods_matcher_tadd (http_method_id_t method)
 
RESTINIO_NODISCARD std::size_t size () const noexcept
 
RESTINIO_NODISCARD bool empty () const noexcept
 
- Public Member Functions inherited from restinio::router::method_matcher_t
 method_matcher_t (const method_matcher_t &)=default
 
method_matcher_toperator= (const method_matcher_t &)=default
 
 method_matcher_t (method_matcher_t &&)=default
 
method_matcher_toperator= (method_matcher_t &&)=default
 
 method_matcher_t ()=default
 
virtual ~method_matcher_t ()=default
 
virtual RESTINIO_NODISCARD bool match (const http_method_id_t &method) const noexcept=0
 Is the specified method can be applied to a route? More...
 

Private Attributes

std::vector< http_method_id_tm_methods
 

Detailed Description

An implementation of method_matcher that allows a method if it isn't found in a dynamic list of disabled methods.

Usage example:

if(config.handle_get_method())
matcher.add(restinio::http_method_get());
if(config.handle_head_method())
matcher.add(restinio::http_method_head());
router->add_handler(matcher, // Or std::move(matcher) if matcher is no more needed.
"/users/:id",
[](const auto & req, auto & params) {...});
An implementation of method_matcher that allows a method if it isn't found in a dynamic list of disab...
dynamic_none_of_methods_matcher_t & add(http_method_id_t method)
Since
v.0.6.6

Definition at line 536 of file method_matcher.hpp.

Constructor & Destructor Documentation

◆ dynamic_none_of_methods_matcher_t()

restinio::router::dynamic_none_of_methods_matcher_t::dynamic_none_of_methods_matcher_t ( )
default

Member Function Documentation

◆ add()

dynamic_none_of_methods_matcher_t & restinio::router::dynamic_none_of_methods_matcher_t::add ( http_method_id_t  method)
inline

Definition at line 555 of file method_matcher.hpp.

◆ empty()

RESTINIO_NODISCARD bool restinio::router::dynamic_none_of_methods_matcher_t::empty ( ) const
inlinenoexcept

Definition at line 570 of file method_matcher.hpp.

◆ match()

RESTINIO_NODISCARD bool restinio::router::dynamic_none_of_methods_matcher_t::match ( const http_method_id_t method) const
inlineoverridevirtualnoexcept

Is the specified method can be applied to a route?

Return values
trueif method can be applied to a route.
falseif method can't be applied to a route.

Implements restinio::router::method_matcher_t.

Definition at line 545 of file method_matcher.hpp.

◆ size()

RESTINIO_NODISCARD std::size_t restinio::router::dynamic_none_of_methods_matcher_t::size ( ) const
inlinenoexcept

Definition at line 563 of file method_matcher.hpp.

Member Data Documentation

◆ m_methods

std::vector< http_method_id_t > restinio::router::dynamic_none_of_methods_matcher_t::m_methods
private

Definition at line 538 of file method_matcher.hpp.


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