Classes | |
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... | |
typedef bool ndn::encoding::Tag |
Definition at line 28 of file encoding-buffer-fwd.hpp.
Definition at line 45 of file encoding-buffer-fwd.hpp.
Definition at line 48 of file encoding-buffer-fwd.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.
References prependNonNegativeIntegerBlock< EncoderTag >(), and prependNonNegativeIntegerBlock< EstimatorTag >().
Referenced by ndn::lp::detail::EncodeHelper< TAG, TlvType, uint64_t >::encode(), ndn::Link::encodeContent(), makeNonNegativeIntegerBlock(), ndn::nfd::FaceStatus::wireEncode(), ndn::nfd::FaceEventNotification::wireEncode(), ndn::nfd::FaceQueryFilter::wireEncode(), ndn::nfd::ForwarderStatus::wireEncode(), ndn::lp::NackHeader::wireEncode(), ndn::Selectors::wireEncode(), ndn::nfd::NextHopRecord::wireEncode(), ndn::lp::CachePolicy::wireEncode(), ndn::MetaInfo::wireEncode(), ndn::Interest::wireEncode(), ndn::nfd::ControlParameters::wireEncode(), ndn::SignatureInfo::wireEncode(), and ndn::nfd::Route::wireEncode().
template size_t ndn::encoding::prependNonNegativeIntegerBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type, | ||
uint64_t | value | ||
) |
Referenced by prependNonNegativeIntegerBlock().
template size_t ndn::encoding::prependNonNegativeIntegerBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type, | ||
uint64_t | value | ||
) |
Referenced by prependNonNegativeIntegerBlock().
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.
References ndn::encoding::Encoder::block(), and prependNonNegativeIntegerBlock().
Referenced by ndn::name::Component::fromNumber(), makeNestedBlock(), ns3::ndn::Producer::OnInterest(), and ndn::mgmt::ControlResponse::wireEncode().
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.
References ndn::tlv::readNonNegativeInteger(), ndn::Block::value_begin(), ndn::Block::value_end(), and ndn::Block::value_size().
Referenced by ndn::lp::detail::DecodeHelper< TlvType, uint64_t >::decode(), ndn::Link::decodeContent(), ndn::Link::getDelegationFromWire(), ndn::Interest::getNonce(), makeNestedBlock(), ndn::name::Component::toNumber(), ndn::nfd::FaceStatus::wireDecode(), ndn::lp::NackHeader::wireDecode(), ndn::nfd::FaceEventNotification::wireDecode(), ndn::nfd::FaceQueryFilter::wireDecode(), ndn::mgmt::ControlResponse::wireDecode(), ndn::nfd::ForwarderStatus::wireDecode(), ndn::Selectors::wireDecode(), ndn::nfd::NextHopRecord::wireDecode(), ndn::MetaInfo::wireDecode(), ndn::lp::CachePolicy::wireDecode(), ndn::Interest::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), ndn::SignatureInfo::wireDecode(), and ndn::nfd::Route::wireDecode().
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.
References prependEmptyBlock< EncoderTag >(), and prependEmptyBlock< EstimatorTag >().
Referenced by makeEmptyBlock(), ndn::Selectors::wireEncode(), and ndn::Exclude::wireEncode().
template size_t ndn::encoding::prependEmptyBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type | ||
) |
Referenced by prependEmptyBlock().
template size_t ndn::encoding::prependEmptyBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type | ||
) |
Referenced by prependEmptyBlock().
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.
References ndn::encoding::Encoder::block(), and prependEmptyBlock().
Referenced by ndn::Block::fromStream(), ndn::Data::getContent(), and makeNestedBlock().
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.
References prependStringBlock< EncoderTag >(), and prependStringBlock< EstimatorTag >().
Referenced by makeStringBlock(), ndn::security::v2::AdditionalDescription::wireEncode(), and ndn::security::ValidityPeriod::wireEncode().
template size_t ndn::encoding::prependStringBlock< EstimatorTag > | ( | EncodingImpl< EstimatorTag > & | encoder, |
uint32_t | type, | ||
const std::string & | value | ||
) |
Referenced by prependStringBlock().
template size_t ndn::encoding::prependStringBlock< EncoderTag > | ( | EncodingImpl< EncoderTag > & | encoder, |
uint32_t | type, | ||
const std::string & | value | ||
) |
Referenced by prependStringBlock().
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.
References ndn::encoding::Encoder::block(), and prependStringBlock().
Referenced by makeNestedBlock().
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.
References ndn::Block::value(), and ndn::Block::value_size().
Referenced by makeNestedBlock(), ndn::security::v2::AdditionalDescription::wireDecode(), and ndn::security::ValidityPeriod::wireDecode().
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.
References ndn::encoding::Encoder::block(), ndn::encoding::Estimator::prependByteArrayBlock(), and ndn::encoding::Encoder::prependByteArrayBlock().
Referenced by ndn::mgmt::StatusDatasetContext::append(), ndn::mgmt::StatusDatasetContext::end(), ndn::name::Component::fromImplicitSha256Digest(), ndn::Block::fromStream(), makeBinaryBlock(), makeNestedBlock(), ndn::Data::setContent(), ndn::KeyLocator::setKeyDigest(), ndn::Interest::setNonce(), and ndn::mgmt::ControlResponse::wireEncode().
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.
References makeBinaryBlock().
|
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.
|
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.
Referenced by makeNestedBlock(), ndn::nfd::StrategyChoice::wireEncode(), ndn::MetaInfo::wireEncode(), and ndn::nfd::ControlParameters::wireEncode().
|
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.
References ndn::encoding::Encoder::block(), makeBinaryBlock(), makeEmptyBlock(), makeNonNegativeIntegerBlock(), makeStringBlock(), prependNestedBlock(), readNonNegativeInteger(), and readString().
|
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.