Data Structures | |
class | DataBlockFast |
Helper class template to create a data block when RandomAccessIterator is used. More... | |
class | DataBlockSlow |
Helper class template to create a data block when generic InputIterator is used. More... | |
class | Encoder |
Helper class to perform TLV encoding Interface of this class (mostly) matches interface of Estimator class. More... | |
class | EncodingImpl |
class | EncodingImpl< EncoderTag > |
EncodingImpl specialization for real TLV encoding. More... | |
class | EncodingImpl< EstimatorTag > |
EncodingImpl specialization TLV size estimation. More... | |
class | Estimator |
Helper class to estimate size of TLV encoding Interface of this class (mostly) matches interface of Encoder class. More... | |
Typedefs | |
typedef bool | Tag |
typedef EncodingImpl< EncoderTag > | EncodingBuffer |
typedef EncodingImpl< EstimatorTag > | EncodingEstimator |
Functions | |
template<Tag TAG> | |
size_t | prependNonNegativeIntegerBlock (EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value) |
Helper to prepend TLV block type type containing non-negative integer value . More... | |
template size_t | prependNonNegativeIntegerBlock< EstimatorTag > (EncodingImpl< EstimatorTag > &encoder, uint32_t type, uint64_t value) |
template size_t | prependNonNegativeIntegerBlock< EncoderTag > (EncodingImpl< EncoderTag > &encoder, uint32_t type, uint64_t value) |
Block | makeNonNegativeIntegerBlock (uint32_t type, uint64_t value) |
Create a TLV block type type containing non-negative integer value . More... | |
uint64_t | readNonNegativeInteger (const Block &block) |
Helper to read a non-negative integer from a block. More... | |
template<Tag TAG> | |
size_t | prependEmptyBlock (EncodingImpl< TAG > &encoder, uint32_t type) |
Helper to prepend TLV block type type containing no value (i.e., a boolean block) More... | |
template size_t | prependEmptyBlock< EstimatorTag > (EncodingImpl< EstimatorTag > &encoder, uint32_t type) |
template size_t | prependEmptyBlock< EncoderTag > (EncodingImpl< EncoderTag > &encoder, uint32_t type) |
Block | makeEmptyBlock (uint32_t type) |
Create a TLV block type type containing no value (i.e., a boolean block) More... | |
template<Tag TAG> | |
size_t | prependStringBlock (EncodingImpl< TAG > &encoder, uint32_t type, const std::string &value) |
Helper to prepend TLV block type type with value from a string value . More... | |
template size_t | prependStringBlock< EstimatorTag > (EncodingImpl< EstimatorTag > &encoder, uint32_t type, const std::string &value) |
template size_t | prependStringBlock< EncoderTag > (EncodingImpl< EncoderTag > &encoder, uint32_t type, const std::string &value) |
Block | makeStringBlock (uint32_t type, const std::string &value) |
Create a TLV block type type with value from a string value . More... | |
std::string | readString (const Block &block) |
Helper to read a string value from a block. More... | |
Block | makeBinaryBlock (uint32_t type, const uint8_t *value, size_t length) |
Create a TLV block type type with value from a buffer value of size length . More... | |
Block | makeBinaryBlock (uint32_t type, const char *value, size_t length) |
Create a TLV block type type with value from a buffer value of size length . More... | |
template<class Iterator > | |
Block | makeBinaryBlock (uint32_t type, Iterator first, Iterator last) |
Free function to create a block given type and range [first , last ) of bytes. More... | |
template<Tag TAG, class U > | |
size_t | prependNestedBlock (EncodingImpl< TAG > &encoder, uint32_t type, const U &value) |
Prepend a TLV block of type type with WireEncodable value as a value. More... | |
template<class U > | |
Block | makeNestedBlock (uint32_t type, const U &value) |
Create a TLV block of type type with WireEncodable value as a value. More... | |
Variables | |
static const Tag | EncoderTag = true |
Tag for EncodingImpl to indicate that Encoder is requested Implementation of the tag may change to class. More... | |
static const Tag | EstimatorTag = false |
Tag for EncodingImpl to indicate that Estimator is requested Implementation of the tag may change to class. More... | |
Definition at line 45 of file encoding-buffer-fwd.hpp.
Definition at line 48 of file encoding-buffer-fwd.hpp.
typedef bool ndn::encoding::Tag |
Definition at line 28 of file encoding-buffer-fwd.hpp.
Block ndn::encoding::makeBinaryBlock | ( | uint32_t | type, |
const uint8_t * | value, | ||
size_t | length | ||
) |
Create a TLV block type type
with value from a buffer value
of size length
.
Definition at line 143 of file block-helpers.cpp.
Block ndn::encoding::makeBinaryBlock | ( | uint32_t | type, |
const char * | value, | ||
size_t | length | ||
) |
Create a TLV block type type
with value from a buffer value
of size length
.
Definition at line 155 of file block-helpers.cpp.
|
inline |
Free function to create a block given type
and range [first
, last
) of bytes.
Iterator | iterator type satisfying at least InputIterator concept. Implementation is more optimal when the iterator type satisfies RandomAccessIterator concept It is required that sizeof(std::iterator_traits<Iterator>::value_type) == 1. |
Definition at line 170 of file block-helpers.hpp.
Block ndn::encoding::makeEmptyBlock | ( | uint32_t | type | ) |
Create a TLV block type type
containing no value (i.e., a boolean block)
Definition at line 87 of file block-helpers.cpp.
|
inline |
Create a TLV block of type type
with WireEncodable value
as a value.
U | type that satisfies WireEncodableWithEncodingBuffer concept |
Definition at line 212 of file block-helpers.hpp.
Block ndn::encoding::makeNonNegativeIntegerBlock | ( | uint32_t | type, |
uint64_t | value | ||
) |
Create a TLV block type type
containing non-negative integer value
.
Definition at line 49 of file block-helpers.cpp.
Block ndn::encoding::makeStringBlock | ( | uint32_t | type, |
const std::string & | value | ||
) |
Create a TLV block type type
with value from a string value
.
Definition at line 123 of file block-helpers.cpp.
size_t ndn::encoding::prependEmptyBlock | ( | EncodingImpl< TAG > & | encoder, |
uint32_t | type | ||
) |
Helper to prepend TLV block type type
containing no value (i.e., a boolean block)
Definition at line 71 of file block-helpers.cpp.
template size_t ndn::encoding::prependEmptyBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type | ||
) |
template size_t ndn::encoding::prependEmptyBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type | ||
) |
|
inline |
Prepend a TLV block of type type
with WireEncodable value
as a value.
U | type that satisfies WireEncodableWithEncodingBuffer concept |
Definition at line 193 of file block-helpers.hpp.
size_t ndn::encoding::prependNonNegativeIntegerBlock | ( | EncodingImpl< TAG > & | encoder, |
uint32_t | type, | ||
uint64_t | value | ||
) |
Helper to prepend TLV block type type
containing non-negative integer value
.
Definition at line 29 of file block-helpers.cpp.
template size_t ndn::encoding::prependNonNegativeIntegerBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type, | ||
uint64_t | value | ||
) |
template size_t ndn::encoding::prependNonNegativeIntegerBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type, | ||
uint64_t | value | ||
) |
size_t ndn::encoding::prependStringBlock | ( | EncodingImpl< TAG > & | encoder, |
uint32_t | type, | ||
const std::string & | value | ||
) |
Helper to prepend TLV block type type
with value from a string value
.
Definition at line 102 of file block-helpers.cpp.
template size_t ndn::encoding::prependStringBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type, | ||
const std::string & | value | ||
) |
template size_t ndn::encoding::prependStringBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type, | ||
const std::string & | value | ||
) |
uint64_t ndn::encoding::readNonNegativeInteger | ( | const Block & | block | ) |
Helper to read a non-negative integer from a block.
tlv::Error | if block does not contain a valid nonNegativeInteger |
Definition at line 61 of file block-helpers.cpp.
std::string ndn::encoding::readString | ( | const Block & | block | ) |
Helper to read a string value from a block.
Definition at line 135 of file block-helpers.cpp.
|
static |
Tag for EncodingImpl to indicate that Encoder is requested Implementation of the tag may change to class.
Use of true directly as a template parameter is discouraged.
Definition at line 35 of file encoding-buffer-fwd.hpp.
|
static |
Tag for EncodingImpl to indicate that Estimator is requested Implementation of the tag may change to class.
Use of false directly as a template parameter is discouraged.
Definition at line 42 of file encoding-buffer-fwd.hpp.