NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
pit-iterator.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_ITERATOR_HPP
27
#define NFD_DAEMON_TABLE_PIT_ITERATOR_HPP
28
29
#include "
name-tree.hpp
"
30
#include "
pit-entry.hpp
"
31
32
namespace
nfd
{
33
namespace
pit {
34
37
class
Iterator
:
public
std::iterator
<std::forward_iterator_tag, const Entry>
38
{
39
public
:
44
explicit
45
Iterator
(
const
NameTree::const_iterator
& ntIt =
NameTree::const_iterator
(),
size_t
iPitEntry = 0);
46
47
const
Entry
&
48
operator*
()
const
49
{
50
return
*this->
operator->
();
51
}
52
53
const
shared_ptr<Entry>&
54
operator->
()
const
55
{
56
BOOST_ASSERT(m_ntIt !=
NameTree::const_iterator
());
57
BOOST_ASSERT(m_iPitEntry < m_ntIt->getPitEntries().size());
58
return
m_ntIt->
getPitEntries
()[m_iPitEntry];
59
}
60
61
Iterator
&
62
operator++
();
63
64
Iterator
65
operator++
(
int
);
66
67
bool
68
operator==
(
const
Iterator
& other)
const
69
{
70
return
m_ntIt == other.m_ntIt && m_iPitEntry == other.m_iPitEntry;
71
}
72
73
bool
74
operator!=
(
const
Iterator
& other)
const
75
{
76
return
!this->
operator==
(other);
77
}
78
79
private
:
80
NameTree::const_iterator
m_ntIt;
81
size_t
m_iPitEntry;
82
};
83
84
}
// namespace pit
85
}
// namespace nfd
86
87
#endif // NFD_DAEMON_TABLE_PIT_ITERATOR_HPP
nfd::pit::Iterator::Iterator
Iterator(const NameTree::const_iterator &ntIt=NameTree::const_iterator(), size_t iPitEntry=0)
constructor
Definition:
pit-iterator.cpp:34
nfd::name_tree::Entry::getPitEntries
const std::vector< shared_ptr< pit::Entry > > & getPitEntries() const
Definition:
name-tree-entry.hpp:126
nfd::pit::Iterator
PIT iterator.
Definition:
pit-iterator.hpp:37
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
pit-entry.hpp
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::name_tree::Iterator
NameTree iterator.
Definition:
name-tree-iterator.hpp:72
nfd::pit::Iterator::operator==
bool operator==(const Iterator &other) const
Definition:
pit-iterator.hpp:68
nfd::pit::Iterator::operator->
const shared_ptr< Entry > & operator->() const
Definition:
pit-iterator.hpp:54
name-tree.hpp
nfd::pit::Iterator::operator++
Iterator & operator++()
Definition:
pit-iterator.cpp:41
nfd::pit::Iterator::operator!=
bool operator!=(const Iterator &other) const
Definition:
pit-iterator.hpp:74
nfd::pit::Iterator::operator*
const Entry & operator*() const
Definition:
pit-iterator.hpp:48
ndnSIM
NFD
daemon
table
pit-iterator.hpp
Generated on Sun Feb 25 2018 13:27:06 for ndnSIM by
1.8.14