NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
45
Strategy::~Strategy
()
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
NFD_LOG_DEBUG
#define NFD_LOG_DEBUG(expression)
Definition:
logger.hpp:36
nfd::fw::Strategy::beforeSatisfyInterest
virtual void beforeSatisfyInterest(shared_ptr< pit::Entry > pitEntry, const Face &inFace, const Data &data)
trigger before PIT entry is satisfied
Definition:
strategy.cpp:50
nfd::Forwarder
main class of NFD
Definition:
forwarder.hpp:54
logger.hpp
nfd::Face
represents a face
Definition:
face.hpp:57
forwarder.hpp
ndn::Data::getName
const Name & getName() const
Get name of the Data packet.
Definition:
data.hpp:343
nfd::fw::Strategy::beforeExpirePendingInterest
virtual void beforeExpirePendingInterest(shared_ptr< pit::Entry > pitEntry)
trigger before PIT entry expires
Definition:
strategy.cpp:58
nfd::fw::Strategy::~Strategy
virtual ~Strategy()
Definition:
strategy.cpp:45
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::fw::Strategy::Strategy
Strategy(Forwarder &forwarder, const Name &name)
construct a strategy instance
Definition:
strategy.cpp:35
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
strategy.hpp
NFD_LOG_INIT
#define NFD_LOG_INIT(name)
Definition:
logger.hpp:33
nfd::Face::getId
FaceId getId() const
Definition:
face.hpp:221
ndn::Data
represents a Data packet
Definition:
data.hpp:39
ndn::name
Definition:
name-component.cpp:37
ndnSIM
NFD
daemon
fw
strategy.cpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11