All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::PendingInterest Class Reference

#include <pending-interest.hpp>

Public Types

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

Public Member Functions

 PendingInterest (const shared_ptr< const Interest > &interest, const OnData &onData, const OnTimeout &onTimeout)
 Create a new PitEntry and set the timeout based on the current time and the interest lifetime. More...
 
const shared_ptr< const
Interest > & 
getInterest ()
 
const OnDatagetOnData ()
 
bool isTimedOut (const time::steady_clock::TimePoint &now)
 Check if this interest is timed out. More...
 
void callTimeout ()
 Call m_onTimeout (if defined). More...
 

Detailed Description

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

Member Typedef Documentation

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

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

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

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

Constructor & Destructor Documentation

ndn::PendingInterest::PendingInterest ( const shared_ptr< const Interest > &  interest,
const OnData onData,
const OnTimeout onTimeout 
)
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.

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

Member Function Documentation

void ndn::PendingInterest::callTimeout ( )
inline

Call m_onTimeout (if defined).

This ignores exceptions from the m_onTimeout.

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

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

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

const OnData& ndn::PendingInterest::getOnData ( )
inline

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

bool ndn::PendingInterest::isTimedOut ( const time::steady_clock::TimePoint now)
inline

Check if this interest is timed out.

Returns
true if this interest timed out, otherwise false.

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