![]() |
Project
|
#include <PayLoadCont.h>
Public Member Functions | |
| PayLoadCont ()=default | |
| PayLoadCont (size_t sz) | |
| ~PayLoadCont ()=default | |
| PayLoadCont (const PayLoadCont &src) | |
| PayLoadCont & | operator= (const PayLoadCont &src) |
| const uint8_t * | data () const |
| increase the buffer size | |
| void | expand (size_t sz) |
| bool | isEmpty () const |
| make buffer empty w/o deallocating it | |
| void | clear () |
| get unused size | |
| size_t | getUnusedSize () const |
| get filled size | |
| size_t | getSize () const |
| get offset of the current ptr from the head | |
| size_t | getOffset () const |
| booked capacity | |
| size_t | getCapacity () const |
| number of bytes still can accept w/o expanding the buffer | |
| size_t | getFreeCapacity () const |
| make sure buffer may accept at least n bytes | |
| void | ensureFreeCapacity (size_t n) |
| fill n bytes with given symbol w/o checking for the size | |
| void | fillFast (const uint8_t c, size_t n) |
| add n bytes to the buffer w/o checking for the size | |
| void | addFast (const uint8_t *ptr, size_t n) |
| add new byte to the buffer w/o checking for the size | |
| void | addFast (uint8_t val) |
| add new short to the buffer w/o checking for the size | |
| void | addFast (uint16_t val) |
| erase n bytes w/o checking for the underflow | |
| void | eraseFast (size_t n) |
| erase n bytes | |
| void | erase (size_t n) |
| fill n bytes with given symbol | |
| void | fill (const uint8_t c, size_t n) |
| add n bytes to the buffer, expand if needed. no check for overlap | |
| void | add (const uint8_t *ptr, size_t n) |
| add new byte to the buffer | |
| void | add (uint8_t val) |
| add new short to the buffer | |
| void | add (uint16_t val) |
| shrink buffer to requested size, no check on over/under flow | |
| void | shrinkToSize (size_t sz) |
| direct const access to value at a given slot, w/o checking for overflow | |
| uint8_t | operator[] (size_t i) const |
| direct access to value at a given slot, w/o checking for overflow | |
| uint8_t & | operator[] (size_t i) |
| read current character value from buffer w/o stepping forward | |
| bool | current (uint8_t &v) const |
| read character value from buffer | |
| bool | next (uint8_t &v) |
| read short value from buffer | |
| bool | next (uint16_t &v) |
| move current pointer to the head | |
| void | rewind () |
| move all data between the mPtr and mEnd to the head of the buffer | |
| void | moveUnusedToHead () |
| move unused data to the head and upload new chunk of data | |
| size_t | append (std::function< size_t(uint8_t *, size_t)> getNext) |
| uint8_t * | getPtr () |
| direct write access | |
| void | setPtr (uint8_t *ptr) |
| uint8_t * | getEnd () |
| void | setEnd (uint8_t *ptr) |
Static Public Attributes | |
| static constexpr size_t | MinCapacity = 16 |
| allocate buffer | |
Definition at line 29 of file PayLoadCont.h.
|
default |
|
inline |
Definition at line 39 of file PayLoadCont.h.
|
default |
| PayLoadCont::PayLoadCont | ( | const PayLoadCont & | src | ) |
Definition at line 21 of file PayLoadCont.cxx.
add new byte to the buffer
Definition at line 128 of file PayLoadCont.h.
shrink buffer to requested size, no check on over/under flow
Definition at line 142 of file PayLoadCont.h.
add new short to the buffer
Definition at line 135 of file PayLoadCont.h.
add new byte to the buffer w/o checking for the size
Definition at line 91 of file PayLoadCont.h.
erase n bytes w/o checking for the underflow
Definition at line 101 of file PayLoadCont.h.
add new short to the buffer w/o checking for the size
Definition at line 98 of file PayLoadCont.h.
|
inline |
Definition at line 209 of file PayLoadCont.h.
|
inline |
get unused size
Definition at line 54 of file PayLoadCont.h.
read character value from buffer
Definition at line 161 of file PayLoadCont.h.
|
inline |
increase the buffer size
Definition at line 46 of file PayLoadCont.h.
|
inline |
fill n bytes with given symbol w/o checking for the size
Definition at line 76 of file PayLoadCont.h.
|
inline |
fill n bytes with given symbol
Definition at line 111 of file PayLoadCont.h.
|
inline |
erase n bytes
Definition at line 108 of file PayLoadCont.h.
| void PayLoadCont::expand | ( | size_t | sz | ) |
< increase the buffer size
Definition at line 46 of file PayLoadCont.cxx.
add n bytes to the buffer, expand if needed. no check for overlap
Definition at line 121 of file PayLoadCont.h.
add n bytes to the buffer w/o checking for the size
Definition at line 84 of file PayLoadCont.h.
|
inline |
number of bytes still can accept w/o expanding the buffer
Definition at line 70 of file PayLoadCont.h.
|
inline |
Definition at line 221 of file PayLoadCont.h.
|
inline |
make sure buffer may accept at least n bytes
Definition at line 73 of file PayLoadCont.h.
|
inline |
booked capacity
Definition at line 67 of file PayLoadCont.h.
|
inline |
direct write access
Definition at line 218 of file PayLoadCont.h.
|
inline |
get offset of the current ptr from the head
Definition at line 64 of file PayLoadCont.h.
|
inline |
get filled size
Definition at line 61 of file PayLoadCont.h.
|
inline |
make buffer empty w/o deallocating it
Definition at line 51 of file PayLoadCont.h.
|
inline |
move unused data to the head and upload new chunk of data
Definition at line 195 of file PayLoadCont.h.
move current pointer to the head
Definition at line 181 of file PayLoadCont.h.
read short value from buffer
Definition at line 171 of file PayLoadCont.h.
| PayLoadCont & PayLoadCont::operator= | ( | const PayLoadCont & | src | ) |
Definition at line 32 of file PayLoadCont.cxx.
|
inline |
read current character value from buffer w/o stepping forward
Definition at line 158 of file PayLoadCont.h.
|
inline |
direct access to value at a given slot, w/o checking for overflow
Definition at line 155 of file PayLoadCont.h.
|
inline |
move all data between the mPtr and mEnd to the head of the buffer
Definition at line 192 of file PayLoadCont.h.
Definition at line 222 of file PayLoadCont.h.
Definition at line 219 of file PayLoadCont.h.
|
inline |
direct const access to value at a given slot, w/o checking for overflow
Definition at line 149 of file PayLoadCont.h.
|
staticconstexpr |
allocate buffer
Definition at line 35 of file PayLoadCont.h.