NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
strategy.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #include "strategy.hpp"
27 #include "forwarder.hpp"
28 #include "core/logger.hpp"
29 
30 namespace nfd {
31 namespace fw {
32 
33 NFD_LOG_INIT("Strategy");
34 
35 Strategy::Strategy(Forwarder& forwarder, const Name& name)
36  : afterAddFace(forwarder.getFaceTable().onAdd)
37  , beforeRemoveFace(forwarder.getFaceTable().onRemove)
38  , m_name(name)
39  , m_forwarder(forwarder)
40  , m_measurements(m_forwarder.getMeasurements(),
41  m_forwarder.getStrategyChoice(), this)
42 {
43 }
44 
46 {
47 }
48 
49 void
50 Strategy::beforeSatisfyInterest(shared_ptr<pit::Entry> pitEntry,
51  const Face& inFace, const Data& data)
52 {
53  NFD_LOG_DEBUG("beforeSatisfyInterest pitEntry=" << pitEntry->getName() <<
54  " inFace=" << inFace.getId() << " data=" << data.getName());
55 }
56 
57 void
58 Strategy::beforeExpirePendingInterest(shared_ptr<pit::Entry> pitEntry)
59 {
60  NFD_LOG_DEBUG("beforeExpirePendingInterest pitEntry=" << pitEntry->getName());
61 }
62 
63 //void
64 //Strategy::afterAddFibEntry(shared_ptr<fib::Entry> fibEntry)
65 //{
66 // NFD_LOG_DEBUG("afterAddFibEntry fibEntry=" << fibEntry->getPrefix());
67 //}
68 //
69 //void
70 //Strategy::afterUpdateFibEntry(shared_ptr<fib::Entry> fibEntry)
71 //{
72 // NFD_LOG_DEBUG("afterUpdateFibEntry fibEntry=" << fibEntry->getPrefix());
73 //}
74 //
75 //void
76 //Strategy::beforeRemoveFibEntry(shared_ptr<fib::Entry> fibEntry)
77 //{
78 // NFD_LOG_DEBUG("beforeRemoveFibEntry fibEntry=" << fibEntry->getPrefix());
79 //}
80 
81 } // namespace fw
82 } // namespace nfd
#define NFD_LOG_DEBUG(expression)
Definition: logger.hpp:36
virtual void beforeSatisfyInterest(shared_ptr< pit::Entry > pitEntry, const Face &inFace, const Data &data)
trigger before PIT entry is satisfied
Definition: strategy.cpp:50
main class of NFD
Definition: forwarder.hpp:54
represents a face
Definition: face.hpp:59
virtual void beforeExpirePendingInterest(shared_ptr< pit::Entry > pitEntry)
trigger before PIT entry expires
Definition: strategy.cpp:58
virtual ~Strategy()
Definition: strategy.cpp:45
Strategy(Forwarder &forwarder, const Name &name)
construct a strategy instance
Definition: strategy.cpp:35
#define NFD_LOG_INIT(name)
Definition: logger.hpp:33
FaceId getId() const
Definition: face.cpp:51