NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
measurements.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_HPP
27
#define NFD_DAEMON_TABLE_MEASUREMENTS_HPP
28
29
#include "
measurements-entry.hpp
"
30
#include "
name-tree.hpp
"
31
32
namespace
nfd
{
33
34
namespace
fib {
35
class
Entry;
36
}
// namespace fib
37
38
namespace
pit {
39
class
Entry;
40
}
// namespace pit
41
42
namespace
measurements {
43
46
typedef
std::function<bool(const Entry&)>
EntryPredicate
;
47
50
class
AnyEntry
51
{
52
public
:
53
bool
54
operator()
(
const
Entry
& entry)
55
{
56
return
true
;
57
}
58
};
59
60
template
<
typename
T>
61
class
EntryWithStrategyInfo
62
{
63
public
:
64
bool
65
operator()
(
const
Entry
& entry)
66
{
67
return
entry.
getStrategyInfo
<T>() !=
nullptr
;
68
}
69
};
70
71
}
// namespace measurements
72
75
class
Measurements
: noncopyable
76
{
77
public
:
78
explicit
79
Measurements
(
NameTree
& nametree);
80
83
shared_ptr<measurements::Entry>
84
get
(
const
Name
&
name
);
85
88
shared_ptr<measurements::Entry>
89
get
(
const
fib::Entry
& fibEntry);
90
93
shared_ptr<measurements::Entry>
94
get
(
const
pit::Entry
& pitEntry);
95
99
shared_ptr<measurements::Entry>
100
getParent(
const
measurements::Entry
& child);
101
104
shared_ptr<measurements::Entry>
105
findLongestPrefixMatch(
const
Name
&
name
,
106
const
measurements::EntryPredicate
& pred =
107
measurements::AnyEntry
())
const
;
108
111
shared_ptr<measurements::Entry>
112
findLongestPrefixMatch(
const
pit::Entry
& pitEntry,
113
const
measurements::EntryPredicate
& pred =
114
measurements::AnyEntry
())
const
;
115
118
shared_ptr<measurements::Entry>
119
findExactMatch(
const
Name
& name)
const
;
120
121
static
time::nanoseconds
122
getInitialLifetime();
123
128
void
129
extendLifetime(
measurements::Entry
& entry,
const
time::nanoseconds& lifetime);
130
131
size_t
132
size()
const
;
133
134
private
:
135
void
136
cleanup(
measurements::Entry
& entry);
137
138
shared_ptr<measurements::Entry>
139
get
(
name_tree::Entry
& nte);
140
143
template
<
typename
K>
144
shared_ptr<measurements::Entry>
145
findLongestPrefixMatchImpl(
const
K& key,
const
measurements::EntryPredicate
& pred)
const
;
146
147
private
:
148
NameTree
& m_nameTree;
149
size_t
m_nItems;
150
};
151
152
inline
time::nanoseconds
153
Measurements::getInitialLifetime
()
154
{
155
return
time::seconds(4);
156
}
157
158
inline
size_t
159
Measurements::size
()
const
160
{
161
return
m_nItems;
162
}
163
164
}
// namespace nfd
165
166
#endif // NFD_DAEMON_TABLE_MEASUREMENTS_HPP
nfd::Measurements::size
size_t size() const
Definition:
measurements.hpp:159
nfd::fib::Entry
represents a FIB entry
Definition:
fib-entry.hpp:53
nfd::measurements::EntryPredicate
std::function< bool(const Entry &)> EntryPredicate
a predicate that accepts or rejects a Entry
Definition:
measurements.hpp:46
nfd::Measurements
represents the Measurements table
Definition:
measurements.hpp:75
nfd::measurements::EntryWithStrategyInfo::operator()
bool operator()(const Entry &entry)
Definition:
measurements.hpp:65
nfd::measurements::Entry
represents a Measurements entry
Definition:
measurements-entry.hpp:48
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::pit::Entry
represents a PIT entry
Definition:
pit-entry.hpp:69
nfd::measurements::EntryWithStrategyInfo
Definition:
measurements.hpp:61
nfd::NameTree
Class Name Tree.
Definition:
name-tree.hpp:79
measurements-entry.hpp
nfd::measurements::AnyEntry
an EntryPredicate that accepts any Entry
Definition:
measurements.hpp:50
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
nfd::StrategyInfoHost::getStrategyInfo
shared_ptr< T > getStrategyInfo() const
get a StrategyInfo item
Definition:
strategy-info-host.hpp:75
nfd::Measurements::getInitialLifetime
static time::nanoseconds getInitialLifetime()
Definition:
measurements.hpp:153
name-tree.hpp
nfd::measurements::AnyEntry::operator()
bool operator()(const Entry &entry)
Definition:
measurements.hpp:54
ndn::name
Definition:
name-component.cpp:37
nfd::name_tree::Entry
Name Tree Entry Class.
Definition:
name-tree-entry.hpp:65
ndnSIM
NFD
daemon
table
measurements.hpp
Generated on Sat Nov 12 2016 16:02:54 for ndnSIM by
1.8.12