restinio::router::dynamic_any_of_methods_matcher_t Class Reference

An implementation of method_matcher that allows a method if it's found in a dynamic list of allowed methods. More...

`#include <method_matcher.hpp>`

Inheritance diagram for restinio::router::dynamic_any_of_methods_matcher_t:

## Public Member Functions

| dynamic_any_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_any_of_methods_matcher_t & | add (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_t & | operator= (const method_matcher_t &)=default
| method_matcher_t (method_matcher_t &&)=default
method_matcher_t & | operator= (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_t > | m_methods

## Detailed Description

An implementation of method_matcher that allows a method if it's found in a dynamic list of allowed methods.

Usage example:

restinio::router::dynamic_any_of_methods_matcher_t matcher;
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) {...});
restinio::router::dynamic_any_of_methods_matcher_t
An implementation of method_matcher that allows a method if it's found in a dynamic list of allowed m...
Definition: method_matcher.hpp:476
restinio::router::dynamic_any_of_methods_matcher_t::add
dynamic_any_of_methods_matcher_t & add(http_method_id_t method)
Definition: method_matcher.hpp:494
config_s
Definition: deflate.c:120

Since
  v.0.6.6

Definition at line 475 of file method_matcher.hpp.

## Constructor & Destructor Documentation

## dynamic_any_of_methods_matcher_t()

restinio::router::dynamic_any_of_methods_matcher_t::dynamic_any_of_methods_matcher_t | ( |  | ) |

default

## Member Function Documentation

## add()

dynamic_any_of_methods_matcher_t & restinio::router::dynamic_any_of_methods_matcher_t::add | ( | http_method_id_t | method | ) |

inline

Definition at line 494 of file method_matcher.hpp.

## empty()

RESTINIO_NODISCARD bool restinio::router::dynamic_any_of_methods_matcher_t::empty | ( |  | ) | const

inlinenoexcept

Definition at line 509 of file method_matcher.hpp.

## match()

RESTINIO_NODISCARD bool restinio::router::dynamic_any_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

  true | if method can be applied to a route.
  false | if method can't be applied to a route.

Implements restinio::router::method_matcher_t.

Definition at line 484 of file method_matcher.hpp.

## size()

RESTINIO_NODISCARD std::size_t restinio::router::dynamic_any_of_methods_matcher_t::size | ( |  | ) | const

inlinenoexcept

Definition at line 502 of file method_matcher.hpp.

## Member Data Documentation

## m_methods

std::vector< http_method_id_t > restinio::router::dynamic_any_of_methods_matcher_t::m_methods

private

Definition at line 477 of file method_matcher.hpp.

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

- restinio/router/method_matcher.hpp