|
fastcgi++
A C++ FastCGI/Web API
|
Data structure to hold a block of raw data. More...
#include <fastcgi++/block.hpp>
Public Member Functions | |
| Block () | |
| Initialize an empty block. More... | |
| Block (const size_t size_) | |
| Initialize a block with equal size and reserve. More... | |
| Block (const char *const data, const size_t size_) | |
| Initialize a block with equal size and reserve from source data. More... | |
| void | assign (const char *const data, const size_t size_) |
| Assign a sequence a data to the block. More... | |
| Block (Block &&x) | |
| Steal the data from another block. More... | |
| Block & | operator= (Block &&x) |
| Steal the data from another block. More... | |
| size_t | reserve () const |
| See the reserve size. More... | |
| void | reserve (size_t x) |
| Set the reserve size. More... | |
| size_t | size () const |
| See the relevant data size. More... | |
| void | size (size_t x) |
| Set the relevant data size. More... | |
| char * | begin () |
| Pointer to the first element. More... | |
| const char * | begin () const |
| Constant pointer to the first element. More... | |
| char * | end () |
| Pointer to 1+ the last element. More... | |
| const char * | end () const |
| Constant pointer to 1+ the last element. More... | |
| void | clear () |
| Deallocate memory and set size and reserve to zero. More... | |
| Block (const Block &)=delete | |
| Block & | operator= (const Block &)=delete |
Private Attributes | |
| size_t | m_reserve |
| Total bytes allocated. More... | |
| size_t | m_size |
| Size of relevant part of data allocation. More... | |
| std::unique_ptr< char[]> | m_data |
| Point to allocated data. More... | |
Data structure to hold a block of raw data.
This is basically a stripped down std::vector. It contains a contiguous block of memory with two sizes associated with it. The reserve indicates how much data is actually allocated while the size tells us how much of the data is relevant. The motivation for this as opposed to a vector is that this lacks element initialization.
| Fastcgipp::Block::Block | ( | ) |
| Fastcgipp::Block::Block | ( | const size_t | size_ | ) |
| Fastcgipp::Block::Block | ( | const char *const | data, |
| const size_t | size_ | ||
| ) |
| Fastcgipp::Block::Block | ( | Block && | x | ) |
|
delete |
| void Fastcgipp::Block::assign | ( | const char *const | data, |
| const size_t | size_ | ||
| ) |
|
inline |
Pointer to the first element.
Definition at line 103 of file block.hpp.
Referenced by Fastcgipp::Request< charT >::complete(), Fastcgipp::FcgiStreambuf< charT, traits >::dump(), Fastcgipp::FcgiStreambuf< charT, traits >::emptyBuffer(), Fastcgipp::Request< charT >::handler(), Fastcgipp::Manager_base::localHandler(), and Fastcgipp::Transceiver::receive().
|
inline |
| void Fastcgipp::Block::clear | ( | ) |
|
inline |
Pointer to 1+ the last element.
Definition at line 115 of file block.hpp.
References m_size.
Referenced by Fastcgipp::FcgiStreambuf< charT, traits >::emptyBuffer(), Fastcgipp::Manager_base::localHandler(), and Fastcgipp::Transceiver::transmit().
|
inline |
| Fastcgipp::Block & Fastcgipp::Block::operator= | ( | Block && | x | ) |
|
inline |
See the reserve size.
Definition at line 80 of file block.hpp.
References m_reserve.
Referenced by Fastcgipp::FcgiStreambuf< charT, traits >::dump(), Fastcgipp::FcgiStreambuf< charT, traits >::emptyBuffer(), Fastcgipp::Transceiver::receive(), and size().
| void Fastcgipp::Block::reserve | ( | size_t | x | ) |
|
inline |
See the relevant data size.
Definition at line 94 of file block.hpp.
References m_size.
Referenced by Fastcgipp::FcgiStreambuf< charT, traits >::dump(), Fastcgipp::FcgiStreambuf< charT, traits >::emptyBuffer(), and Fastcgipp::Transceiver::receive().
| void Fastcgipp::Block::size | ( | size_t | x | ) |
|
private |
|
private |
|
private |
1.8.11