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 Types

typedef function< void(const Interest &, Data &)> OnData
 
typedef function< void(const Interest &)> OnTimeout
 

Public Member Functions

 PendingInterest (shared_ptr< const Interest > interest, const OnData &onData, const OnTimeout &onTimeout, Scheduler &scheduler)
 Create a new PitEntry and set the timeout based on the current time and the interest lifetime. More...
 
const InterestgetInterest () const
 
void invokeDataCallback (const Data &data)
 invokes the DataCallback More...
 
void setDeleter (const std::function< void()> &deleter)
 Set cleanup function to be called after interest times out. More...
 

Detailed Description

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

Member Typedef Documentation

typedef function<void(const Interest&, Data&)> ndn::PendingInterest::OnData

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

typedef function<void(const Interest&)> ndn::PendingInterest::OnTimeout

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

Constructor & Destructor Documentation

ndn::PendingInterest::PendingInterest ( shared_ptr< const Interest interest,
const OnData onData,
const OnTimeout onTimeout,
Scheduler &  scheduler 
)
inline

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

Parameters
interestA shared_ptr for the interest
onDataA function object to call when a matching data packet is received.
onTimeoutA function object to call if the interest times out. If onTimeout is an empty OnTimeout(), this does not use it.
schedulerScheduler instance to use to schedule a timeout event. The scheduled event will be automatically cancelled when pending interest is destroyed.

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

References ndn::DEFAULT_INTEREST_LIFETIME.

Member Function Documentation

const Interest& ndn::PendingInterest::getInterest ( ) const
inline
Returns
the Interest

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

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 79 of file pending-interest.hpp.

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

Set cleanup function to be called after interest times out.

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


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