NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nfd::Cs Class Reference

represents Content Store More...

#include <cs.hpp>

Inheritance diagram for nfd::Cs:
Collaboration diagram for nfd::Cs:

Classes

class  const_iterator
 

Public Member Functions

 Cs (size_t nMaxPackets=10)
 
 ~Cs ()
 
bool insert (const Data &data, bool isUnsolicited=false)
 inserts a Data packet This method does not consider the payload of the Data packet. More...
 
const Data * find (const Interest &interest) const
 finds the best match Data for an Interest More...
 
void erase (const Name &exactName)
 deletes CS entry by the exact name More...
 
void setLimit (size_t nMaxPackets)
 sets maximum allowed size of Content Store (in packets) More...
 
size_t getLimit () const
 returns maximum allowed size of Content Store (in packets) More...
 
size_t size () const
 returns current size of Content Store measured in packets More...
 
const_iterator begin () const
 returns an iterator pointing to the first CS entry More...
 
const_iterator end () const
 returns an iterator referring to the past-the-end CS entry More...
 

Protected Member Functions

bool evictItem ()
 removes one Data packet from Content Store based on replacement policy More...
 

Detailed Description

represents Content Store

Definition at line 111 of file cs.hpp.

Constructor & Destructor Documentation

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

Definition at line 62 of file cs.cpp.

nfd::Cs::~Cs ( )

Definition at line 73 of file cs.cpp.

References evictItem().

Member Function Documentation

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

returns an iterator pointing to the first CS entry

Note
Iteration order is implementation-specific and is undefined
The returned iterator may get invalidated if CS is modified

Definition at line 285 of file cs.hpp.

Referenced by evictItem().

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

returns an iterator referring to the past-the-end CS entry

Note
The returned iterator may get invalidated if CS is modified

Definition at line 291 of file cs.hpp.

Referenced by erase().

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

deletes CS entry by the exact name

Definition at line 747 of file cs.cpp.

References end(), nfd::cs::Entry::getFullName(), NFD_LOG_TRACE, size(), and SKIPLIST_MAX_LAYERS.

Referenced by evictItem().

bool nfd::Cs::evictItem ( )
protected

removes one Data packet from Content Store based on replacement policy

Returns
{ whether the Data was removed }

Definition at line 362 of file cs.cpp.

References begin(), erase(), and NFD_LOG_TRACE.

Referenced by insert(), setLimit(), and ~Cs().

const Data * nfd::Cs::find ( const Interest &  interest) const

finds the best match Data for an Interest

Returns
{ the best match, if any; otherwise 0 }

Definition at line 407 of file cs.cpp.

References NFD_LOG_TRACE.

size_t nfd::Cs::getLimit ( ) const

returns maximum allowed size of Content Store (in packets)

Returns
{ number of packets that can be stored in Content Store }

Definition at line 118 of file cs.cpp.

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

inserts a Data packet This method does not consider the payload of the Data packet.

Packets are considered duplicate if the name matches. The new Data packet with the identical name, but a different payload is not placed in the Content Store

Returns
{ whether the Data is added }

Definition at line 265 of file cs.cpp.

References evictItem(), and NFD_LOG_TRACE.

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

sets maximum allowed size of Content Store (in packets)

Definition at line 95 of file cs.cpp.

References evictItem(), and size().

Referenced by nfd::TablesConfigSection::ensureTablesAreConfigured().

size_t nfd::Cs::size ( ) const

returns current size of Content Store measured in packets

Returns
{ number of packets located in Content Store }

Definition at line 89 of file cs.cpp.

Referenced by erase(), and setLimit().


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