NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
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-2018 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 "
ndn-cxx/detail/common.hpp
"
26
#include "
ndn-cxx/encoding/block.hpp
"
27
#include "
ndn-cxx/encoding/tlv.hpp
"
28
29
#include <map>
30
31
namespace
ndn
{
32
namespace
security {
33
namespace
v2 {
34
39
class
AdditionalDescription
40
{
41
public
:
42
class
Error
:
public
tlv::Error
43
{
44
public
:
45
using
tlv::Error::Error;
46
};
47
48
typedef
std::map<std::string, std::string>::iterator
iterator
;
49
typedef
std::map<std::string, std::string>::const_iterator
const_iterator
;
50
51
public
:
55
AdditionalDescription
() =
default
;
56
60
explicit
61
AdditionalDescription
(
const
Block
& block);
62
63
const
std::string&
64
get
(
const
std::string& key)
const
;
65
66
void
67
set
(
const
std::string& key,
const
std::string& value);
68
69
bool
70
has
(
const
std::string& key)
const
;
71
72
size_t
73
size
()
const
74
{
75
return
m_info.size();
76
}
77
78
bool
79
empty
()
const
80
{
81
return
m_info.empty();
82
}
83
84
iterator
85
begin
();
86
87
iterator
88
end
();
89
90
const_iterator
91
begin
()
const
;
92
93
const_iterator
94
end
()
const
;
95
98
template
<encoding::Tag TAG>
99
size_t
100
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
101
104
const
Block
&
105
wireEncode
()
const
;
106
110
void
111
wireDecode
(
const
Block
& wire);
112
113
public
:
// EqualityComparable concept
114
bool
115
operator==
(
const
AdditionalDescription
& other)
const
;
116
117
bool
118
operator!=
(
const
AdditionalDescription
& other)
const
;
119
120
private
:
121
std::map<std::string, std::string> m_info;
122
123
mutable
Block
m_wire;
124
};
125
126
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
AdditionalDescription
);
127
128
std::ostream&
129
operator<<
(std::ostream& os,
const
AdditionalDescription
& period);
130
131
}
// namespace v2
132
133
using
v2::AdditionalDescription
;
134
135
}
// namespace security
136
}
// namespace ndn
137
138
#endif // NDN_SECURITY_V2_ADDITIONAL_DESCRIPTION_HPP
tlv.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:49
ndn::security::v2::AdditionalDescription::end
iterator end()
Definition:
additional-description.cpp:74
ndn::security::v2::AdditionalDescription::empty
bool empty() const
Definition:
additional-description.hpp:79
ndn::security::v2::AdditionalDescription
Abstraction of AdditionalDescription.
Definition:
additional-description.hpp:39
ndn::security::v2::AdditionalDescription::Error
Definition:
additional-description.hpp:42
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::set
void set(const std::string &key, const std::string &value)
Definition:
additional-description.cpp:56
ndn::security::v2::AdditionalDescription::iterator
std::map< std::string, std::string >::iterator iterator
Definition:
additional-description.hpp:48
ndn::security::v2::AdditionalDescription::wireEncode
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
Definition:
additional-description.cpp:115
ndn::security::v2::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(AdditionalDescription)
ndn::security::v2::AdditionalDescription::get
const std::string & get(const std::string &key) const
Definition:
additional-description.cpp:46
ndn::security::v2::AdditionalDescription::operator==
bool operator==(const AdditionalDescription &other) const
Definition:
additional-description.cpp:166
nfd::cs::iterator
Table::const_iterator iterator
Definition:
cs-internal.hpp:41
common.hpp
import common constructs for ndn-cxx library internal use
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:36
ndn::security::v2::AdditionalDescription::AdditionalDescription
AdditionalDescription()=default
Create an empty AdditionalDescription.
ndn::security::v2::operator<<
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &other)
Definition:
additional-description.cpp:178
block.hpp
ndn::tlv::AdditionalDescription
Definition:
tlv.hpp:144
ndn::security::v2::AdditionalDescription::begin
iterator begin()
Definition:
additional-description.cpp:68
ndn::security::v2::AdditionalDescription::operator!=
bool operator!=(const AdditionalDescription &other) const
Definition:
additional-description.cpp:172
ndn::security::v2::AdditionalDescription::size
size_t size() const
Definition:
additional-description.hpp:73
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:52
ndnSIM
ndn-cxx
ndn-cxx
security
v2
additional-description.hpp
Generated on Sun Feb 24 2019 22:16:06 for ndnSIM by
1.8.15