ndn::lp::CachePolicy Class Reference

represents a CachePolicy header field More...

#include <cache-policy.hpp>

Classes

class  Error
 

Public Member Functions

 CachePolicy ()
 
 CachePolicy (const Block &block)
 
CachePolicyType getPolicy () const
 
CachePolicysetPolicy (CachePolicyType policy)
 set policy type code More...
 
void wireDecode (const Block &wire)
 get CachePolicyType from wire format More...
 
template<encoding::Tag TAG>
size_t wireEncode (EncodingImpl< TAG > &encoder) const
 prepend CachePolicy to encoder More...
 
const BlockwireEncode () const
 encode CachePolicy into wire format More...
 

Detailed Description

represents a CachePolicy header field

Definition at line 47 of file cache-policy.hpp.

Constructor & Destructor Documentation

ndn::lp::CachePolicy::CachePolicy ( )

Definition at line 45 of file cache-policy.cpp.

ndn::lp::CachePolicy::CachePolicy ( const Block block)
explicit

Definition at line 50 of file cache-policy.cpp.

Member Function Documentation

CachePolicyType ndn::lp::CachePolicy::getPolicy ( ) const
Returns
policy type code
Return values
CachePolicyType::NONEif policy type is unset or has an unknown code

Definition at line 117 of file cache-policy.cpp.

CachePolicy & ndn::lp::CachePolicy::setPolicy ( CachePolicyType  policy)

set policy type code

Parameters
policya policy type code; CachePolicyType::NONE clears the policy

Definition at line 128 of file cache-policy.cpp.

void ndn::lp::CachePolicy::wireDecode ( const Block wire)

get CachePolicyType from wire format

Definition at line 95 of file cache-policy.cpp.

template<encoding::Tag TAG>
size_t ndn::lp::CachePolicy::wireEncode ( EncodingImpl< TAG > &  encoder) const

prepend CachePolicy to encoder

Precondition
getPolicy() != CachePolicyType::NONE
Exceptions
Errorpolicy type is unset

Definition at line 57 of file cache-policy.cpp.

const Block & ndn::lp::CachePolicy::wireEncode ( ) const

encode CachePolicy into wire format

Definition at line 73 of file cache-policy.cpp.