16#include <initializer_list>
79template<
typename Matcher >
85 template<
typename...
Args >
138template< std::
size_t Size >
152 std::initializer_list< http_method_id_t > values )
156 std::copy( values.begin(), values.end(),
m_methods.begin() );
182template< std::
size_t Size >
189 using base_type_t::base_type_t;
272 if(
other.m_matcher )
277 other.m_matcher =
nullptr;
278 other.m_mover =
nullptr;
332 "Target_Type should have appropriate alignment" );
376 template<
typename Arg >
382 static_assert( std::is_base_of<
384 "Arg should be derived from method_matcher_t" );
414template<
typename...
Args >
416impl::fixed_size_any_of_matcher_t<
sizeof...(Args) >
419 return { std::initializer_list<http_method_id_t>{ std::forward<Args>(
args)... } };
446template<
typename...
Args >
448impl::fixed_size_none_of_matcher_t<
sizeof...(Args) >
451 return { std::initializer_list<http_method_id_t>{ std::forward<Args>(
args)... } };
496 m_methods.emplace_back( std::move(method) );
557 m_methods.emplace_back( std::move(method) );
A type for representation of HTTP method ID.
An implementation of method_matcher that allows a method if it's found in a dynamic list of allowed m...
bool empty() const noexcept
std::vector< http_method_id_t > m_methods
dynamic_any_of_methods_matcher_t & add(http_method_id_t method)
std::size_t size() const noexcept
dynamic_any_of_methods_matcher_t()=default
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
An implementation of method_matcher that allows a method if it isn't found in a dynamic list of disab...
std::size_t size() const noexcept
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
dynamic_none_of_methods_matcher_t()=default
std::vector< http_method_id_t > m_methods
bool empty() const noexcept
dynamic_none_of_methods_matcher_t & add(http_method_id_t method)
A proxy for actual method_matcher that will be allocated in dynamic memory.
std::unique_ptr< Matcher > m_matcher
allocated_matcher_proxy_t(Args &&...args)
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
A special class that allows to hold a copy of small-size method_matchers or a pointer to dynamically ...
method_matcher_t * operator->() const noexcept
Get the pointer to actual matcher inside the holder.
std::array< char, buffer_size > m_buffer
The internal buffer.
friend void assign(buffered_matcher_holder_t &holder, Arg &&method_matcher)
pfn_move_t m_mover
An actual move-function.
friend void assign(buffered_matcher_holder_t &holder, http_method_id_t method)
void move_from(buffered_matcher_holder_t &other)
buffered_matcher_holder_t & operator=(buffered_matcher_holder_t &&other) noexcept
buffered_matcher_holder_t & operator=(const buffered_matcher_holder_t &)=delete
method_matcher_t *(*)(void *object, void *buffer) pfn_move_t
A type of free function to be used to move a value of an object to the specified buffer.
method_matcher_t & operator*() const noexcept
Get a reference to actual matcher inside the holder.
void assign(Args &&... args)
Creates an instance of Target_Type and initializes it with arguments Args.
buffered_matcher_holder_t()=default
buffered_matcher_holder_t(buffered_matcher_holder_t &&other) noexcept
static constexpr std::size_t alignment
Alignment to be used by the internal buffer.
method_matcher_t * get() const noexcept
Get the pointer to actual matcher inside the holder.
static constexpr std::size_t buffer_size
The size of the internal buffer.
~buffered_matcher_holder_t() noexcept
method_matcher_t * m_matcher
A pointer to actual matcher allocated inside the internall buffer.
buffered_matcher_holder_t(const buffered_matcher_holder_t &)=delete
A matcher that finds a value in the vector of allowed values of fixed size.
fixed_size_any_of_matcher_t(std::initializer_list< http_method_id_t > values)
Initializing constructor.
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
std::array< http_method_id_t, Size > m_methods
A matcher that finds a value in the vector of disabled values of fixed size.
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
A simple method_matcher that compares just one user-specified value.
simple_matcher_t(http_method_id_t method)
bool match(const http_method_id_t &method) const noexcept override
Is the specified method can be applied to a route?
http_method_id_t m_method
impl::fixed_size_none_of_matcher_t< sizeof...(Args) > none_of_methods(Args &&...args)
A factory function that creates a method_matcher that allows a method if it isn't found in the list o...
impl::fixed_size_any_of_matcher_t< sizeof...(Args) > any_of_methods(Args &&...args)
A factory function that creates a method_matcher that allows a method if it's found in the list of al...
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.
An interface of method_matcher.
virtual bool match(const http_method_id_t &method) const noexcept=0
Is the specified method can be applied to a route?
method_matcher_t(method_matcher_t &&)=default
virtual ~method_matcher_t()=default
method_matcher_t & operator=(const method_matcher_t &)=default
method_matcher_t()=default
method_matcher_t & operator=(method_matcher_t &&)=default
method_matcher_t(const method_matcher_t &)=default