NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
key-container.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_SECURITY_PIB_KEY_CONTAINER_HPP
23
#define NDN_SECURITY_PIB_KEY_CONTAINER_HPP
24
25
#include "
key.hpp
"
26
27
#include <set>
28
#include <unordered_map>
29
30
namespace
ndn
{
31
namespace
security {
32
namespace
pib {
33
34
class
PibImpl;
35
36
namespace
detail {
37
class
KeyImpl;
38
class
IdentityImpl;
39
}
// namespace detail
40
47
class
KeyContainer
: noncopyable
48
{
49
public
:
50
class
const_iterator
:
public
std::iterator
<std::forward_iterator_tag, const Key>
51
{
52
public
:
53
const_iterator
();
54
55
Key
56
operator*
();
57
58
const_iterator
&
59
operator++
();
60
61
const_iterator
62
operator++
(
int
);
63
64
bool
65
operator==
(
const
const_iterator
& other);
66
67
bool
68
operator!=
(
const
const_iterator
& other);
69
70
private
:
71
const_iterator
(std::set<Name>::const_iterator it,
const
KeyContainer
& container);
72
73
private
:
74
std::set<Name>::const_iterator m_it;
75
const
KeyContainer
* m_container;
76
77
friend
class
KeyContainer
;
78
};
79
80
typedef
const_iterator
iterator
;
81
82
public
:
83
const_iterator
84
begin
()
const
;
85
86
const_iterator
87
end
()
const
;
88
89
const_iterator
90
find
(
const
Name
& keyName)
const
;
91
92
size_t
93
size
()
const
;
94
101
Key
102
add
(
const
uint8_t* key,
size_t
keyLen,
const
Name
& keyName);
103
108
void
109
remove
(
const
Name
& keyName);
110
116
Key
117
get
(
const
Name
& keyName)
const
;
118
124
bool
125
isConsistent
()
const
;
126
127
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
132
KeyContainer
(
const
Name
& identity, shared_ptr<PibImpl>
pibImpl
);
133
134
const
std::set<Name>&
135
getKeyNames
()
const
136
{
137
return
m_keyNames;
138
}
139
140
const
std::unordered_map<Name, shared_ptr<detail::KeyImpl>>&
141
getLoadedKeys
()
const
142
{
143
return
m_keys;
144
}
145
146
private
:
147
Name
m_identity;
148
std::set<Name> m_keyNames;
150
mutable
std::unordered_map<Name, shared_ptr<detail::KeyImpl>> m_keys;
151
152
shared_ptr<PibImpl> m_pib;
153
154
friend
class
detail::IdentityImpl
;
155
};
156
157
}
// namespace pib
158
159
using
pib::KeyContainer
;
160
161
}
// namespace security
162
}
// namespace ndn
163
164
#endif // NDN_SECURITY_PIB_KEY_CONTAINER_HPP
ndn::security::pib::detail::IdentityImpl
Backend instance of Identity.
Definition:
identity-impl.hpp:43
ndn::security::pib::KeyContainer::find
const_iterator find(const Name &keyName) const
Definition:
key-container.cpp:104
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
key.hpp
ndn::security::pib::KeyContainer::iterator
const_iterator iterator
Definition:
key-container.hpp:80
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:43
ndn::security::pib::KeyContainer::begin
const_iterator begin() const
Definition:
key-container.cpp:92
ndn::security::pib::KeyContainer::getKeyNames
const std::set< Name > & getKeyNames() const
Definition:
key-container.hpp:135
ndn::security::pib::KeyContainer::const_iterator::operator==
bool operator==(const const_iterator &other)
Definition:
key-container.cpp:68
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
ndn::security::pib::KeyContainer::const_iterator::operator!=
bool operator!=(const const_iterator &other)
Definition:
key-container.cpp:78
ndn::security::pib::KeyContainer::const_iterator
Definition:
key-container.hpp:50
ndn::security::pib::KeyContainer
Container of keys of an identity.
Definition:
key-container.hpp:47
ndn::security::pib::KeyContainer::end
const_iterator end() const
Definition:
key-container.cpp:98
ndn::security::pib::Key
A frontend handle of a key instance.
Definition:
key.hpp:49
ndn::security::pib::KeyContainer::const_iterator::operator*
Key operator*()
Definition:
key-container.cpp:46
ndn::security::pib::KeyContainer::size
size_t size() const
Definition:
key-container.cpp:110
ndn::security::pib::KeyContainer::pibImpl
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE shared_ptr< PibImpl > pibImpl
Definition:
key-container.hpp:132
ndn::security::pib::KeyContainer::add
Key add(const uint8_t *key, size_t keyLen, const Name &keyName)
Add key of keyLen bytes with keyName into the container.
Definition:
key-container.cpp:116
ndn::security::pib::KeyContainer::isConsistent
bool isConsistent() const
Check if the container is consistent with the backend storage.
Definition:
key-container.cpp:165
ndn::Name
Represents an absolute name.
Definition:
name.hpp:42
ndn::security::pib::KeyContainer::const_iterator::operator++
const_iterator & operator++()
Definition:
key-container.cpp:53
ndn::security::pib::KeyContainer::getLoadedKeys
const std::unordered_map< Name, shared_ptr< detail::KeyImpl > > & getLoadedKeys() const
Definition:
key-container.hpp:141
ndn::security::pib::KeyContainer::const_iterator::const_iterator
const_iterator()
Definition:
key-container.cpp:33
ndnSIM
ndn-cxx
src
security
pib
key-container.hpp
Generated on Tue Aug 7 2018 16:19:16 for ndnSIM by
1.8.14