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) noexcept
| Construct write group with a given bunch of writable items. More...
| ~write_group_t () noexcept
| 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 () noexcept
| 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_t & | operator= (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_t & | operator= (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. 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 691 of file buffers.hpp.

## Constructor & Destructor Documentation

## ◆ write_group_t() [1/3]

restinio::write_group_t::write_group_t | ( | writable_items_container_t | items | ) |
| inline explicit noexcept

Construct write group with a given bunch of writable items.

Parameters

  items | A buffer objects included in this group.

Definition at line 705 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 noexcept

Definition at line 724 of file buffers.hpp.

## ◆ ~write_group_t()

restinio::write_group_t::~write_group_t | ( |  | ) |
| inline noexcept

Destruct object.

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

Definition at line 746 of file buffers.hpp.

## Member Function Documentation

## ◆ after_write_notificator()

void restinio::write_group_t::after_write_notificator | ( | write_status_cb_t | notificator | ) |
| inline noexcept

Set after write notificator.

Definition at line 801 of file buffers.hpp.

## ◆ has_after_write_notificator()

bool restinio::write_group_t::has_after_write_notificator | ( |  | ) | const
| inline noexcept

Is there an after write notificator set?

Definition at line 808 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 815 of file buffers.hpp.

## ◆ items() [1/2]

const auto & restinio::write_group_t::items | ( |  | ) | const
| inline noexcept

Get access to the stored items.

Definition at line 839 of file buffers.hpp.

## ◆ items() [2/2]

auto & restinio::write_group_t::items | ( |  | ) |
| inline noexcept

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

## ◆ items_count()

auto restinio::write_group_t::items_count | ( |  | ) | const
| inline noexcept

Get the count of stored items.

Definition at line 832 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 881 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 noexcept

Definition at line 733 of file buffers.hpp.

## ◆ reset()

void restinio::write_group_t::reset | ( |  | ) |
| inline noexcept

Reset group.

Definition at line 859 of file buffers.hpp.

## ◆ status_line_size() [1/2]

std::size_t restinio::write_group_t::status_line_size | ( |  | ) | const
| inline noexcept

Get status line size.

Definition at line 794 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 763 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 696 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 906 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 896 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 903 of file buffers.hpp.

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

- restinio/buffers.hpp