26 #ifndef NFD_DAEMON_FW_STRATEGY_HPP 27 #define NFD_DAEMON_FW_STRATEGY_HPP 38 class Strategy :
public enable_shared_from_this<Strategy>, noncopyable
81 shared_ptr<fib::Entry> fibEntry,
82 shared_ptr<pit::Entry> pitEntry) = 0;
96 const Face& inFace,
const Data& data);
131 shared_ptr<fib::Entry> fibEntry, shared_ptr<pit::Entry> pitEntry);
141 sendInterest(shared_ptr<pit::Entry> pitEntry, shared_ptr<Face> outFace,
142 bool wantNewNonce =
false);
161 sendNack(shared_ptr<pit::Entry> pitEntry,
const Face& outFace,
173 std::initializer_list<const Face*> exceptFaces = std::initializer_list<const Face*>());
209 shared_ptr<Face> outFace,
212 m_forwarder.onOutgoingInterest(pitEntry, *outFace, wantNewNonce);
218 m_forwarder.onInterestReject(pitEntry);
225 m_forwarder.onOutgoingNack(pitEntry, outFace, header);
231 return m_measurements;
234 inline shared_ptr<Face>
237 return m_forwarder.
getFace(
id);
249 #endif // NFD_DAEMON_FW_STRATEGY_HPP const Name & getName() const
a Name that represent the Strategy program
FaceTable & getFaceTable()
signal::Signal< FaceTable, shared_ptr< Face > > & afterAddFace
virtual void beforeSatisfyInterest(shared_ptr< pit::Entry > pitEntry, const Face &inFace, const Data &data)
trigger before PIT entry is satisfied
represents an Interest packet
provides a lightweight signal / event system
represents a Network Nack
void sendNacks(shared_ptr< pit::Entry > pitEntry, const lp::NackHeader &header, std::initializer_list< const Face *> exceptFaces=std::initializer_list< const Face *>())
send Nack to every face that has an in-record, except those in exceptFaces
shared_ptr< Face > getFace(FaceId id)
virtual void beforeExpirePendingInterest(shared_ptr< pit::Entry > pitEntry)
trigger before PIT entry expires
MeasurementsAccessor & getMeasurements()
allows Strategy to access portion of Measurements table under its namespace
Copyright (c) 2011-2015 Regents of the University of California.
#define VIRTUAL_WITH_TESTS
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
const FaceTable & getFaceTable()
Strategy(Forwarder &forwarder, const Name &name)
construct a strategy instance
Name abstraction to represent an absolute name.
shared_ptr< Face > getFace(FaceId id) const
get existing Face
void rejectPendingInterest(shared_ptr< pit::Entry > pitEntry)
decide that a pending Interest cannot be forwarded
represents a forwarding strategy
signal::Signal< FaceTable, shared_ptr< Face > > & beforeRemoveFace
void sendInterest(shared_ptr< pit::Entry > pitEntry, shared_ptr< Face > outFace, bool wantNewNonce=false)
send Interest to outFace
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
void sendNack(shared_ptr< pit::Entry > pitEntry, const Face &outFace, const lp::NackHeader &header)
send Nack to outFace
virtual void afterReceiveNack(const Face &inFace, const lp::Nack &nack, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry)
trigger after Nack is received
uint64_t FaceId
identifies a face