Loading...
Searching...
No Matches
restinio::impl::fixed_buffer_t Class Reference

Helper class for reading bytes and feeding them to parser. More...

`#include <fixed_buffer.hpp>`

## Public Member Functions

| fixed_buffer_t (const fixed_buffer_t &)=delete
fixed_buffer_t & | operator= (const fixed_buffer_t &)=delete
| fixed_buffer_t (fixed_buffer_t &&)=delete
fixed_buffer_t & | operator= (fixed_buffer_t &&)=delete
| fixed_buffer_t (std::size_t size)
auto | make_asio_buffer () noexcept
| Make asio buffer for reading bytes from socket.
void | obtained_bytes (std::size_t length) noexcept
| Mark how many bytes were obtained.
void | consumed_bytes (std::size_t length) noexcept
| Mark how many bytes were obtained.
std::size_t | length () const noexcept
| How many unconsumed bytes are there in buffer.
const char * | bytes () const noexcept
| Get pointer to unconsumed bytes.

## Private Attributes

std::vector< char > | m_buf
| Buffer for io operation.
std::size_t | m_ready_pos {0}
| unconsumed data left in buffer:Start of data in buffer.
std::size_t | m_ready_length {0}
| Data size.

## Detailed Description

Helper class for reading bytes and feeding them to parser.

Definition at line 26 of file fixed_buffer.hpp.

## Constructor & Destructor Documentation

## fixed_buffer_t() [1/3]

restinio::impl::fixed_buffer_t::fixed_buffer_t | ( | const fixed_buffer_t & |  | ) |

delete

## fixed_buffer_t() [2/3]

restinio::impl::fixed_buffer_t::fixed_buffer_t | ( | fixed_buffer_t && |  | ) |

delete

## fixed_buffer_t() [3/3]

restinio::impl::fixed_buffer_t::fixed_buffer_t | ( | std::size_t | size | ) |

inline explicit

Definition at line 34 of file fixed_buffer.hpp.

## Member Function Documentation

## bytes()

const char * restinio::impl::fixed_buffer_t::bytes | ( |  | ) | const

inline noexcept

Get pointer to unconsumed bytes.

Note
  To check that buffer has unconsumed bytes use length().

Definition at line 69 of file fixed_buffer.hpp.

## consumed_bytes()

void restinio::impl::fixed_buffer_t::consumed_bytes | ( | std::size_t | length | ) |

inline noexcept

Mark how many bytes were obtained.

Definition at line 56 of file fixed_buffer.hpp.

## length()

std::size_t restinio::impl::fixed_buffer_t::length | ( |  | ) | const

inline noexcept

How many unconsumed bytes are there in buffer.

Definition at line 63 of file fixed_buffer.hpp.

## make_asio_buffer()

auto restinio::impl::fixed_buffer_t::make_asio_buffer | ( |  | ) |

inline noexcept

Make asio buffer for reading bytes from socket.

Definition at line 41 of file fixed_buffer.hpp.

## obtained_bytes()

void restinio::impl::fixed_buffer_t::obtained_bytes | ( | std::size_t | length | ) |

inline noexcept

Mark how many bytes were obtained.

Definition at line 48 of file fixed_buffer.hpp.

## operator=() [1/2]

fixed_buffer_t & restinio::impl::fixed_buffer_t::operator= | ( | const fixed_buffer_t & |  | ) |

delete

## operator=() [2/2]

fixed_buffer_t & restinio::impl::fixed_buffer_t::operator= | ( | fixed_buffer_t && |  | ) |

delete

## Member Data Documentation

## m_buf

std::vector< char > restinio::impl::fixed_buffer_t::m_buf

private

Buffer for io operation.

Definition at line 73 of file fixed_buffer.hpp.

## m_ready_length

std::size_t restinio::impl::fixed_buffer_t::m_ready_length {0}

private

Data size.

Definition at line 81 of file fixed_buffer.hpp.

## m_ready_pos

std::size_t restinio::impl::fixed_buffer_t::m_ready_pos {0}

private

unconsumed data left in buffer:Start of data in buffer.

Definition at line 78 of file fixed_buffer.hpp.

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

- restinio/impl/fixed_buffer.hpp