represents a CachePolicy header field More...
#include <cache-policy.hpp>
Classes | |
class | Error |
Public Member Functions | |
CachePolicy () | |
CachePolicy (const Block &block) | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
prepend CachePolicy to encoder More... | |
const Block & | wireEncode () const |
encode CachePolicy into wire format More... | |
void | wireDecode (const Block &wire) |
get CachePolicyType from wire format More... | |
CachePolicyType | getPolicy () const |
CachePolicy & | setPolicy (CachePolicyType policy) |
set policy type code More... | |
represents a CachePolicy header field
Definition at line 47 of file cache-policy.hpp.
ndn::lp::CachePolicy::CachePolicy | ( | ) |
Definition at line 41 of file cache-policy.cpp.
|
explicit |
Definition at line 46 of file cache-policy.cpp.
References wireDecode().
size_t ndn::lp::CachePolicy::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
prepend CachePolicy to encoder
Error | policy type is unset |
Definition at line 53 of file cache-policy.cpp.
References ndn::lp::tlv::CachePolicy, ndn::lp::tlv::CachePolicyType, ndn::lp::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), NDN_THROW, ndn::lp::NONE, and ndn::encoding::prependNonNegativeIntegerBlock().
const Block & ndn::lp::CachePolicy::wireEncode | ( | ) | const |
encode CachePolicy into wire format
Definition at line 69 of file cache-policy.cpp.
References ndn::Block::hasWire(), NDN_THROW, and ndn::lp::NONE.
void ndn::lp::CachePolicy::wireDecode | ( | const Block & | wire | ) |
get CachePolicyType from wire format
Definition at line 91 of file cache-policy.cpp.
References ndn::lp::tlv::CachePolicy, ndn::lp::tlv::CachePolicyType, ndn::Block::elements_begin(), ndn::Block::elements_end(), getPolicy(), NDN_THROW, ndn::lp::NONE, ndn::Block::parse(), and ndn::Block::type().
Referenced by CachePolicy().
CachePolicyType ndn::lp::CachePolicy::getPolicy | ( | ) | const |
CachePolicyType::NONE | if policy type is unset or has an unknown code |
Definition at line 117 of file cache-policy.cpp.
References ndn::lp::NO_CACHE, and ndn::lp::NONE.
Referenced by wireDecode().
CachePolicy & ndn::lp::CachePolicy::setPolicy | ( | CachePolicyType | policy | ) |
set policy type code
policy | a policy type code; CachePolicyType::NONE clears the policy |
Definition at line 128 of file cache-policy.cpp.
References ndn::Block::reset().
Referenced by ndn::mgmt::Dispatcher::removeTopPrefix().