22 #ifndef NDN_CXX_DATA_HPP 23 #define NDN_CXX_DATA_HPP 72 template<encoding::Tag TAG>
113 return m_wire.hasWire();
158 return m_content.isValid();
206 [[deprecated(
"use the overload that takes a span<>")]]
208 setContent(
const uint8_t* value,
size_t length);
231 return m_signatureInfo;
251 return m_signatureValue;
277 return m_metaInfo.getType();
286 return m_metaInfo.getFreshnessPeriod();
292 const optional<name::Component>&
295 return m_metaInfo.getFinalBlock();
308 return m_signatureInfo.getSignatureType();
316 return m_signatureInfo.hasKeyLocator() ?
make_optional(m_signatureInfo.getKeyLocator()) :
nullopt;
331 Block m_signatureValue;
333 mutable Block m_wire;
334 mutable Name m_fullName;
338 extern template size_t 339 Data::wireEncode<encoding::EncoderTag>(
EncodingBuffer&, bool)
const;
341 extern template size_t 354 return !(lhs == rhs);
359 #endif // NDN_CXX_DATA_HPP const Block & wireEncode() const
Encode into a Block.
Data & setContentType(uint32_t type)
Copyright (c) 2011-2015 Regents of the University of California.
Represents a SignatureInfo or InterestSignatureInfo TLV element.
void wireDecode(const Block &wire)
Decode from wire.
Data & setSignatureValue(ConstBufferPtr value)
Set SignatureValue.
Data & setName(const Name &name)
Set name.
std::ostream & operator<<(std::ostream &os, const Data &data)
Data(const Name &name=Name())
Construct an unsigned Data packet with given name and empty Content.
Data & setContent(const Block &block)
Set Content from a Block.
optional< T > make_optional(T const &value)
void resetWire()
Clear wire encoding and cached FullName.
Represents a TLV element of the NDN packet format.
optional< KeyLocator > getKeyLocator() const noexcept
Get KeyLocator.
bool operator!=(const Data &lhs, const Data &rhs)
const Block & getSignatureValue() const noexcept
Get SignatureValue.
bool hasWire() const noexcept
Check if this instance has cached wire encoding.
int32_t getSignatureType() const noexcept
Get SignatureType.
Data & setSignatureInfo(const SignatureInfo &info)
Set SignatureInfo.
InputBuffers extractSignedRanges() const
Extract ranges of Data covered by the signature.
base class to allow simple management of packet tags
const Name & getName() const noexcept
Get name.
Represents an absolute name.
const MetaInfo & getMetaInfo() const noexcept
Get MetaInfo.
const Name & getFullName() const
Get full name including implicit digest.
Data & setFreshnessPeriod(time::milliseconds freshnessPeriod)
Data & setFinalBlock(optional< name::Component > finalBlockId)
const Block & getContent() const noexcept
Get the Content element.
Data & unsetContent()
Remove the Content element.
bool operator==(const Data &lhs, const Data &rhs)
Data & setMetaInfo(const MetaInfo &metaInfo)
Set MetaInfo.
time::milliseconds getFreshnessPeriod() const
Represents a Data packet.
bool hasContent() const noexcept
Return whether this Data has a Content element.
uint32_t getContentType() const
const optional< name::Component > & getFinalBlock() const
EncodingImpl< EncoderTag > EncodingBuffer
const nullopt_t nullopt((nullopt_t::init()))
Error(const char *expectedType, uint32_t actualType)
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
const SignatureInfo & getSignatureInfo() const noexcept
Get SignatureInfo.
shared_ptr< const Buffer > ConstBufferPtr
boost::chrono::milliseconds milliseconds