NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
metadata-object.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2021 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
* @author Chavoosh Ghasemi <chghasemi@cs.arizona.edu>
22
*/
23
24
#ifndef NDN_CXX_METADATA_OBJECT_HPP
25
#define NDN_CXX_METADATA_OBJECT_HPP
26
27
#include "
ndn-cxx/data.hpp
"
28
#include "
ndn-cxx/interest.hpp
"
29
#include "
ndn-cxx/security/key-chain.hpp
"
30
31
namespace
ndn
{
32
48
class
MetadataObject
49
{
50
public
:
51
class
Error
:
public
tlv::Error
52
{
53
public
:
54
using
tlv::Error::Error
;
55
};
56
60
MetadataObject
();
61
66
explicit
67
MetadataObject
(
const
Data
& data);
68
82
NDN_CXX_NODISCARD
Data
83
makeData
(
Name
discoveryInterestName,
84
KeyChain
& keyChain,
85
const
ndn::security::SigningInfo
& si =
security::SigningInfo
(),
86
optional<uint64_t>
version
=
nullopt
,
87
time::milliseconds
freshnessPeriod = 10_ms)
const
;
88
92
const
Name
&
93
getVersionedName
()
const
94
{
95
return
m_versionedName;
96
}
97
105
MetadataObject
&
106
setVersionedName
(
const
Name
&
name
);
107
108
public
:
// static methods
112
static
const
name::Component
&
113
getKeywordComponent
();
114
118
static
bool
119
isValidName
(
const
Name
& name);
120
126
NDN_CXX_NODISCARD
static
Interest
127
makeDiscoveryInterest
(
Name
name);
128
129
private
:
130
Name
m_versionedName;
131
};
132
133
}
// namespace ndn
134
135
#endif // NDN_CXX_METADATA_OBJECT_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::security::v2::KeyChain
ndn security KeyChain
Definition:
key-chain.cpp:70
ndn::MetadataObject::isValidName
static bool isValidName(const Name &name)
Check whether name can be a valid metadata name.
Definition:
metadata-object.cpp:89
key-chain.hpp
ndn::MetadataObject::MetadataObject
MetadataObject()
Create an empty metadata object.
ndn::Interest
Represents an Interest packet.
Definition:
interest.hpp:48
ndn::security::SigningInfo
Signing parameters passed to KeyChain.
Definition:
signing-info.hpp:52
ndn::MetadataObject::setVersionedName
MetadataObject & setVersionedName(const Name &name)
Set the versioned name.
Definition:
metadata-object.cpp:75
ndn::MetadataObject::makeData
NDN_CXX_NODISCARD Data makeData(Name discoveryInterestName, KeyChain &keyChain, const ndn::security::SigningInfo &si=security::SigningInfo(), optional< uint64_t > version=nullopt, time::milliseconds freshnessPeriod=10_ms) const
Create a Data packet representing this metadata object.
Definition:
metadata-object.cpp:53
data.hpp
NDN_CXX_NODISCARD
#define NDN_CXX_NODISCARD
Definition:
backports.hpp:68
ndn::MetadataObject::Error
Definition:
metadata-object.hpp:51
interest.hpp
ndn::Name
Represents an absolute name.
Definition:
name.hpp:41
ndn::MetadataObject::getKeywordComponent
static const name::Component & getKeywordComponent()
Returns the well-known keyword name component used for metadata objects (32=metadata) ...
Definition:
metadata-object.cpp:82
ndn::name::Component
Represents a name component.
Definition:
name-component.hpp:107
ndn::MetadataObject::makeDiscoveryInterest
static NDN_CXX_NODISCARD Interest makeDiscoveryInterest(Name name)
Generate a discovery interest packet based on name.
Definition:
metadata-object.cpp:96
ndn::MetadataObject::getVersionedName
const Name & getVersionedName() const
Return the versioned name (i.e., the name inside the content)
Definition:
metadata-object.hpp:93
ndn::Data
Represents a Data packet.
Definition:
data.hpp:37
websocketpp::http::parser::state::version
Definition:
parser.hpp:47
nonstd::optional_lite::nullopt
const nullopt_t nullopt((nullopt_t::init()))
ndn::tlv::Error::Error
Error(const char *expectedType, uint32_t actualType)
Definition:
tlv.cpp:27
ndn::name
Definition:
name-component-types.hpp:33
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:52
ndn::MetadataObject
Class for RDR-style metadata encoding/decoding.
Definition:
metadata-object.hpp:48
ndn::time::milliseconds
boost::chrono::milliseconds milliseconds
Definition:
time.hpp:48
ndnSIM
ndn-cxx
ndn-cxx
metadata-object.hpp
Generated on Fri May 6 2022 12:34:12 for ndnSIM by
1.8.13