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

#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)
 Create a new PitEntry and set the timeout based on the current time and the Interest lifetime. More...
 
shared_ptr< const InterestgetInterest () const
 
void invokeDataCallback (const Data &data)
 invokes the DataCallback More...
 
void invokeNackCallback (const lp::Nack &nack)
 invokes the NackCallback More...
 
void setDeleter (const std::function< void()> &deleter)
 Set cleanup function to be called after interest times out. More...
 

Detailed Description

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

Create a new PitEntry and set the timeout based on the current time and the Interest lifetime.

Parameters
interestshared_ptr for the Interest
dataCallbackfunction to call when matching Data packet is received
nackCallbackfunction to call when Nack matching Interest is received
timeoutCallbackfunction to call if Interest times out
schedulerScheduler instance to use to schedule a timeout event. The scheduled event will be automatically cancelled when pending Interest is destroyed.

Definition at line 48 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 70 of file pending-interest.hpp.

§ invokeDataCallback()

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

invokes the DataCallback

Note
If the DataCallback is an empty function, this method does nothing.

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

§ invokeNackCallback()

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

invokes the NackCallback

Note
If the NackCallback is an empty function, this method does nothing.

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

§ setDeleter()

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

Set cleanup function to be called after interest times out.

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


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