NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
measurements-accessor.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
27
#define NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
28
29
#include "
measurements.hpp
"
30
#include "
strategy-choice.hpp
"
31
32
namespace
nfd
{
33
34
namespace
fw {
35
class
Strategy
;
36
}
// namespace fw
37
38
namespace
measurements {
39
45
class
MeasurementsAccessor
: noncopyable
46
{
47
public
:
48
MeasurementsAccessor
(
Measurements
& measurements,
const
StrategyChoice
& strategyChoice,
49
const
fw::Strategy
& strategy);
50
51
~
MeasurementsAccessor
();
52
55
Entry
*
56
get
(
const
Name
&
name
);
57
60
Entry
*
61
get
(
const
fib::Entry
& fibEntry);
62
65
Entry
*
66
get
(
const
pit::Entry
& pitEntry);
67
70
Entry
*
71
getParent(
const
Entry
& child);
72
75
Entry
*
76
findLongestPrefixMatch(
const
Name
&
name
,
77
const
EntryPredicate
& pred =
78
AnyEntry
())
const
;
79
82
Entry
*
83
findLongestPrefixMatch(
const
pit::Entry
& pitEntry,
84
const
EntryPredicate
& pred =
85
AnyEntry
())
const
;
86
89
Entry
*
90
findExactMatch(
const
Name
& name)
const
;
91
96
void
97
extendLifetime(
Entry
& entry,
const
time::nanoseconds& lifetime);
98
99
private
:
103
Entry
*
104
filter(
Entry
* entry)
const
;
105
106
Entry
*
107
filter(
Entry
& entry)
const
;
108
109
private
:
110
Measurements
& m_measurements;
111
const
StrategyChoice
& m_strategyChoice;
112
const
fw::Strategy
* m_strategy;
113
};
114
115
inline
Entry
*
116
MeasurementsAccessor::filter(
Entry
& entry)
const
117
{
118
return
this->filter(&entry);
119
}
120
121
inline
Entry
*
122
MeasurementsAccessor::get(
const
Name
&
name
)
123
{
124
return
this->filter(m_measurements.get(name));
125
}
126
127
inline
Entry
*
128
MeasurementsAccessor::get(
const
fib::Entry
& fibEntry)
129
{
130
return
this->filter(m_measurements.get(fibEntry));
131
}
132
133
inline
Entry
*
134
MeasurementsAccessor::get(
const
pit::Entry
& pitEntry)
135
{
136
return
this->filter(m_measurements.get(pitEntry));
137
}
138
139
inline
Entry
*
140
MeasurementsAccessor::getParent(
const
Entry
& child)
141
{
142
return
this->filter(m_measurements.getParent(child));
143
}
144
145
inline
Entry
*
146
MeasurementsAccessor::findLongestPrefixMatch(
const
Name
&
name
,
147
const
EntryPredicate
& pred)
const
148
{
149
return
this->filter(m_measurements.findLongestPrefixMatch(name, pred));
150
}
151
152
inline
Entry
*
153
MeasurementsAccessor::findLongestPrefixMatch(
const
pit::Entry
& pitEntry,
154
const
EntryPredicate
& pred)
const
155
{
156
return
this->filter(m_measurements.findLongestPrefixMatch(pitEntry, pred));
157
}
158
159
inline
Entry
*
160
MeasurementsAccessor::findExactMatch(
const
Name
&
name
)
const
161
{
162
return
this->filter(m_measurements.findExactMatch(name));
163
}
164
165
inline
void
166
MeasurementsAccessor::extendLifetime(
Entry
& entry,
const
time::nanoseconds& lifetime)
167
{
168
m_measurements.extendLifetime(entry, lifetime);
169
}
170
171
}
// namespace measurements
172
173
using
measurements::MeasurementsAccessor
;
174
175
}
// namespace nfd
176
177
#endif // NFD_DAEMON_TABLE_MEASUREMENTS_ACCESSOR_HPP
nfd::fib::Entry
represents a FIB entry
Definition:
fib-entry.hpp:51
strategy-choice.hpp
nfd::measurements::EntryPredicate
std::function< bool(const Entry &)> EntryPredicate
a predicate that accepts or rejects an entry
Definition:
measurements.hpp:46
nfd::strategy_choice::StrategyChoice
StrategyChoice
Definition:
strategy-choice.cpp:40
nfd::measurements::Entry
represents a Measurements entry
Definition:
measurements-entry.hpp:42
nfd::fw::Strategy
Strategy
Definition:
strategy.cpp:36
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::pit::Entry
an Interest table entry
Definition:
pit-entry.hpp:57
nfd::measurements::Measurements
represents the Measurements table
Definition:
measurements.hpp:75
nfd::measurements::AnyEntry
an EntryPredicate that accepts any entry
Definition:
measurements.hpp:50
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
nfd::fw::Strategy
represents a forwarding strategy
Definition:
strategy.hpp:37
nfd::measurements::MeasurementsAccessor
allows Strategy to access portion of Measurements table under its namespace
Definition:
measurements-accessor.hpp:45
measurements.hpp
ndn::name
Definition:
name-component.cpp:37
ndnSIM
NFD
daemon
table
measurements-accessor.hpp
Generated on Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11