NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
additional-description.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2017 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_SECURITY_V2_ADDITIONAL_DESCRIPTION_HPP
23
#define NDN_SECURITY_V2_ADDITIONAL_DESCRIPTION_HPP
24
25
#include "../../common.hpp"
26
#include "../../encoding/tlv.hpp"
27
#include "../../encoding/block.hpp"
28
#include <map>
29
30
namespace
ndn
{
31
namespace
security
{
32
namespace
v2 {
33
38
class
AdditionalDescription
39
{
40
public
:
41
class
Error
:
public
tlv::Error
42
{
43
public
:
44
explicit
45
Error
(
const
std::string& what)
46
: tlv::
Error
(what)
47
{
48
}
49
};
50
51
typedef
std::map<std::string, std::string>::iterator
iterator
;
52
typedef
std::map<std::string, std::string>::const_iterator
const_iterator
;
53
54
public
:
58
AdditionalDescription
() =
default
;
59
63
explicit
64
AdditionalDescription
(
const
Block
& block);
65
66
const
std::string&
67
get
(
const
std::string& key)
const
;
68
69
void
70
set
(
const
std::string& key,
const
std::string&
value
);
71
72
bool
73
has
(
const
std::string& key)
const
;
74
75
size_t
76
size
()
const
77
{
78
return
m_info.size();
79
}
80
81
bool
82
empty
()
const
83
{
84
return
m_info.empty();
85
}
86
87
iterator
88
begin
();
89
90
iterator
91
end
();
92
93
const_iterator
94
begin
()
const
;
95
96
const_iterator
97
end
()
const
;
98
101
template
<encoding::Tag TAG>
102
size_t
103
wireEncode
(EncodingImpl<TAG>& encoder)
const
;
104
107
const
Block
&
108
wireEncode
()
const
;
109
113
void
114
wireDecode
(
const
Block
& wire);
115
116
public
:
// EqualityComparable concept
117
bool
118
operator==
(
const
AdditionalDescription
& other)
const
;
119
120
bool
121
operator!=
(
const
AdditionalDescription
& other)
const
;
122
123
private
:
124
std::map<std::string, std::string> m_info;
125
126
mutable
Block
m_wire;
127
};
128
129
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
AdditionalDescription
);
130
131
std::ostream&
132
operator<<
(std::ostream& os,
const
AdditionalDescription
& period);
133
134
}
// namespace v2
135
136
using
v2::AdditionalDescription
;
137
138
}
// namespace security
139
}
// namespace ndn
140
141
#endif // NDN_SECURITY_V2_ADDITIONAL_DESCRIPTION_HPP
ndn::security::v2::AdditionalDescription::has
bool has(const std::string &key) const
Definition:
additional-description.cpp:62
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::AdditionalDescription::const_iterator
std::map< std::string, std::string >::const_iterator const_iterator
Definition:
additional-description.hpp:52
ndn::security::v2::AdditionalDescription::operator==
bool operator==(const AdditionalDescription &other) const
Definition:
additional-description.cpp:166
ndn::security::v2::AdditionalDescription::end
iterator end()
Definition:
additional-description.cpp:74
ndn::security::v2::AdditionalDescription
Abstraction of AdditionalDescription.
Definition:
additional-description.hpp:38
ndn::security::v2::AdditionalDescription::wireEncode
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
Definition:
additional-description.cpp:115
ndn::security::v2::AdditionalDescription::Error
Definition:
additional-description.hpp:41
ndn::security::v2::AdditionalDescription::wireDecode
void wireDecode(const Block &wire)
Decode ValidityPeriod from TLV block.
Definition:
additional-description.cpp:133
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
ndn::security::v2::AdditionalDescription::iterator
std::map< std::string, std::string >::iterator iterator
Definition:
additional-description.hpp:51
ndn::security::v2::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(AdditionalDescription)
websocketpp::transport::asio::socket::error::security
Catch-all error for security policy errors that don't fit in other categories.
Definition:
base.hpp:79
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
ndn::security::v2::AdditionalDescription::operator!=
bool operator!=(const AdditionalDescription &other) const
Definition:
additional-description.cpp:172
ndn::security::v2::AdditionalDescription::empty
bool empty() const
Definition:
additional-description.hpp:82
ndn::security::v2::AdditionalDescription::AdditionalDescription
AdditionalDescription()=default
Create an empty AdditionalDescription.
ndn::security::v2::AdditionalDescription::Error::Error
Error(const std::string &what)
Definition:
additional-description.hpp:45
ndn::security::v2::operator<<
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &other)
Definition:
additional-description.cpp:178
ndn::security::v2::AdditionalDescription::begin
iterator begin()
Definition:
additional-description.cpp:68
ndn::security::v2::AdditionalDescription::size
size_t size() const
Definition:
additional-description.hpp:76
ndn::tlv::AdditionalDescription
Definition:
tlv.hpp:117
websocketpp::session::state::value
value
Definition:
connection.hpp:179
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndnSIM
ndn-cxx
src
security
v2
additional-description.hpp
Generated on Thu Nov 2 2017 03:30:28 for ndnSIM by
1.8.11