22 #ifndef NDN_CXX_DATA_HPP
23 #define NDN_CXX_DATA_HPP
73 template<encoding::Tag TAG>
226 return m_signatureInfo;
247 return m_signatureValue;
302 const optional<name::Component>&
343 Block m_signatureValue;
345 mutable Block m_wire;
346 mutable Name m_fullName;
350 extern template size_t
351 Data::wireEncode<encoding::EncoderTag>(
EncodingBuffer&,
bool)
const;
353 extern template size_t
366 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 the 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(const Name &name=Name())
Construct an unsigned Data packet with given name and empty Content.
const MetaInfo & getMetaInfo() const noexcept
Get the MetaInfo element.
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 the KeyLocator element.
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.
Data & setSignatureValue(span< const uint8_t > value)
Set SignatureValue by copying from a contiguous sequence of bytes.
const SignatureInfo & getSignatureInfo() const noexcept
Get the SignatureInfo element.
const Name & getName() const noexcept
Get the data name.
const Block & getSignatureValue() const noexcept
Get the SignatureValue element.
Data & setSignatureInfo(const SignatureInfo &info)
Set the SignatureInfo element.
time::milliseconds getFreshnessPeriod() const
const optional< name::Component > & getFinalBlock() const
uint32_t getContentType() const
Data & setName(const Name &name)
Set the data name.
const Block & getContent() const noexcept
Get the Content element.
Data & setContentType(uint32_t type)
Data & setMetaInfo(const MetaInfo &metaInfo)
Set the MetaInfo element.
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 the SignatureType.
bool hasKeyLocator() const noexcept
Check if KeyLocator is present.
const KeyLocator & getKeyLocator() const
Get the KeyLocator element.
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)