ndn::lp::CachePolicy Class Reference

Represents a CachePolicy header field. More...

#include <ndn-cxx/lp/cache-policy.hpp>

Classes

class  Error
 

Public Member Functions

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

Detailed Description

Represents a CachePolicy header field.

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

Constructor & Destructor Documentation

◆ CachePolicy() [1/2]

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

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

◆ CachePolicy() [2/2]

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

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

Member Function Documentation

◆ getPolicy()

CachePolicyType ndn::lp::CachePolicy::getPolicy ( ) const

Get policy type code.

Return values
CachePolicyType::NONEif policy type is unset or has an unknown code

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

◆ setPolicy()

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

Set policy type code.

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

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

◆ wireDecode()

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

Get CachePolicyType from wire format.

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

◆ wireEncode() [1/2]

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

Encode CachePolicy into wire format.

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

◆ wireEncode() [2/2]

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 52 of file cache-policy.cpp.