22 #ifndef NDN_CXX_DATA_HPP
23 #define NDN_CXX_DATA_HPP
72 template<encoding::Tag TAG>
204 [[deprecated(
"use the overload that takes a span<>")]]
206 setContent(
const uint8_t* value,
size_t length);
229 return m_signatureInfo;
249 return m_signatureValue;
290 const optional<name::Component>&
329 Block m_signatureValue;
331 mutable Block m_wire;
332 mutable Name m_fullName;
336 extern template size_t
337 Data::wireEncode<encoding::EncoderTag>(
EncodingBuffer&,
bool)
const;
339 extern template size_t
352 return !(lhs == rhs);
Represents a TLV element of the NDN packet format.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
bool isValid() const noexcept
Check if the Block is valid.
Represents a Data packet.
int32_t getSignatureType() const noexcept
Get SignatureType.
void wireDecode(const Block &wire)
Decode from wire.
InputBuffers extractSignedRanges() const
Extract ranges of Data covered by the signature.
Data & setContent(const Block &block)
Set Content from a Block.
Data & setSignatureValue(ConstBufferPtr value)
Set SignatureValue.
Data(const Name &name=Name())
Construct an unsigned Data packet with given name and empty Content.
const MetaInfo & getMetaInfo() const noexcept
Get MetaInfo.
bool hasWire() const noexcept
Check if this instance has cached wire encoding.
void resetWire()
Clear wire encoding and cached FullName.
optional< KeyLocator > getKeyLocator() const noexcept
Get KeyLocator.
Data & setFreshnessPeriod(time::milliseconds freshnessPeriod)
const Block & wireEncode() const
Encode into a Block.
const Name & getFullName() const
Get full name including implicit digest.
Data & setFinalBlock(optional< name::Component > finalBlockId)
bool hasContent() const noexcept
Return whether this Data has a Content element.
const SignatureInfo & getSignatureInfo() const noexcept
Get SignatureInfo.
const Name & getName() const noexcept
Get name.
const Block & getSignatureValue() const noexcept
Get SignatureValue.
Data & setSignatureInfo(const SignatureInfo &info)
Set SignatureInfo.
time::milliseconds getFreshnessPeriod() const
const optional< name::Component > & getFinalBlock() const
uint32_t getContentType() const
Data & setName(const Name &name)
Set name.
const Block & getContent() const noexcept
Get the Content element.
Data & setContentType(uint32_t type)
Data & setMetaInfo(const MetaInfo &metaInfo)
Set MetaInfo.
Data & unsetContent()
Remove the Content element.
Represents an absolute name.
base class to allow simple management of packet tags
Represents a SignatureInfo or InterestSignatureInfo TLV element.
int32_t getSignatureType() const noexcept
Get SignatureType.
bool hasKeyLocator() const noexcept
Check if KeyLocator is present.
const KeyLocator & getKeyLocator() const
Get KeyLocator.
represents an error in TLV encoding or decoding
Error(const char *expectedType, uint32_t actualType)
EncodingImpl< EstimatorTag > EncodingEstimator
EncodingImpl< EncoderTag > EncodingBuffer
boost::chrono::milliseconds milliseconds
bool operator!=(const Data &lhs, const Data &rhs)
shared_ptr< const Buffer > ConstBufferPtr
bool operator==(const Data &lhs, const Data &rhs)
std::ostream & operator<<(std::ostream &os, const Data &data)