RESTinio
Loading...
Searching...
No Matches
restinio::write_group_t Class Reference

Group of writable items transported to the context of underlying connection as one solid piece. More...

#include <buffers.hpp>

Public Member Functions

 write_group_t (writable_items_container_t items) noexcept
 Construct write group with a given bunch of writable items.
 ~write_group_t () noexcept
 Destruct object.
auto items_count () const noexcept
 Get the count of stored items.
const auto & items () const noexcept
 Get access to the stored items.
auto & items () noexcept
 Get access to the stored items.
void reset () noexcept
 Reset group.
void merge (write_group_t second)
 Merges with another group.
Copy semantics.

Not allowed.

 write_group_t (const write_group_t &)=delete
write_group_toperator= (const write_group_t &)=delete
Move semantics.

Moves object leaving a moved one in clean state.

 write_group_t (write_group_t &&wg) noexcept
write_group_toperator= (write_group_t &&wg) noexcept
Auxiliary data.

Accessors for working with auxiliary data.

void status_line_size (std::size_t n)
std::size_t status_line_size () const noexcept
 Get status line size.
void after_write_notificator (write_status_cb_t notificator) noexcept
 Set after write notificator.
bool has_after_write_notificator () const noexcept
 Is there an after write notificator set?
void invoke_after_write_notificator_if_exists (const asio_ns::error_code &ec)
 Get after write notificator.

Private Attributes

writable_items_container_t m_items
 A buffer objects included in this group.
std::size_t m_status_line_size
 A size of status line located in first "buffer".
write_status_cb_t m_after_write_notificator
 A callback to invoke once the the write opertaion of a given group completes.

Friends

void swap (write_group_t &left, write_group_t &right) noexcept
 Swap two groups.

Detailed Description

Group of writable items transported to the context of underlying connection as one solid piece.

Since
v.0.4.8

Definition at line 726 of file buffers.hpp.

Constructor & Destructor Documentation

◆ write_group_t() [1/3]

restinio::write_group_t::write_group_t ( writable_items_container_t items)
inlineexplicitnoexcept

Construct write group with a given bunch of writable items.

Parameters
itemsA buffer objects included in this group.

Definition at line 740 of file buffers.hpp.

◆ write_group_t() [2/3]

restinio::write_group_t::write_group_t ( const write_group_t & )
delete

◆ write_group_t() [3/3]

restinio::write_group_t::write_group_t ( write_group_t && wg)
inlinenoexcept

Definition at line 759 of file buffers.hpp.

◆ ~write_group_t()

restinio::write_group_t::~write_group_t ( )
inlinenoexcept

Destruct object.

If notificator was not called it would be invoked with error.

Definition at line 781 of file buffers.hpp.

Member Function Documentation

◆ after_write_notificator()

void restinio::write_group_t::after_write_notificator ( write_status_cb_t notificator)
inlinenoexcept

Set after write notificator.

Definition at line 836 of file buffers.hpp.

◆ has_after_write_notificator()

bool restinio::write_group_t::has_after_write_notificator ( ) const
inlinenoexcept

Is there an after write notificator set?

Definition at line 843 of file buffers.hpp.

◆ invoke_after_write_notificator_if_exists()

void restinio::write_group_t::invoke_after_write_notificator_if_exists ( const asio_ns::error_code & ec)
inline

Get after write notificator.

Definition at line 850 of file buffers.hpp.

◆ items() [1/2]

const auto & restinio::write_group_t::items ( ) const
inlinenoexcept

Get access to the stored items.

Definition at line 874 of file buffers.hpp.

◆ items() [2/2]

auto & restinio::write_group_t::items ( )
inlinenoexcept

Get access to the stored items.

Should be used for cases where we should have a non-const access to writeable items.

Since
v.0.4.9

Definition at line 887 of file buffers.hpp.

◆ items_count()

auto restinio::write_group_t::items_count ( ) const
inlinenoexcept

Get the count of stored items.

Definition at line 867 of file buffers.hpp.

◆ merge()

void restinio::write_group_t::merge ( write_group_t second)
inline

Merges with another group.

Two groups can be merged if the first one has no after-write callback and the second one has no status line size.

Definition at line 916 of file buffers.hpp.

◆ operator=() [1/2]

write_group_t & restinio::write_group_t::operator= ( const write_group_t & )
delete

◆ operator=() [2/2]

write_group_t & restinio::write_group_t::operator= ( write_group_t && wg)
inlinenoexcept

Definition at line 768 of file buffers.hpp.

◆ reset()

void restinio::write_group_t::reset ( )
inlinenoexcept

Reset group.

Definition at line 894 of file buffers.hpp.

◆ status_line_size() [1/2]

std::size_t restinio::write_group_t::status_line_size ( ) const
inlinenoexcept

Get status line size.

Definition at line 829 of file buffers.hpp.

◆ status_line_size() [2/2]

void restinio::write_group_t::status_line_size ( std::size_t n)
inline

Definition at line 798 of file buffers.hpp.

◆ swap

void swap ( write_group_t & left,
write_group_t & right )
friend

Swap two groups.

Definition at line 731 of file buffers.hpp.

Member Data Documentation

◆ m_after_write_notificator

write_status_cb_t restinio::write_group_t::m_after_write_notificator
private

A callback to invoke once the the write opertaion of a given group completes.

Definition at line 941 of file buffers.hpp.

◆ m_items

writable_items_container_t restinio::write_group_t::m_items
private

A buffer objects included in this group.

Definition at line 931 of file buffers.hpp.

◆ m_status_line_size

std::size_t restinio::write_group_t::m_status_line_size
private

A size of status line located in first "buffer".

If the value is not 0 then it means it references a piece of data stored in the first buffer of m_items container.

Definition at line 938 of file buffers.hpp.


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