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
key-container.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#include "
key-container.hpp
"
23
#include "
pib-impl.hpp
"
24
25
namespace
ndn
{
26
namespace
security {
27
28
KeyContainer::const_iterator::const_iterator(
const
Name
& identity,
29
std::set<name::Component>::const_iterator it,
30
shared_ptr<PibImpl> impl)
31
: m_identity(identity)
32
, m_it(it)
33
, m_impl(impl)
34
{
35
}
36
37
Key
38
KeyContainer::const_iterator::operator*()
39
{
40
return
Key
(m_identity, *m_it, m_impl);
41
}
42
43
KeyContainer::const_iterator
&
44
KeyContainer::const_iterator::operator++()
45
{
46
++m_it;
47
return
*
this
;
48
}
49
50
KeyContainer::const_iterator
51
KeyContainer::const_iterator::operator++(
int
)
52
{
53
const_iterator
it(*
this
);
54
++m_it;
55
return
it;
56
}
57
58
bool
59
KeyContainer::const_iterator::operator==
(
const
const_iterator
& other)
60
{
61
return
(m_impl == other.m_impl && m_identity == other.m_identity && m_it == other.m_it);
62
}
63
64
bool
65
KeyContainer::const_iterator::operator!=
(
const
const_iterator
& other)
66
{
67
return
!(*
this
== other);
68
}
69
70
KeyContainer::KeyContainer()
71
{
72
}
73
74
KeyContainer::KeyContainer(
const
Name
& identity,
75
std::set<name::Component>&& keyIds,
76
shared_ptr<PibImpl> impl)
77
: m_identity(identity)
78
, m_keyIds(keyIds)
79
, m_impl(impl)
80
{
81
}
82
83
KeyContainer::const_iterator
84
KeyContainer::begin
()
const
85
{
86
return
const_iterator
(m_identity, m_keyIds.begin(), m_impl);
87
}
88
89
KeyContainer::const_iterator
90
KeyContainer::end
()
const
91
{
92
return
const_iterator
(m_identity, m_keyIds.end(), m_impl);
93
}
94
95
KeyContainer::const_iterator
96
KeyContainer::find
(
const
name::Component
& keyId)
const
97
{
98
return
const_iterator
(m_identity, m_keyIds.find(keyId), m_impl);
99
}
100
101
size_t
102
KeyContainer::size
()
const
103
{
104
return
m_keyIds.size();
105
}
106
107
}
// namespace security
108
}
// namespace ndn
key-container.hpp
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::KeyContainer::begin
const_iterator begin() const
Definition:
key-container.cpp:84
ndn::security::Key
represents a key
Definition:
key.hpp:45
ndn::security::KeyContainer::end
const_iterator end() const
Definition:
key-container.cpp:90
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::security::KeyContainer::size
size_t size() const
Definition:
key-container.cpp:102
ndn::security::KeyContainer::const_iterator
Definition:
key-container.hpp:37
ndn::security::KeyContainer::find
const_iterator find(const name::Component &keyId) const
Definition:
key-container.cpp:96
ns3::ndn::operator!=
bool operator!=(const GlobalRouter::Incidency &a, const GlobalRouter::Incidency &b)
Definition:
ndn-global-router.hpp:140
ndn::name::Component
Component holds a read-only name component value.
Definition:
name-component.hpp:47
pib-impl.hpp
ns3::ndn::operator==
bool operator==(const GlobalRouter::Incidency &a, const GlobalRouter::Incidency &b)
Definition:
ndn-global-router.hpp:133
ndnSIM
ndn-cxx
src
security
key-container.cpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11