RESTinio
Public Member Functions | Private Attributes | Friends | List of all members
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)
 Construct write group with a given bunch of writable items. More...
 
 ~write_group_t ()
 Destruct object. More...
 
auto items_count () const noexcept
 Get the count of stored items. More...
 
const auto & items () const noexcept
 Get access to the stored items. More...
 
auto & items () noexcept
 Get access to the stored items. More...
 
void reset ()
 Reset group. More...
 
void merge (write_group_t second)
 Merges with another group. More...
 
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)
 
write_group_toperator= (write_group_t &&wg)
 
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. More...
 
void after_write_notificator (write_status_cb_t notificator) noexcept
 Set after write notificator. More...
 
bool has_after_write_notificator () const noexcept
 Is there an after write notificator set? More...
 
void invoke_after_write_notificator_if_exists (const asio_ns::error_code &ec)
 Get after write notificator. More...
 

Private Attributes

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

Friends

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

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 661 of file buffers.hpp.

Constructor & Destructor Documentation

◆ write_group_t() [1/3]

restinio::write_group_t::write_group_t ( writable_items_container_t  items)
inlineexplicit

Construct write group with a given bunch of writable items.

Parameters
itemsA buffer objects included in this group.

Definition at line 675 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)
inline

Definition at line 694 of file buffers.hpp.

◆ ~write_group_t()

restinio::write_group_t::~write_group_t ( )
inline

Destruct object.

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

Definition at line 716 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 774 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 781 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 788 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 812 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 825 of file buffers.hpp.

◆ items_count()

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

Get the count of stored items.

Definition at line 805 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 845 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)
inline

Definition at line 703 of file buffers.hpp.

◆ reset()

void restinio::write_group_t::reset ( )
inline

Reset group.

Definition at line 832 of file buffers.hpp.

◆ status_line_size() [1/2]

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

Definition at line 736 of file buffers.hpp.

◆ status_line_size() [2/2]

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

Get status line size.

Definition at line 767 of file buffers.hpp.

Friends And Related Function Documentation

◆ swap

void swap ( write_group_t left,
write_group_t right 
)
friend

Swap two groups.

Definition at line 666 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 870 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 860 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 867 of file buffers.hpp.


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