restinio::impl::datasizeable_buf_t< Datasizeable > Class Template Referencefinal

User defined datasizable object. More...

`#include <buffers.hpp>`

Inheritance diagram for restinio::impl::datasizeable_buf_t< Datasizeable >:

## Public Member Functions

| datasizeable_buf_t (Datasizeable buf)
| datasizeable_buf_t (datasizeable_buf_t &&) noexcept=default
An implementation of writable_base_t interface.

See also
  writable_base_t

virtual asio_ns::const_buffer | buffer () const override
| Get asio buf entity. More...
virtual void | relocate_to (void *storage) override
| Move this buffer enitity to a given location. More...
An implementation of buf_iface_t interface.

See also
  buf_iface_t

virtual std::size_t | size () const override
| Get the size of a writable piece of data. More...
virtual asio_ns::const_buffer | buffer () const =0
| Get asio buf entity. More...
Public Member Functions inherited from restinio::impl::writable_base_t
| writable_base_t ()=default
| writable_base_t (const writable_base_t &)=default
| writable_base_t (writable_base_t &&)=default
writable_base_t & | operator= (const writable_base_t &)=delete
writable_base_t & | operator= (writable_base_t &&)=delete
virtual | ~writable_base_t ()
virtual void | relocate_to (void *storage)=0
| Move this buffer enitity to a given location. More...
virtual std::size_t | size () const =0
| Get the size of a writable piece of data. More...

## Private Attributes

Datasizeable | m_custom_buffer
| A datasizeable item that represents buffer. More...

## Detailed Description

template<typename Datasizeable>
class restinio::impl::datasizeable_buf_t< Datasizeable >

User defined datasizable object.

Note
  there is a limitation on how large a `Datasizeable` type can be. The limitation is checked with a following predicate:
  sizeof(datasizeable_buf_t<D>) <= needed_storage_max_size;
  restinio::impl::needed_storage_max_size
  constexpr std::size_t needed_storage_max_size
  An of memory that is to be enough to hold any possible buffer entity.
  Definition: buffers.hpp:388

Definition at line 188 of file buffers.hpp.

## Constructor & Destructor Documentation

## datasizeable_buf_t() [1/2]

template<typename Datasizeable >

restinio::impl::datasizeable_buf_t< Datasizeable >::datasizeable_buf_t | ( | Datasizeable | buf | ) |

inline

Definition at line 212 of file buffers.hpp.

## datasizeable_buf_t() [2/2]

template<typename Datasizeable >

restinio::impl::datasizeable_buf_t< Datasizeable >::datasizeable_buf_t | ( | datasizeable_buf_t< Datasizeable > && |  | ) |

default noexcept

## Member Function Documentation

## buffer()

template<typename Datasizeable >

virtual asio_ns::const_buffer restinio::impl::datasizeable_buf_t< Datasizeable >::buffer | ( |  | ) | const

inline override virtual

Get asio buf entity.

Prepares an item for being used with ASIO API.

Implements restinio::impl::buf_iface_t.

Definition at line 224 of file buffers.hpp.

## relocate_to()

template<typename Datasizeable >

virtual void restinio::impl::datasizeable_buf_t< Datasizeable >::relocate_to | ( | void * | storage | ) |

inline override virtual

Move this buffer enitity to a given location.

Note
  storage must have a sufficient space and proper alignment.

Implements restinio::impl::writable_base_t.

Definition at line 231 of file buffers.hpp.

## size()

template<typename Datasizeable >

virtual std::size_t restinio::impl::datasizeable_buf_t< Datasizeable >::size | ( |  | ) | const

inline override virtual

Get the size of a writable piece of data.

Implements restinio::impl::writable_base_t.

Definition at line 243 of file buffers.hpp.

## Member Data Documentation

## m_custom_buffer

template<typename Datasizeable >

Datasizeable restinio::impl::datasizeable_buf_t< Datasizeable >::m_custom_buffer

private

A datasizeable item that represents buffer.

Definition at line 248 of file buffers.hpp.

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

- restinio/buffers.hpp