Public Member Functions | List of all members
ndn::MemoryContentCache::PendingInterest Class Reference

A PendingInterest holds an interest which onInterest received but could not satisfy. More...

#include <memory-content-cache.hpp>

Public Member Functions

 PendingInterest (const ptr_lib::shared_ptr< const Interest > &interest, Face &face)
 Create a new PendingInterest and set the timeoutTime_ based on the current time and the interest lifetime. More...
 
const ptr_lib::shared_ptr< const Interest > & getInterest () const
 Return the interest given to the constructor. More...
 
MillisecondsSince1970 getTimeoutPeriodStart () const
 Return the time when this pending interest entry was created (the time when the unsatisfied interest arrived and was added to the pending interest table). More...
 
FacegetFace () const
 Return the face given to the constructor.
 
bool isTimedOut (MillisecondsSince1970 nowMilliseconds) const
 Check if this interest is timed out. More...
 

Detailed Description

A PendingInterest holds an interest which onInterest received but could not satisfy.

When we add a new data packet to the cache, we will also check if it satisfies a pending interest.

Constructor & Destructor Documentation

ndn::MemoryContentCache::PendingInterest::PendingInterest ( const ptr_lib::shared_ptr< const Interest > &  interest,
Face face 
)

Create a new PendingInterest and set the timeoutTime_ based on the current time and the interest lifetime.

Parameters
interestA shared_ptr for the interest.
faceThe face from the onInterest callback. If the interest is satisfied later by a new data packet, we will send the data packet to the face.

Member Function Documentation

const ptr_lib::shared_ptr<const Interest>& ndn::MemoryContentCache::PendingInterest::getInterest ( ) const
inline

Return the interest given to the constructor.

You must not modify this object - if you need to modify it then make a copy.

MillisecondsSince1970 ndn::MemoryContentCache::PendingInterest::getTimeoutPeriodStart ( ) const
inline

Return the time when this pending interest entry was created (the time when the unsatisfied interest arrived and was added to the pending interest table).

The interest timeout is based on this value.

Returns
The timeout period start time in milliseconds since 1/1/1970, as returned by ndn_getNowMilliseconds.
bool ndn::MemoryContentCache::PendingInterest::isTimedOut ( MillisecondsSince1970  nowMilliseconds) const
inline

Check if this interest is timed out.

Parameters
nowMillisecondsThe current time in milliseconds from ndn_getNowMilliseconds.
Returns
true if this interest timed out, otherwise false.

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