NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG > Class Template Reference

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...
 

Detailed Description

template<typename LOCATION, typename VALUE, uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
class ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >

Declare a field.

Template Parameters
LOCATIONa tag that indicates where the field is in an LpPacket.
VALUEtype of field value.
TYPETLV-TYPE number of the field.
REPEATABLEwhether the field is repeatable.
DECODER_TAGselects a specialization of DecodeHelper.
ENCODER_TAGselects a specialization of EncodeHelper.

Definition at line 179 of file field-decl.hpp.

Member Typedef Documentation

◆ FieldLocation

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
typedef LOCATION ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::FieldLocation

Definition at line 182 of file field-decl.hpp.

◆ ValueType

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
typedef VALUE ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::ValueType

Definition at line 183 of file field-decl.hpp.

◆ TlvType

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
typedef std::integral_constant<uint64_t, TYPE> ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::TlvType

Definition at line 184 of file field-decl.hpp.

◆ IsRepeatable

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
typedef std::integral_constant<bool, REPEATABLE> ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::IsRepeatable

Definition at line 185 of file field-decl.hpp.

Member Function Documentation

◆ decode()

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
static ValueType ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::decode ( const Block wire)
inlinestatic

Decode a field.

Parameters
wirean element with top-level TLV-TYPE TlvType::value.
Returns
value of the field.
Exceptions
ndn::tlv::Errordecode failure.

Definition at line 193 of file field-decl.hpp.

References ndn::lp::DecodeHelper< TlvType, T >::decode(), NDN_THROW, ndn::to_string(), and ndn::Block::type().

◆ encode()

template<typename LOCATION , typename VALUE , uint64_t TYPE, bool REPEATABLE = false, typename DECODER_TAG = VALUE, typename ENCODER_TAG = VALUE>
template<typename encoding::Tag TAG>
static size_t ndn::lp::FieldDecl< LOCATION, VALUE, TYPE, REPEATABLE, DECODER_TAG, ENCODER_TAG >::encode ( EncodingImpl< TAG > &  encoder,
const ValueType value 
)
inlinestatic

Encode a field and prepend to encoder.

Parameters
encodera buffer encoder or estimator.
valuevalue of the field.

Definition at line 208 of file field-decl.hpp.

References ndn::lp::EncodeHelper< TAG, TlvType, T >::encode().


The documentation for this class was generated from the following file: