represents a forwarding strategy More...
#include <strategy.hpp>
Public Member Functions | |
Strategy (Forwarder &forwarder, const Name &name) | |
construct a strategy instance More... | |
virtual | ~Strategy () |
const Name & | getName () const |
a Name that represent the Strategy program More... | |
virtual void | afterReceiveInterest (const Face &inFace, const Interest &interest, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry)=0 |
trigger after Interest is received More... | |
virtual void | beforeSatisfyInterest (shared_ptr< pit::Entry > pitEntry, const Face &inFace, const Data &data) |
trigger before PIT entry is satisfied More... | |
virtual void | beforeExpirePendingInterest (shared_ptr< pit::Entry > pitEntry) |
trigger before PIT entry expires More... | |
Protected Member Functions | |
void | sendInterest (shared_ptr< pit::Entry > pitEntry, shared_ptr< Face > outFace, bool wantNewNonce=false) |
send Interest to outFace More... | |
void | rejectPendingInterest (shared_ptr< pit::Entry > pitEntry) |
decide that a pending Interest cannot be forwarded More... | |
MeasurementsAccessor & | getMeasurements () |
shared_ptr< Face > | getFace (FaceId id) |
const FaceTable & | getFaceTable () |
Protected Attributes | |
signal::Signal< FaceTable, shared_ptr< Face > > & | afterAddFace |
signal::Signal< FaceTable, shared_ptr< Face > > & | beforeRemoveFace |
represents a forwarding strategy
Definition at line 37 of file strategy.hpp.
nfd::fw::Strategy::Strategy | ( | Forwarder & | forwarder, |
const Name & | name | ||
) |
construct a strategy instance
forwarder | a reference to the Forwarder, used to enable actions and accessors. Strategy subclasses should pass this reference, and should not keep a reference themselves. |
name | the strategy Name. It's recommended to include a version number as the last component. |
Definition at line 35 of file strategy.cpp.
|
virtual |
Definition at line 45 of file strategy.cpp.
|
pure virtual |
trigger after Interest is received
The Interest:
The strategy should decide whether and where to forward this Interest.
Implemented in nfd::fw::BestRouteStrategy, nfd::fw::BestRouteStrategy2, nfd::fw::BroadcastStrategy, nfd::fw::ClientControlStrategy, and nfd::fw::NccStrategy.
|
virtual |
trigger before PIT entry expires
PIT entry expires when InterestLifetime has elapsed for all InRecords, and it is not satisfied by an incoming Data.
This trigger is not invoked for PIT entry already satisfied.
In this base class this method does nothing.
Definition at line 58 of file strategy.cpp.
References NFD_LOG_DEBUG.
|
virtual |
trigger before PIT entry is satisfied
This trigger is invoked when an incoming Data satisfies the PIT entry. It can be invoked even if the PIT entry has already been satisfied.
In this base class this method does nothing.
Reimplemented in nfd::fw::NccStrategy.
Definition at line 50 of file strategy.cpp.
References nfd::Face::getId(), and NFD_LOG_DEBUG.
Definition at line 180 of file strategy.hpp.
References nfd::Forwarder::getFace().
Referenced by nfd::fw::ClientControlStrategy::afterReceiveInterest().
|
inlineprotected |
Definition at line 186 of file strategy.hpp.
References nfd::Forwarder::getFaceTable().
|
inlineprotected |
Definition at line 174 of file strategy.hpp.
Referenced by nfd::fw::NccStrategy::beforeSatisfyInterest(), nfd::fw::NccStrategy::getMeasurementsEntryInfo(), and nfd::fw::NccStrategy::timeoutOnBestFace().
|
inline |
a Name that represent the Strategy program
Definition at line 154 of file strategy.hpp.
Referenced by nfd::strategy_choice::Entry::getStrategyName().
|
inlineprotected |
decide that a pending Interest cannot be forwarded
This shall not be called if the pending Interest has been forwarded earlier, and does not need to be resent now.
Definition at line 168 of file strategy.hpp.
Referenced by nfd::fw::NccStrategy::afterReceiveInterest(), nfd::fw::ClientControlStrategy::afterReceiveInterest(), nfd::fw::BroadcastStrategy::afterReceiveInterest(), nfd::fw::BestRouteStrategy2::afterReceiveInterest(), and nfd::fw::BestRouteStrategy::afterReceiveInterest().
|
inlineprotected |
send Interest to outFace
Definition at line 160 of file strategy.hpp.
Referenced by nfd::fw::NccStrategy::afterReceiveInterest(), nfd::fw::ClientControlStrategy::afterReceiveInterest(), nfd::fw::BroadcastStrategy::afterReceiveInterest(), nfd::fw::BestRouteStrategy2::afterReceiveInterest(), nfd::fw::BestRouteStrategy::afterReceiveInterest(), and nfd::fw::NccStrategy::doPropagate().
Definition at line 138 of file strategy.hpp.
Definition at line 139 of file strategy.hpp.