NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
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:53
strategy-choice.hpp
nfd::measurements::MeasurementsAccessor::extendLifetime
void extendLifetime(Entry &entry, const time::nanoseconds &lifetime)
extend lifetime of an entry
Definition:
measurements-accessor.hpp:166
nfd::measurements::MeasurementsAccessor::findLongestPrefixMatch
Entry * findLongestPrefixMatch(const Name &name, const EntryPredicate &pred=AnyEntry()) const
perform a longest prefix match for name
Definition:
measurements-accessor.hpp:146
nfd::measurements::Entry
Represents a Measurements entry.
Definition:
measurements-entry.hpp:41
nfd::measurements::EntryPredicate
std::function< bool(const Entry &)> EntryPredicate
A predicate that accepts or rejects an entry.
Definition:
measurements.hpp:46
nfd::fw::Strategy
Strategy
Definition:
strategy.cpp:38
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:39
nfd::pit::Entry
An Interest table entry.
Definition:
pit-entry.hpp:58
nfd::measurements::Measurements
The Measurements table.
Definition:
measurements.hpp:79
nfd::measurements::AnyEntry
An EntryPredicate that accepts any entry.
Definition:
measurements.hpp:50
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
nfd::fw::Strategy
Represents a forwarding strategy.
Definition:
strategy.hpp:38
nfd::measurements::MeasurementsAccessor
allows Strategy to access portion of Measurements table under its namespace
Definition:
measurements-accessor.hpp:45
nfd::strategy_choice::StrategyChoice
Represents the Strategy Choice table.
Definition:
strategy-choice.hpp:51
nfd::measurements::MeasurementsAccessor::get
Entry * get(const Name &name)
find or insert a Measurements entry for name
Definition:
measurements-accessor.hpp:122
nfd::measurements::MeasurementsAccessor::findExactMatch
Entry * findExactMatch(const Name &name) const
perform an exact match
Definition:
measurements-accessor.hpp:160
measurements.hpp
ndn::name
Definition:
name-component-types.hpp:33
ndn::time::nanoseconds
boost::chrono::nanoseconds nanoseconds
Definition:
time.hpp:50
nfd::measurements::MeasurementsAccessor::getParent
Entry * getParent(const Entry &child)
find or insert a Measurements entry for child's parent
Definition:
measurements-accessor.hpp:140
ndnSIM
NFD
daemon
table
measurements-accessor.hpp
Generated on Fri May 6 2022 12:34:14 for ndnSIM by
1.8.13