55 template<encoding::Tag TAG>
60 BOOST_THROW_EXCEPTION(
Error(
"CachePolicyType must be set"));
65 length += encoder.prependVarNumber(length);
76 BOOST_THROW_EXCEPTION(
Error(
"CachePolicyType must be set"));
89 m_wire = buffer.block();
98 BOOST_THROW_EXCEPTION(
Error(
"expecting CachePolicy block"));
108 BOOST_THROW_EXCEPTION(
Error(
"unknown CachePolicyType"));
112 BOOST_THROW_EXCEPTION(
Error(
"expecting CachePolicyType block"));
void wireDecode(const Block &wire)
get CachePolicyType from wire format
represents a CachePolicy header field
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
CachePolicyType getPolicy() const
CachePolicy & setPolicy(CachePolicyType policy)
set policy type code
element_container::const_iterator element_const_iterator
Represents a TLV element of NDN packet format.
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
#define NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
CachePolicyType
indicates the cache policy applied to a Data packet
void reset()
Reset wire buffer of the element.
void parse() const
Parse TLV-VALUE into sub elements.
uint32_t type() const
Get TLV-TYPE.
std::ostream & operator<<(std::ostream &os, CachePolicyType policy)
const Block & wireEncode() const
encode CachePolicy into wire format
bool hasWire() const
Check if the Block has fully encoded wire.
element_const_iterator elements_end() const
Equivalent to elements().end()
element_const_iterator elements_begin() const
Equivalent to elements().begin()
EncodingImpl< EncoderTag > EncodingBuffer
EncodingImpl< EstimatorTag > EncodingEstimator