NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
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)
 
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...
 
void wireDecode (const Block &wire)
 get CachePolicyType from wire format More...
 
CachePolicyType getPolicy () const
 
CachePolicysetPolicy (CachePolicyType policy)
 set policy type code More...
 

Detailed Description

represents a CachePolicy header field

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

Constructor & Destructor Documentation

§ CachePolicy() [1/2]

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

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

§ CachePolicy() [2/2]

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

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

References wireDecode().

Member Function Documentation

§ wireEncode() [1/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 56 of file cache-policy.cpp.

References ndn::lp::tlv::CachePolicy, ndn::lp::tlv::CachePolicyType, ndn::lp::NONE, and ndn::encoding::prependNonNegativeIntegerBlock().

§ wireEncode() [2/2]

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

encode CachePolicy into wire format

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

References ndn::Block::hasWire(), and ndn::lp::NONE.

§ wireDecode()

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

§ getPolicy()

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

References ndn::lp::NO_CACHE, and ndn::lp::NONE.

Referenced by wireDecode().

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

References ndn::Block::reset().

Referenced by ndn::mgmt::Dispatcher::removeTopPrefix().


The documentation for this class was generated from the following files: