37 class Data :
public TagHost,
public enable_shared_from_this<Data>
98 template<encoding::Tag TAG>
198 const time::milliseconds&
235 setContent(
const uint8_t* buffer,
size_t bufferSize);
301 mutable Block m_content;
304 mutable Block m_wire;
305 mutable Name m_fullName;
314 return m_wire.hasWire();
332 return m_metaInfo.getType();
335 inline const time::milliseconds&
338 return m_metaInfo.getFreshnessPeriod();
344 return m_metaInfo.getFinalBlockId();
Error(const std::string &what)
const Block & wireEncode() const
Encode to a wire format.
Data & setContentType(uint32_t type)
Copyright (c) 2011-2015 Regents of the University of California.
void wireDecode(const Block &wire)
Decode from the wire format.
const Block & getContent() const
Get content Block.
Data()
Create an empty Data object.
Data & setSignature(const Signature &signature)
Set the signature to a copy of the given signature.
Base class to store tag information (e.g., inside Interest and Data packets)
Data & setName(const Name &name)
Set name to a copy of the given Name.
const Name & getName() const
Get name of the Data packet.
const name::Component & getFinalBlockId() const
std::ostream & operator<<(std::ostream &os, const Data &data)
Data & setContent(const uint8_t *buffer, size_t bufferSize)
Set the content from the buffer (buffer will be copied)
Class representing a wire element of NDN-TLV packet format.
bool operator!=(const Data &other) const
bool operator==(const Data &other) const
Data & setFreshnessPeriod(const time::milliseconds &freshnessPeriod)
void onChanged()
Clear the wire encoding.
Data & setSignatureValue(const Block &value)
EncodingImpl< EncoderTag > EncodingBuffer
bool hasWire() const
Check if Data is already has wire encoding.
const MetaInfo & getMetaInfo() const
Get MetaInfo block from Data packet.
Name abstraction to represent an absolute name.
const Name & getFullName() const
Get full name of Data packet, including the implicit digest.
const time::milliseconds & getFreshnessPeriod() const
Component holds a read-only name component value.
Data & setMetaInfo(const MetaInfo &metaInfo)
Set metaInfo to a copy of the given MetaInfo.
const Signature & getSignature() const
shared_ptr< const Buffer > ConstBufferPtr
Data & setFinalBlockId(const name::Component &finalBlockId)
uint32_t getContentType() const
represents an error in TLV encoding or decoding
A Signature is storage for the signature-related information (info and value) in a Data packet...