Declare a field. More...
#include <field-decl.hpp>
Public Types | |
typedef LOCATION | FieldLocation |
typedef VALUE | ValueType |
typedef std::integral_constant< uint64_t, TYPE > | TlvType |
typedef std::integral_constant< bool, REPEATABLE > | IsRepeatable |
Static Public Member Functions | |
static ValueType | decode (const Block &wire) |
Decode a field. More... | |
template<typename encoding::Tag TAG> | |
static size_t | encode (EncodingImpl< TAG > &encoder, const ValueType &value) |
Encode a field and prepend to encoder . More... | |
Declare a field.
LOCATION | a tag that indicates where the field is in an LpPacket. |
VALUE | type of field value. |
TYPE | TLV-TYPE number of the field. |
REPEATABLE | whether the field is repeatable. |
DECODER_TAG | selects a specialization of DecodeHelper. |
ENCODER_TAG | selects a specialization of EncodeHelper. |
Definition at line 176 of file field-decl.hpp.
typedef LOCATION ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::FieldLocation |
Definition at line 179 of file field-decl.hpp.
typedef VALUE ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::ValueType |
Definition at line 180 of file field-decl.hpp.
typedef std::integral_constant<uint64_t, TYPE> ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::TlvType |
Definition at line 181 of file field-decl.hpp.
typedef std::integral_constant<bool, REPEATABLE> ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::IsRepeatable |
Definition at line 182 of file field-decl.hpp.
|
inlinestatic |
Decode a field.
wire | an element with top-level TLV-TYPE TlvType::value . |
ndn::tlv::Error | decode failure. |
Definition at line 190 of file field-decl.hpp.
References ndn::lp::DecodeHelper< TlvType, T >::decode(), NDN_THROW, ndn::to_string(), and ndn::Block::type().
|
inlinestatic |
Encode a field and prepend to encoder
.
encoder | a buffer encoder or estimator. |
value | value of the field. |
Definition at line 205 of file field-decl.hpp.
References ndn::lp::EncodeHelper< TAG, TlvType, T >::encode().