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_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.
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 728 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 742 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 761 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 783 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 838 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 845 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 852 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 876 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 889 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 869 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 918 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 770 of file buffers.hpp.

## reset()

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

inline noexcept

Reset group.

Definition at line 896 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 831 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 800 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 733 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 943 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 933 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 940 of file buffers.hpp.

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

- restinio/buffers.hpp