24 #include <boost/lexical_cast.hpp> 28 static_assert(std::is_base_of<tlv::Error, MetadataObject::Error>::value,
29 "MetadataObject::Error must inherit from tlv::Error");
38 BOOST_THROW_EXCEPTION(
Error(
"Expected ContentType to be BLOB but " +
45 " is not a valid MetadataObject name"));
57 optional<uint64_t> version,
58 time::milliseconds freshnessPeriod)
const 61 BOOST_THROW_EXCEPTION(
Error(
"Name " + discoveryInterestName.
toUri() +
62 " is not a valid discovery Interest name"));
67 Data data(discoveryInterestName);
70 keyChain.
sign(data, si);
78 m_versionedName =
name;
86 name[-2].isVersion() &&
name[-1].isSegment();
94 .setMustBeFresh(
true);
Copyright (c) 2011-2015 Regents of the University of California.
std::string toUri() const
Get URI representation of the name.
const Name & getName() const
Get name.
The interface of signing key management.
const Block & getContent() const
Get Content.
Data & setContent(const Block &block)
Set Content from a block.
void parse() const
Parse TLV-VALUE into sub elements.
Represents an Interest packet.
Signing parameters passed to KeyChain.
Name & appendVersion(optional< uint64_t > version=nullopt)
Append a version component.
const Block & get(uint32_t type) const
Get the first sub element of specified TLV-TYPE.
Represents an absolute name.
void sign(Data &data, const SigningInfo ¶ms=getDefaultSigningInfo())
Sign data according to the supplied signing information.
Represents a name component.
Data & setFreshnessPeriod(time::milliseconds freshnessPeriod)
bool empty() const
Check if name is empty.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
void wireDecode(const Block &wire)
Decode name from wire encoding.
Represents a Data packet.
uint32_t getContentType() const
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
const name::Component KEYWORD_METADATA_COMP