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-2019 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
* @author Chavoosh Ghasemi <chghasemi@cs.arizona.edu>
20
*/
21
22
#ifndef NDN_METADATA_OBJECT_HPP
23
#define NDN_METADATA_OBJECT_HPP
24
25
#include "
ndn-cxx/data.hpp
"
26
#include "
ndn-cxx/interest.hpp
"
27
#include "
ndn-cxx/security/v2/key-chain.hpp
"
28
29
namespace
ndn
{
30
45
class
MetadataObject
46
{
47
public
:
48
class
Error
:
public
tlv::Error
49
{
50
public
:
51
using
tlv::Error::Error;
52
};
53
57
MetadataObject
();
58
63
explicit
64
MetadataObject
(
const
Data
& data);
65
79
Data
80
makeData
(
Name
discoveryInterestName,
81
KeyChain
& keyChain,
82
const
ndn::security::SigningInfo
& si =
KeyChain::getDefaultSigningInfo
(),
83
optional<uint64_t> version =
nullopt
,
84
time::milliseconds freshnessPeriod = 10_ms)
const
;
85
89
const
Name
&
90
getVersionedName
()
const
91
{
92
return
m_versionedName;
93
}
94
102
MetadataObject
&
103
setVersionedName
(
const
Name
&
name
);
104
105
public
:
// static methods
109
static
bool
110
isValidName
(
const
Name
&
name
);
111
117
static
Interest
118
makeDiscoveryInterest
(
Name
name
);
119
120
private
:
121
Name
m_versionedName;
122
};
123
124
}
// namespace ndn
125
126
#endif // NDN_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
The interface of signing key management.
Definition:
key-chain.hpp:46
ndn::MetadataObject::isValidName
static bool isValidName(const Name &name)
Check whether name can be a valid metadata name.
Definition:
metadata-object.cpp:83
ndn::MetadataObject::MetadataObject
MetadataObject()
Create an empty metadata object.
ndn::Interest
Represents an Interest packet.
Definition:
interest.hpp:44
ndn::security::SigningInfo
Signing parameters passed to KeyChain.
Definition:
signing-info.hpp:40
ndn::MetadataObject::setVersionedName
MetadataObject & setVersionedName(const Name &name)
Set the versioned name.
Definition:
metadata-object.cpp:76
key-chain.hpp
data.hpp
ndn::MetadataObject::makeData
Data makeData(Name discoveryInterestName, KeyChain &keyChain, const ndn::security::SigningInfo &si=KeyChain::getDefaultSigningInfo(), optional< uint64_t > version=nullopt, time::milliseconds freshnessPeriod=10_ms) const
Create a Data packet representing this metadata object.
Definition:
metadata-object.cpp:54
ndn::security::v2::KeyChain::getDefaultSigningInfo
static const SigningInfo & getDefaultSigningInfo()
Definition:
key-chain.cpp:150
ndn::MetadataObject::Error
Definition:
metadata-object.hpp:48
interest.hpp
ndn::Name
Represents an absolute name.
Definition:
name.hpp:43
ndn::MetadataObject::makeDiscoveryInterest
static Interest makeDiscoveryInterest(Name name)
Generate a discovery interest packet based on name.
Definition:
metadata-object.cpp:90
ndn::MetadataObject::getVersionedName
const Name & getVersionedName() const
Return the versioned name (i.e., the name inside the content)
Definition:
metadata-object.hpp:90
ndn::Data
Represents a Data packet.
Definition:
data.hpp:35
nonstd::optional_lite::nullopt
const nullopt_t nullopt((nullopt_t::init()))
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:45
ndnSIM
ndn-cxx
ndn-cxx
metadata-object.hpp
Generated on Sun Feb 24 2019 22:16:05 for ndnSIM by
1.8.15