A special class that allows to hold a copy of small-size method_matchers or a pointer to dynamically allocated large-size method_matchers.
More...
#include <method_matcher.hpp>
|
using | pfn_move_t = method_matcher_t* (*)(void* object, void* buffer) |
| A type of free function to be used to move a value of an object to the specified buffer.
|
|
static constexpr std::size_t | buffer_size |
| The size of the internal buffer.
|
static constexpr std::size_t | alignment |
| Alignment to be used by the internal buffer.
|
A special class that allows to hold a copy of small-size method_matchers or a pointer to dynamically allocated large-size method_matchers.
An instance of this class looks like a smart pointer to method_matcher_t. This smart pointer is moveable, but not copyable (it's like unique_ptr).
A value is set by assign() method:
std::initializer_list<http_method_id_t>{
http_method_get(),
http_method_head(),
...
});
void assign(Args &&... args)
Creates an instance of Target_Type and initializes it with arguments Args.
buffered_matcher_holder_t()=default
A matcher that finds a value in the vector of allowed values of fixed size.
- Since
- v.0.6.6
Definition at line 224 of file method_matcher.hpp.
◆ pfn_move_t
A type of free function to be used to move a value of an object to the specified buffer.
This function should allocate a new instance in buffer and move the content of object into it. The pointer to the allocated instance should be returned.
Definition at line 245 of file method_matcher.hpp.
◆ buffered_matcher_holder_t() [1/3]
restinio::router::impl::buffered_matcher_holder_t::buffered_matcher_holder_t |
( |
| ) |
|
|
default |
◆ ~buffered_matcher_holder_t()
restinio::router::impl::buffered_matcher_holder_t::~buffered_matcher_holder_t |
( |
| ) |
|
|
inlinenoexcept |
◆ buffered_matcher_holder_t() [2/3]
◆ buffered_matcher_holder_t() [3/3]
◆ assign()
template<typename Target_Type, typename... Args>
void restinio::router::impl::buffered_matcher_holder_t::assign |
( |
Args &&... | args | ) |
|
|
inline |
Creates an instance of Target_Type and initializes it with arguments Args.
Previous value of buffered_matcher_holder_t will be destroyed.
A new object is created in the internal buffer if its size is not greater than buffer_size. Otherwise a new object is created in dynamic memory and allocated_matcher_proxy_t for it is placed into the internal buffer.
Definition at line 329 of file method_matcher.hpp.
◆ cleanup()
void restinio::router::impl::buffered_matcher_holder_t::cleanup |
( |
| ) |
|
|
inlineprivate |
◆ get()
method_matcher_t * restinio::router::impl::buffered_matcher_holder_t::get |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ move_from()
◆ operator*()
method_matcher_t & restinio::router::impl::buffered_matcher_holder_t::operator* |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ operator->()
method_matcher_t * restinio::router::impl::buffered_matcher_holder_t::operator-> |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ assign [1/2]
◆ assign [2/2]
◆ alignment
std::size_t restinio::router::impl::buffered_matcher_holder_t::alignment |
|
staticconstexprprivate |
Initial value:=
std::max( {
A proxy for actual method_matcher that will be allocated in dynamic memory.
A simple method_matcher that compares just one user-specified value.
Alignment to be used by the internal buffer.
Definition at line 231 of file method_matcher.hpp.
◆ buffer_size
std::size_t restinio::router::impl::buffered_matcher_holder_t::buffer_size |
|
staticconstexprprivate |
◆ m_buffer
std::array<char, buffer_size> restinio::router::impl::buffered_matcher_holder_t::m_buffer |
|
private |
◆ m_matcher
method_matcher_t* restinio::router::impl::buffered_matcher_holder_t::m_matcher { nullptr } |
|
private |
A pointer to actual matcher allocated inside the internall buffer.
Can be nullptr. For example: just after the creation and before the call to assign(). Or after a move-constructor or move-operator.
Definition at line 252 of file method_matcher.hpp.
◆ m_mover
pfn_move_t restinio::router::impl::buffered_matcher_holder_t::m_mover { nullptr } |
|
private |
The documentation for this class was generated from the following file: