NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::cs::Entry Class Reference

represents a base class for CS entry More...

#include <cs-entry.hpp>

Inheritance diagram for nfd::cs::Entry:

Public Member Functions

const DatagetData () const
 
const NamegetName () const
 
const NamegetFullName () const
 
bool isUnsolicited () const
 
const time::steady_clock::TimePointgetStaleTime () const
 
bool isStale () const
 checks if the stored Data is stale now More...
 
bool canSatisfy (const Interest &interest) const
 determines whether Interest can be satisified by the stored Data More...
 
bool hasData () const
 
void setData (shared_ptr< const Data > data, bool isUnsolicited)
 replaces the stored Data More...
 
void setData (const Data &data, bool isUnsolicited)
 replaces the stored Data More...
 
void updateStaleTime ()
 refreshes stale time relative to current time More...
 
void reset ()
 clears the entry More...
 

Detailed Description

represents a base class for CS entry

Definition at line 36 of file cs-entry.hpp.

Member Function Documentation

§ getData()

const Data& nfd::cs::Entry::getData ( ) const
inline
Returns
the stored Data
Precondition
hasData()

Definition at line 43 of file cs-entry.hpp.

References hasData().

Referenced by nfd::cs::EntryImpl::operator<(), and nfd::cs::EntryImpl::unsetUnsolicited().

§ getName()

const Name& nfd::cs::Entry::getName ( ) const
inline
Returns
Name of the stored Data
Precondition
hasData()

Definition at line 53 of file cs-entry.hpp.

References hasData().

§ getFullName()

const Name& nfd::cs::Entry::getFullName ( ) const
inline
Returns
full name (including implicit digest) of the stored Data
Precondition
hasData()

Definition at line 63 of file cs-entry.hpp.

References hasData().

§ isUnsolicited()

bool nfd::cs::Entry::isUnsolicited ( ) const
inline
Returns
whether the stored Data is unsolicited
Precondition
hasData()

Definition at line 73 of file cs-entry.hpp.

References hasData().

Referenced by hasData(), nfd::cs::Cs::insert(), and setData().

§ getStaleTime()

const time::steady_clock::TimePoint& nfd::cs::Entry::getStaleTime ( ) const
inline
Returns
the absolute time when the stored Data becomes expired
Return values
time::steady_clock::TimePoint::max()if the stored Data never expires
Precondition
hasData()

Definition at line 84 of file cs-entry.hpp.

References canSatisfy(), hasData(), and isStale().

Referenced by nfd::cs::EntryImpl::canStale().

§ isStale()

bool nfd::cs::Entry::isStale ( ) const

checks if the stored Data is stale now

Precondition
hasData()

Definition at line 41 of file cs-entry.cpp.

References hasData(), and ndn::time::steady_clock::now().

Referenced by canSatisfy(), and getStaleTime().

§ canSatisfy()

bool nfd::cs::Entry::canSatisfy ( const Interest interest) const

determines whether Interest can be satisified by the stored Data

Note
ChildSelector is not considered
Precondition
hasData()

Definition at line 60 of file cs-entry.cpp.

References ndn::Interest::getMustBeFresh(), hasData(), isStale(), and ndn::Interest::matchesData().

Referenced by nfd::cs::Cs::find(), and getStaleTime().

§ hasData()

bool nfd::cs::Entry::hasData ( ) const
inline
Returns
true if a Data packet is stored

Definition at line 107 of file cs-entry.hpp.

References isUnsolicited(), and setData().

Referenced by canSatisfy(), nfd::cs::EntryImpl::EntryImpl(), getData(), getFullName(), getName(), getStaleTime(), isStale(), isUnsolicited(), and updateStaleTime().

§ setData() [1/2]

void nfd::cs::Entry::setData ( shared_ptr< const Data data,
bool  isUnsolicited 
)

replaces the stored Data

Definition at line 32 of file cs-entry.cpp.

References isUnsolicited(), and updateStaleTime().

Referenced by nfd::cs::EntryImpl::EntryImpl(), hasData(), setData(), and nfd::cs::EntryImpl::unsetUnsolicited().

§ setData() [2/2]

void nfd::cs::Entry::setData ( const Data data,
bool  isUnsolicited 
)
inline

replaces the stored Data

Definition at line 120 of file cs-entry.hpp.

References isUnsolicited(), reset(), setData(), and updateStaleTime().

§ updateStaleTime()

void nfd::cs::Entry::updateStaleTime ( )

refreshes stale time relative to current time

Definition at line 48 of file cs-entry.cpp.

References hasData(), and ndn::time::steady_clock::now().

Referenced by nfd::cs::Cs::insert(), and setData().

§ reset()

void nfd::cs::Entry::reset ( )

clears the entry

Postcondition
!hasData()

Definition at line 75 of file cs-entry.cpp.

Referenced by setData().


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