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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
pit.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_TABLE_PIT_HPP
27
#define NFD_DAEMON_TABLE_PIT_HPP
28
29
#include "
name-tree.hpp
"
30
#include "
pit-entry.hpp
"
31
32
namespace
nfd {
33
namespace
pit {
34
42
typedef
std::vector<shared_ptr<pit::Entry>>
DataMatchResult
;
43
44
}
// namespace pit
45
48
class
Pit
: noncopyable
49
{
50
public
:
51
explicit
52
Pit
(
NameTree
& nameTree);
53
54
~Pit
();
55
58
size_t
59
size
()
const
;
60
66
std::pair<shared_ptr<pit::Entry>,
bool
>
67
insert
(
const
Interest& interest);
68
72
pit::DataMatchResult
73
findAllDataMatches
(
const
Data& data)
const
;
74
78
void
79
erase
(shared_ptr<pit::Entry> pitEntry);
80
81
public
:
// enumeration
82
class
const_iterator
;
83
89
const_iterator
90
begin
()
const
;
91
96
const_iterator
97
end
()
const
;
98
99
class
const_iterator
:
public
std::iterator<std::forward_iterator_tag, const pit::Entry>
100
{
101
public
:
102
const_iterator
();
103
104
explicit
105
const_iterator
(
const
NameTree::const_iterator
& it);
106
107
~const_iterator
();
108
109
const
pit::Entry
&
110
operator*
()
const
;
111
112
shared_ptr<pit::Entry>
113
operator->
()
const
;
114
115
const_iterator
&
116
operator++
();
117
118
const_iterator
119
operator++
(
int
);
120
121
bool
122
operator==
(
const
const_iterator
& other)
const
;
123
124
bool
125
operator!=
(
const
const_iterator
& other)
const
;
126
127
private
:
128
NameTree::const_iterator
m_nameTreeIterator;
134
size_t
m_iPitEntry;
135
};
136
137
private
:
138
NameTree
& m_nameTree;
139
size_t
m_nItems;
140
};
141
142
inline
size_t
143
Pit::size
()
const
144
{
145
return
m_nItems;
146
}
147
148
inline
Pit::const_iterator
149
Pit::end
()
const
150
{
151
return
const_iterator
(m_nameTree.
end
());
152
}
153
154
inline
155
Pit::const_iterator::const_iterator
()
156
: m_iPitEntry(0)
157
{
158
}
159
160
inline
161
Pit::const_iterator::const_iterator
(
const
NameTree::const_iterator
& it)
162
: m_nameTreeIterator(it)
163
, m_iPitEntry(0)
164
{
165
}
166
167
inline
168
Pit::const_iterator::~const_iterator
()
169
{
170
}
171
172
inline
Pit::const_iterator
173
Pit::const_iterator::operator++
(
int
)
174
{
175
Pit::const_iterator
temp(*
this
);
176
++(*this);
177
return
temp;
178
}
179
180
inline
Pit::const_iterator
&
181
Pit::const_iterator::operator++
()
182
{
183
++m_iPitEntry;
184
if
(m_iPitEntry < m_nameTreeIterator->getPitEntries().
size
()) {
185
return
*
this
;
186
}
187
188
++m_nameTreeIterator;
189
m_iPitEntry = 0;
190
return
*
this
;
191
}
192
193
inline
const
pit::Entry
&
194
Pit::const_iterator::operator*
()
const
195
{
196
return
*(this->operator->());
197
}
198
199
inline
shared_ptr<pit::Entry>
200
Pit::const_iterator::operator->
()
const
201
{
202
return
m_nameTreeIterator->getPitEntries().at(m_iPitEntry);
203
}
204
205
inline
bool
206
Pit::const_iterator::operator==
(
const
Pit::const_iterator
& other)
const
207
{
208
return
m_nameTreeIterator == other.m_nameTreeIterator &&
209
m_iPitEntry == other.m_iPitEntry;
210
}
211
212
inline
bool
213
Pit::const_iterator::operator!=
(
const
Pit::const_iterator
& other)
const
214
{
215
return
!(*
this
== other);
216
}
217
218
}
// namespace nfd
219
220
#endif // NFD_DAEMON_TABLE_PIT_HPP
nfd::Pit::const_iterator::operator!=
bool operator!=(const const_iterator &other) const
Definition:
pit.hpp:213
nfd::Pit::const_iterator::operator==
bool operator==(const const_iterator &other) const
Definition:
pit.hpp:206
nfd::Pit::erase
void erase(shared_ptr< pit::Entry > pitEntry)
erases a PIT Entry
Definition:
pit.cpp:108
nfd::Pit::size
size_t size() const
Definition:
pit.hpp:143
nfd::NameTree::end
const_iterator end() const
Get an iterator referring to the past-the-end FIB entry.
Definition:
name-tree.hpp:378
nfd::Pit::const_iterator::const_iterator
const_iterator()
Definition:
pit.hpp:155
nfd::Pit::findAllDataMatches
pit::DataMatchResult findAllDataMatches(const Data &data) const
performs a Data match
Definition:
pit.cpp:91
nfd::Pit
represents the Interest Table
Definition:
pit.hpp:48
nfd::NameTree::const_iterator
Definition:
name-tree.hpp:251
nfd::Pit::Pit
Pit(NameTree &nameTree)
Definition:
pit.cpp:54
pit-entry.hpp
nfd::Pit::end
const_iterator end() const
returns an iterator referring to the past-the-end PIT entry
Definition:
pit.hpp:149
nfd::pit::Entry
represents a PIT entry
Definition:
pit-entry.hpp:67
nfd::NameTree
Class Name Tree.
Definition:
name-tree.hpp:79
nfd::Pit::const_iterator
Definition:
pit.hpp:99
nfd::Pit::insert
std::pair< shared_ptr< pit::Entry >, bool > insert(const Interest &interest)
inserts a PIT entry for Interest
Definition:
pit.cpp:65
nfd::Pit::begin
const_iterator begin() const
returns an iterator pointing to the first PIT entry
Definition:
pit.cpp:120
nfd::Pit::const_iterator::operator*
const pit::Entry & operator*() const
Definition:
pit.hpp:194
name-tree.hpp
nfd::Pit::const_iterator::~const_iterator
~const_iterator()
Definition:
pit.hpp:168
nfd::Pit::const_iterator::operator->
shared_ptr< pit::Entry > operator->() const
Definition:
pit.hpp:200
nfd::Pit::const_iterator::operator++
const_iterator & operator++()
Definition:
pit.hpp:181
nfd::Pit::~Pit
~Pit()
Definition:
pit.cpp:60
nfd::pit::DataMatchResult
std::vector< shared_ptr< pit::Entry > > DataMatchResult
Definition:
pit.hpp:42
ndnSIM
NFD
daemon
table
pit.hpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7