EncodingImpl specialization for actual TLV encoding. More...
#include <ndn-cxx/encoding/encoding-buffer.hpp>
Public Types | |
using | const_iterator = Buffer::const_iterator |
using | iterator = Buffer::iterator |
using | value_type = Buffer::value_type |
Public Member Functions | |
EncodingImpl (const Block &block) | |
EncodingImpl (size_t totalReserve=MAX_NDN_PACKET_SIZE, size_t reserveFromBack=400) | |
size_t | appendBytes (span< const uint8_t > bytes) |
Append a sequence of bytes. More... | |
size_t | appendNonNegativeInteger (uint64_t integer) |
Append integer encoded as a NonNegativeInteger in NDN-TLV format. More... | |
template<class Iterator > | |
size_t | appendRange (Iterator first, Iterator last) |
Append range of bytes from the range [first , last ) More... | |
size_t | appendVarNumber (uint64_t number) |
Append number encoded as a VAR-NUMBER in NDN-TLV format. More... | |
const_iterator | begin () const noexcept |
Returns an iterator pointing to the first byte of the encoded buffer. More... | |
iterator | begin () noexcept |
Returns an iterator pointing to the first byte of the encoded buffer. More... | |
Block | block (bool verifyLength=true) const |
Create Block from the underlying buffer. More... | |
size_t | capacity () const noexcept |
Get size of the underlying buffer. More... | |
const uint8_t * | data () const noexcept |
Returns a pointer to the first byte of the encoded buffer. More... | |
uint8_t * | data () noexcept |
Returns a pointer to the first byte of the encoded buffer. More... | |
const_iterator | end () const noexcept |
Returns an iterator pointing to the past-the-end byte of the encoded buffer. More... | |
iterator | end () noexcept |
Returns an iterator pointing to the past-the-end byte of the encoded buffer. More... | |
shared_ptr< Buffer > | getBuffer () const noexcept |
Get underlying buffer. More... | |
size_t | prependBytes (span< const uint8_t > bytes) |
Prepend a sequence of bytes. More... | |
size_t | prependNonNegativeInteger (uint64_t integer) |
Prepend integer encoded as a NonNegativeInteger in NDN-TLV format. More... | |
template<class Iterator > | |
size_t | prependRange (Iterator first, Iterator last) |
Prepend range of bytes from the range [first , last ) More... | |
size_t | prependVarNumber (uint64_t number) |
Prepend number encoded as a VAR-NUMBER in NDN-TLV format. More... | |
void | reserve (size_t size, bool addInFront) |
Reserve size bytes for the underlying buffer. More... | |
void | reserveBack (size_t size) |
Reserve at least size bytes at the back of the underlying buffer. More... | |
void | reserveFront (size_t size) |
Reserve at least isze bytes at the beginning of the underlying buffer. More... | |
size_t | size () const noexcept |
Returns the size of the encoded buffer. More... | |
EncodingImpl specialization for actual TLV encoding.
Definition at line 36 of file encoding-buffer.hpp.
|
inherited |
Definition at line 97 of file encoder.hpp.
|
inherited |
Definition at line 96 of file encoder.hpp.
|
inherited |
Definition at line 95 of file encoder.hpp.
|
inlineexplicit |
Definition at line 40 of file encoding-buffer.hpp.
|
inlineexplicit |
Definition at line 46 of file encoding-buffer.hpp.
|
inherited |
Append a sequence of bytes.
Definition at line 104 of file encoder.cpp.
|
inherited |
Append integer
encoded as a NonNegativeInteger in NDN-TLV format.
Definition at line 184 of file encoder.cpp.
|
inherited |
Append range of bytes from the range [first
, last
)
Definition at line 266 of file encoder.hpp.
|
inherited |
Append number
encoded as a VAR-NUMBER in NDN-TLV format.
Definition at line 137 of file encoder.cpp.
|
inlinenoexceptinherited |
Returns an iterator pointing to the first byte of the encoded buffer.
Definition at line 180 of file encoder.hpp.
|
inlinenoexceptinherited |
Returns an iterator pointing to the first byte of the encoded buffer.
Definition at line 171 of file encoder.hpp.
|
inherited |
Create Block from the underlying buffer.
verifyLength | If this parameter set to true, Block's constructor will be requested to verify consistency of the encoded length in the Block, otherwise ignored |
Definition at line 59 of file encoder.cpp.
|
inlinenoexceptinherited |
Get size of the underlying buffer.
Definition at line 152 of file encoder.hpp.
|
inlinenoexceptinherited |
Returns a pointer to the first byte of the encoded buffer.
Definition at line 216 of file encoder.hpp.
|
inlinenoexceptinherited |
Returns a pointer to the first byte of the encoded buffer.
Definition at line 207 of file encoder.hpp.
|
inlinenoexceptinherited |
Returns an iterator pointing to the past-the-end byte of the encoded buffer.
Definition at line 198 of file encoder.hpp.
|
inlinenoexceptinherited |
Returns an iterator pointing to the past-the-end byte of the encoded buffer.
Definition at line 189 of file encoder.hpp.
|
inlinenoexceptinherited |
Get underlying buffer.
Definition at line 161 of file encoder.hpp.
|
inherited |
Prepend a sequence of bytes.
Definition at line 98 of file encoder.cpp.
|
inherited |
Prepend integer
encoded as a NonNegativeInteger in NDN-TLV format.
Definition at line 164 of file encoder.cpp.
|
inherited |
Prepend range of bytes from the range [first
, last
)
Definition at line 251 of file encoder.hpp.
|
inherited |
Prepend number
encoded as a VAR-NUMBER in NDN-TLV format.
Definition at line 110 of file encoder.cpp.
|
inherited |
Reserve size
bytes for the underlying buffer.
size | amount of bytes to reserve in the underlying buffer |
addInFront | if true, then size bytes will be available in front (i.e., subsequent call to prepend* will not need to allocate memory). If false, then reservation will be done at the end of the buffer (i.d., for subsequent append* calls) |
Definition at line 65 of file encoder.cpp.
|
inherited |
Reserve at least size
bytes at the back of the underlying buffer.
Definition at line 45 of file encoder.cpp.
|
inherited |
Reserve at least isze
bytes at the beginning of the underlying buffer.
Definition at line 52 of file encoder.cpp.
|
inlinenoexceptinherited |
Returns the size of the encoded buffer.
Definition at line 225 of file encoder.hpp.