22 #ifndef NDN_CXX_LP_DETAIL_FIELD_DECL_HPP 23 #define NDN_CXX_LP_DETAIL_FIELD_DECL_HPP 25 #include "../field.hpp" 28 #include "../../encoding/block-helpers.hpp" 29 #include "../../util/concepts.hpp" 30 #include <boost/concept/requires.hpp> 36 template<
typename TlvType,
typename T>
44 type.wireDecode(wire);
49 template<
typename TlvType>
59 template<
typename TlvType>
60 struct DecodeHelper<TlvType,
std::pair<Buffer::const_iterator, Buffer::const_iterator>>
62 static std::pair<Buffer::const_iterator, Buffer::const_iterator>
73 template<
typename encoding::Tag TAG,
typename TlvType,
typename T>
80 return value.wireEncode(encoder);
84 template<
typename encoding::Tag TAG,
typename TlvType>
94 template<
typename encoding::Tag TAG,
typename TlvType>
95 struct EncodeHelper<TAG, TlvType,
std::pair<Buffer::const_iterator, Buffer::const_iterator>>
101 length += encoder.prependRange(value.first, value.second);
102 length += encoder.prependVarNumber(length);
103 length += encoder.prependVarNumber(TlvType::value);
108 template<
typename LOCATION,
typename VALUE, u
int64_t TYPE,
bool REPEATABLE = false>
114 typedef std::integral_constant<uint64_t, TYPE>
TlvType;
124 if (wire.
type() != TlvType::value) {
135 template<
typename encoding::Tag TAG,
typename T>
147 #endif // NDN_CXX_LP_DETAIL_FIELD_DECL_HPP Copyright (c) 2011-2015 Regents of the University of California.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Helper to prepend TLV block type type containing non-negative integer value.
size_t value_size() const
static std::pair< Buffer::const_iterator, Buffer::const_iterator > decode(const Block &wire)
Class representing a wire element of NDN-TLV packet format.
std::integral_constant< uint64_t, TYPE > TlvType
static size_t encode(EncodingImpl< TAG > &encoder, const T &value)
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
Buffer::const_iterator value_begin() const
static size_t encode(EncodingImpl< TAG > &encoder, const T &value)
encodes a field and prepends to encoder its Block with top-level type TYPE
static uint64_t decode(const Block &wire)
Buffer::const_iterator value_end() const
static size_t encode(EncodingImpl< TAG > &encoder, const uint64_t value)
static size_t encode(EncodingImpl< TAG > &encoder, const std::pair< Buffer::const_iterator, Buffer::const_iterator > &value)
std::integral_constant< bool, REPEATABLE > IsRepeatable
std::string to_string(const V &v)
static T decode(const Block &wire)
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
static ValueType decode(const Block &wire)
decodes a field
represents an error in TLV encoding or decoding