67 template<encoding::Tag TAG>
69 wireEncode(EncodingImpl<TAG>& encoder,
bool wantUnsignedPortionOnly =
false)
const;
110 return m_wire.hasWire();
173 setContent(
const uint8_t* value,
size_t valueSize);
206 return m_metaInfo.getType();
215 return m_metaInfo.getFreshnessPeriod();
221 const optional<name::Component>&
224 return m_metaInfo.getFinalBlock();
243 mutable Block m_wire;
244 mutable Name m_fullName;
248 extern template size_t 249 Data::wireEncode<encoding::EncoderTag>(
EncodingBuffer&, bool)
const;
251 extern template size_t 264 return !(lhs == rhs);
269 #endif // NDN_DATA_HPP
Data & setContentType(uint32_t type)
void wireDecode(const Block &wire)
Decode from wire in NDN Packet Format v0.2 or v0.3.
time::milliseconds getFreshnessPeriod() const
Data & setSignature(const Signature &signature)
Set Signature.
uint32_t getContentType() const
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.
const Signature & getSignature() const
Get Signature.
void resetWire()
Clear wire encoding and cached FullName.
Represents a TLV element of NDN packet format.
const MetaInfo & getMetaInfo() const
Get MetaInfo.
const optional< name::Component > & getFinalBlock() const
bool operator!=(const Data &lhs, const Data &rhs)
Data & setSignatureValue(const Block &value)
Set SignatureValue.
base class to allow simple management of packet tags
Represents an absolute name.
const Block & wireEncode() const
Encode to a Block.
const Name & getName() const
Get name.
Data & setFreshnessPeriod(time::milliseconds freshnessPeriod)
Data & setFinalBlock(optional< name::Component > finalBlockId)
const Block & getContent() const
Get Content.
bool operator==(const Data &lhs, const Data &rhs)
Data & setMetaInfo(const MetaInfo &metaInfo)
Set MetaInfo.
const Name & getFullName() const
Get full name including implicit digest.
Represents a Data packet.
bool hasWire() const
Check if this instance has cached wire encoding.
EncodingImpl< EncoderTag > EncodingBuffer
Error(const char *expectedType, uint32_t actualType)
represents an error in TLV encoding or decoding
EncodingImpl< EstimatorTag > EncodingEstimator
Holds SignatureInfo and SignatureValue in a Data packet.
shared_ptr< const Buffer > ConstBufferPtr