NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::PendingInterest Class Reference

stores a pending Interest and associated callbacks More...

#include <pending-interest.hpp>

Inheritance diagram for ndn::PendingInterest:
Collaboration diagram for ndn::PendingInterest:

Public Member Functions

 PendingInterest (shared_ptr< const Interest > interest, const DataCallback &dataCallback, const NackCallback &nackCallback, const TimeoutCallback &timeoutCallback, Scheduler &scheduler)
 Construct a pending Interest record. More...
 
shared_ptr< const InterestgetInterest () const
 
void invokeDataCallback (const Data &data)
 invokes the Data callback More...
 
void invokeNackCallback (const lp::Nack &nack)
 invokes the Nack callback More...
 
void setDeleter (const std::function< void()> &deleter)
 Set cleanup function to be invoked when Interest times out. More...
 

Detailed Description

stores a pending Interest and associated callbacks

Definition at line 35 of file pending-interest.hpp.

Constructor & Destructor Documentation

◆ PendingInterest()

ndn::PendingInterest::PendingInterest ( shared_ptr< const Interest interest,
const DataCallback dataCallback,
const NackCallback nackCallback,
const TimeoutCallback timeoutCallback,
Scheduler scheduler 
)
inline

Construct a pending Interest record.

The timeout is set based on the current time and the Interest lifetime. This class will invoke the timeout callback unless the record is deleted before timeout.

Parameters
interestthe Interest
dataCallbackinvoked when matching Data packet is received
nackCallbackinvoked when Nack matching Interest is received
timeoutCallbackinvoked when Interest times out
schedulerScheduler for scheduling the timeout event

Definition at line 50 of file pending-interest.hpp.

References ndn::DEFAULT_INTEREST_LIFETIME, and ndn::util::scheduler::Scheduler::scheduleEvent().

Member Function Documentation

◆ getInterest()

shared_ptr<const Interest> ndn::PendingInterest::getInterest ( ) const
inline
Returns
the Interest

Definition at line 72 of file pending-interest.hpp.

◆ invokeDataCallback()

void ndn::PendingInterest::invokeDataCallback ( const Data data)
inline

invokes the Data callback

Note
This method does nothing if the Data callback is empty

Definition at line 82 of file pending-interest.hpp.

◆ invokeNackCallback()

void ndn::PendingInterest::invokeNackCallback ( const lp::Nack nack)
inline

invokes the Nack callback

Note
This method does nothing if the Nack callback is empty

Definition at line 94 of file pending-interest.hpp.

◆ setDeleter()

void ndn::PendingInterest::setDeleter ( const std::function< void()> &  deleter)
inline

Set cleanup function to be invoked when Interest times out.

Definition at line 105 of file pending-interest.hpp.


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