nfd::cs::EntryImpl Class Reference

an Entry in ContentStore implementation More...

#include <daemon/table/cs-entry-impl.hpp>

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

Public Member Functions

 EntryImpl (const Name &name)
 construct Entry for query More...
 
 EntryImpl (shared_ptr< const Data > data, bool isUnsolicited)
 construct Entry for storage More...
 
bool canSatisfy (const Interest &interest) const
 determines whether Interest can be satisified by the stored Data More...
 
const Data & getData () const
 
const Name & getFullName () const
 
const Name & getName () const
 
const time::steady_clock::TimePoint & getStaleTime () const
 
bool hasData () const
 
bool isStale () const
 checks if the stored Data is stale now More...
 
bool isUnsolicited () const
 
bool operator< (const EntryImpl &other) const
 
void reset ()
 clears the entry More...
 
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 unsetUnsolicited ()
 
void updateStaleTime ()
 refreshes stale time relative to current time More...
 

Detailed Description

an Entry in ContentStore implementation

An Entry is either a stored Entry which contains a Data packet and related attributes, or a query Entry which contains a Name that is LessComparable to other stored/query Entry and is used to lookup a container of entries.

Note
This type is internal to this specific ContentStore implementation.

Definition at line 42 of file cs-entry-impl.hpp.

Constructor & Destructor Documentation

nfd::cs::EntryImpl::EntryImpl ( const Name &  name)

construct Entry for query

Note
Name is implicitly convertible to Entry, so that Name can be passed to lookup functions on a container of Entry

Definition at line 31 of file cs-entry-impl.cpp.

nfd::cs::EntryImpl::EntryImpl ( shared_ptr< const Data >  data,
bool  isUnsolicited 
)

construct Entry for storage

Definition at line 37 of file cs-entry-impl.cpp.

Member Function Documentation

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

determines whether Interest can be satisified by the stored Data

Note
ChildSelector is not considered
Precondition
hasData()

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

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

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

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

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

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

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

const time::steady_clock::TimePoint& nfd::cs::Entry::getStaleTime ( ) const
inlineinherited
Returns
the absolute time when the stored Data becomes stale
Note
if the returned TimePoint is in the past, the Data is stale
Precondition
hasData()

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

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

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

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

checks if the stored Data is stale now

Precondition
hasData()

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

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

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

bool nfd::cs::EntryImpl::operator< ( const EntryImpl other) const

Definition at line 89 of file cs-entry-impl.cpp.

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

clears the entry

Postcondition
!hasData()

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

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

replaces the stored Data

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

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

replaces the stored Data

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

void nfd::cs::EntryImpl::unsetUnsolicited ( )

Definition at line 50 of file cs-entry-impl.cpp.

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

refreshes stale time relative to current time

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