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 38 of file strategy.hpp.
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.
|
inline |
a Name that represent the Strategy program
Definition at line 155 of file strategy.hpp.
Referenced by nfd::clearStrategyInfo(), and nfd::strategy_choice::Entry::getStrategyName().
|
pure virtual |
trigger after Interest is received
The Interest:
The strategy should decide whether and where to forward this Interest.
Implemented in nfd::fw::AccessStrategy, nfd::fw::BestRouteStrategy, nfd::fw::BestRouteStrategy2, nfd::fw::ClientControlStrategy, nfd::fw::NccStrategy, nfd::fw::BroadcastStrategy, and nfd::fw::MulticastStrategy.
|
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::AccessStrategy, and nfd::fw::NccStrategy.
Definition at line 50 of file strategy.cpp.
References nfd::Face::getId(), ndn::Data::getName(), and NFD_LOG_DEBUG.
|
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.
|
inlineprotected |
send Interest to outFace
Definition at line 161 of file strategy.hpp.
Referenced by nfd::fw::MulticastStrategy::afterReceiveInterest(), nfd::fw::NccStrategy::afterReceiveInterest(), nfd::fw::ClientControlStrategy::afterReceiveInterest(), nfd::fw::BestRouteStrategy2::afterReceiveInterest(), nfd::fw::BestRouteStrategy::afterReceiveInterest(), nfd::fw::AccessStrategy::afterReceiveInterest(), and nfd::fw::NccStrategy::doPropagate().
|
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 169 of file strategy.hpp.
Referenced by nfd::fw::MulticastStrategy::afterReceiveInterest(), nfd::fw::NccStrategy::afterReceiveInterest(), nfd::fw::ClientControlStrategy::afterReceiveInterest(), nfd::fw::BestRouteStrategy2::afterReceiveInterest(), and nfd::fw::BestRouteStrategy::afterReceiveInterest().
|
inlineprotected |
Definition at line 175 of file strategy.hpp.
Referenced by nfd::fw::NccStrategy::beforeSatisfyInterest(), nfd::fw::AccessStrategy::beforeSatisfyInterest(), nfd::fw::NccStrategy::getMeasurementsEntryInfo(), and nfd::fw::NccStrategy::timeoutOnBestFace().
Definition at line 181 of file strategy.hpp.
References nfd::Forwarder::getFace().
Referenced by nfd::fw::ClientControlStrategy::afterReceiveInterest(), and nfd::fw::AccessStrategy::afterReceiveInterest().
|
inlineprotected |
Definition at line 187 of file strategy.hpp.
References nfd::Forwarder::getFaceTable().
|
protected |
Definition at line 139 of file strategy.hpp.
|
protected |
Definition at line 140 of file strategy.hpp.