nfd::cs::Cs Class Reference

represents the ContentStore More...

#include <daemon/table/cs.hpp>

+ Inheritance diagram for nfd::cs::Cs:
+ Collaboration diagram for nfd::cs::Cs:

Classes

struct  EntryFromEntryImpl
 

Public Types

typedef boost::transform_iterator< EntryFromEntryImpl, iterator, const Entry & > const_iterator
 ContentStore iterator (public API) More...
 
typedef std::function< void(const Interest &, const Data &data)> HitCallback
 
typedef std::function< void(const Interest &)> MissCallback
 

Public Member Functions

 Cs (size_t nMaxPackets=10)
 
const_iterator begin () const
 
const_iterator end () const
 
void erase (const Name &exactName)
 
void find (const Interest &interest, const HitCallback &hitCallback, const MissCallback &missCallback) const
 finds the best matching Data packet More...
 
size_t getLimit () const
 
PolicygetPolicy () const
 
void insert (const Data &data, bool isUnsolicited=false)
 inserts a Data packet More...
 
void setLimit (size_t nMaxPackets)
 changes capacity (in number of packets) More...
 
void setPolicy (unique_ptr< Policy > policy)
 changes cs replacement policy More...
 
size_t size () const
 

Detailed Description

represents the ContentStore

Definition at line 62 of file cs.hpp.

Member Typedef Documentation

typedef boost::transform_iterator<EntryFromEntryImpl, iterator, const Entry&> nfd::cs::Cs::const_iterator

ContentStore iterator (public API)

Definition at line 144 of file cs.hpp.

typedef std::function<void(const Interest&, const Data& data)> nfd::cs::Cs::HitCallback

Definition at line 73 of file cs.hpp.

typedef std::function<void(const Interest&)> nfd::cs::Cs::MissCallback

Definition at line 74 of file cs.hpp.

Constructor & Destructor Documentation

nfd::cs::Cs::Cs ( size_t  nMaxPackets = 10)
explicit

Definition at line 46 of file cs.cpp.

Member Function Documentation

const_iterator nfd::cs::Cs::begin ( ) const
inline

Definition at line 147 of file cs.hpp.

const_iterator nfd::cs::Cs::end ( ) const
inline

Definition at line 153 of file cs.hpp.

void nfd::cs::Cs::erase ( const Name &  exactName)
inline

Definition at line 89 of file cs.hpp.

void nfd::cs::Cs::find ( const Interest &  interest,
const HitCallback hitCallback,
const MissCallback missCallback 
) const

finds the best matching Data packet

Parameters
interestthe Interest for lookup
hitCallbacka callback if a match is found; must not be empty
missCallbacka callback if there's no match; must not be empty
Note
A lookup invokes either callback exactly once. The callback may be invoked either before or after find() returns

Definition at line 115 of file cs.cpp.

size_t nfd::cs::Cs::getLimit ( ) const
Returns
capacity (in number of packets)

Definition at line 59 of file cs.cpp.

Policy* nfd::cs::Cs::getPolicy ( ) const
inline
Returns
cs replacement policy

Definition at line 113 of file cs.hpp.

void nfd::cs::Cs::insert ( const Data &  data,
bool  isUnsolicited = false 
)

inserts a Data packet

Definition at line 75 of file cs.cpp.

void nfd::cs::Cs::setLimit ( size_t  nMaxPackets)

changes capacity (in number of packets)

Definition at line 53 of file cs.cpp.

void nfd::cs::Cs::setPolicy ( unique_ptr< Policy policy)

changes cs replacement policy

Precondition
size() == 0

Definition at line 65 of file cs.cpp.

size_t nfd::cs::Cs::size ( ) const
inline
Returns
number of stored packets

Definition at line 121 of file cs.hpp.