NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
pit-iterator.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
pit-iterator.hpp
"
27
28
#include <boost/concept/assert.hpp>
29
#include <boost/concept_check.hpp>
30
#include <type_traits>
31
32
namespace
nfd
{
33
namespace
pit {
34
35
BOOST_CONCEPT_ASSERT((boost::ForwardIterator<Iterator>));
36
static_assert(std::is_default_constructible<Iterator>::value,
37
"Iterator must be default-constructible"
);
38
39
Iterator::Iterator
(
const
NameTree::const_iterator
& ntIt,
size_t
iPitEntry)
40
: m_ntIt(ntIt)
41
, m_iPitEntry(iPitEntry)
42
{
43
}
44
45
Iterator
&
46
Iterator::operator++
()
47
{
48
BOOST_ASSERT(m_ntIt !=
NameTree::const_iterator
());
49
BOOST_ASSERT(m_iPitEntry < m_ntIt->getPitEntries().size());
50
51
if
(++m_iPitEntry >= m_ntIt->
getPitEntries
().size()) {
52
++m_ntIt;
53
m_iPitEntry = 0;
54
BOOST_ASSERT(m_ntIt ==
NameTree::const_iterator
() || m_ntIt->
hasPitEntries
());
55
}
56
57
return
*
this
;
58
}
59
60
Iterator
61
Iterator::operator++
(
int
)
62
{
63
Iterator
copy = *
this
;
64
this->
operator++
();
65
return
copy;
66
}
67
68
}
// namespace pit
69
}
// namespace nfd
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:39
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
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::name_tree::Iterator
NameTree iterator.
Definition:
name-tree-iterator.hpp:72
nfd::name_tree::Entry::hasPitEntries
bool hasPitEntries() const
Definition:
name-tree-entry.hpp:120
nfd::pit::Iterator::operator++
Iterator & operator++()
Definition:
pit-iterator.cpp:46
ndnSIM
NFD
daemon
table
pit-iterator.cpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13