RESTinio
|
Helper for holding a pointer to a buffer where a new object of type Extra_Data should be constructed. More...
#include <request_handler.hpp>
Public Member Functions | |
extra_data_buffer_t (void *buffer) | |
RESTINIO_NODISCARD void * | get () const noexcept |
Private Attributes | |
void * | m_buffer |
Helper for holding a pointer to a buffer where a new object of type Extra_Data should be constructed.
This class is intended to make the construction of new objects of type Extra_Data inside a preallocated buffer more type-safe.
An instance of Extra_Data is incorporated into a request object by holding a buffer of necessary capacity and alignment inside request object. The make_within
method of extra-data-factory is called for the construction of new instance of Extra_Data in that buffer. If raw void pointer will be passed to make_within
method then it would make possible a case when wrong extra-data-factory can be used.
But if a pointer to the buffer for new instance will be wrapped into extra_data_buffer_t then it allows additional type checks from the compiler. That is why a extra-data-factory receives extra_data_buffer_t<Extra_Data> as a parameter to make_within
instead of raw pointers.
Definition at line 51 of file request_handler.hpp.
|
inline |
Definition at line 56 of file request_handler.hpp.
|
inlinenoexcept |
Definition at line 60 of file request_handler.hpp.
|
private |
Definition at line 53 of file request_handler.hpp.