54 template<encoding::Tag TAG>
59 BOOST_THROW_EXCEPTION(
Error(
"CachePolicyType must be set"));
63 static_cast<uint32_t>(m_policy));
64 length += encoder.prependVarNumber(length);
70 CachePolicy::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>& encoder)
const;
73 CachePolicy::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>& encoder)
const;
79 BOOST_THROW_EXCEPTION(
Error(
"CachePolicyType must be set"));
92 m_wire = buffer.block();
101 BOOST_THROW_EXCEPTION(
Error(
"expecting CachePolicy block"));
111 BOOST_THROW_EXCEPTION(
Error(
"unknown CachePolicyType"));
115 BOOST_THROW_EXCEPTION(
Error(
"expecting CachePolicyType block"));
void wireDecode(const Block &wire)
get CachePolicyType from wire format
represents a CachePolicy header field
Copyright (c) 2013-2016 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.
EncodingImpl< EstimatorTag > EncodingEstimator
CachePolicyType getPolicy() const
CachePolicy & setPolicy(CachePolicyType policy)
set policy type code
Class representing a wire element of NDN-TLV packet format.
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
element_const_iterator elements_end() const
element_const_iterator elements_begin() const
EncodingImpl< EncoderTag > EncodingBuffer
element_container::const_iterator element_const_iterator
CachePolicyType
indicates the cache policy applied to a Data packet
void reset()
Reset wire buffer of the element.
void parse() const
Parse wire buffer into subblocks.
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.