Stores a pending Interest and associated callbacks. More...
#include <pending-interest.hpp>
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 for an Interest from Face::expressInterest. More... | |
PendingInterest (shared_ptr< const Interest > interest, Scheduler &scheduler) | |
Construct a pending Interest record for an Interest from NFD. More... | |
shared_ptr< const Interest > | getInterest () const |
Get the Interest. More... | |
PendingInterestOrigin | getOrigin () const |
void | recordForwarding () |
Record that the Interest has been forwarded to one destination. More... | |
optional< lp::Nack > | recordNack (const lp::Nack &nack) |
Record an incoming Nack against a forwarded Interest. More... | |
void | invokeDataCallback (const Data &data) |
Invoke the Data callback. More... | |
void | invokeNackCallback (const lp::Nack &nack) |
Invoke the Nack callback. More... | |
void | setDeleter (const std::function< void()> &deleter) |
Set cleanup function to be invoked when Interest times out. More... | |
Stores a pending Interest and associated callbacks.
Definition at line 57 of file pending-interest.hpp.
|
inline |
Construct a pending Interest record for an Interest from Face::expressInterest.
The timeout is set based on the current time and InterestLifetime. This class will invoke the timeout callback unless the record is deleted before timeout.
interest | the Interest |
dataCallback | invoked when matching Data packet is received |
nackCallback | invoked when Nack matching Interest is received |
timeoutCallback | invoked when Interest times out |
scheduler | Scheduler for scheduling the timeout event |
Definition at line 72 of file pending-interest.hpp.
|
inline |
Construct a pending Interest record for an Interest from NFD.
interest | the Interest |
scheduler | Scheduler for scheduling the timeout event |
Definition at line 94 of file pending-interest.hpp.
|
inline |
Get the Interest.
Definition at line 107 of file pending-interest.hpp.
|
inline |
Definition at line 113 of file pending-interest.hpp.
|
inline |
Record that the Interest has been forwarded to one destination.
A "destination" could be either a local InterestFilter or the forwarder.
Definition at line 124 of file pending-interest.hpp.
Record an incoming Nack against a forwarded Interest.
Definition at line 135 of file pending-interest.hpp.
References ndn::lp::Nack::getReason(), ndn::lp::isLessSevere(), and ndn::nullopt.
|
inline |
Invoke the Data callback.
Definition at line 152 of file pending-interest.hpp.
|
inline |
Invoke the Nack callback.
Definition at line 164 of file pending-interest.hpp.
|
inline |
Set cleanup function to be invoked when Interest times out.
Definition at line 175 of file pending-interest.hpp.