22 #ifndef _NDN_CONTENT_OBJECT_HEADER_H_
23 #define _NDN_CONTENT_OBJECT_HEADER_H_
25 #include "ns3/simple-ref-count.h"
26 #include "ns3/nstime.h"
27 #include "ns3/packet.h"
30 #include <ns3/ndn-name.h>
39 class Data :
public SimpleRefCount<Data>
47 Data (Ptr<Packet> payload = Create<Packet> ());
162 inline Ptr<const Packet>
169 SetWire (Ptr<const Packet> packet)
const;
175 Print (std::ostream &os)
const;
180 operator = (
const Data &other) {
return *
this; }
186 uint32_t m_signature;
187 Ptr<Packet> m_payload;
188 Ptr<Name> m_keyLocator;
190 mutable Ptr<const Packet> m_wire;
193 inline std::ostream &
194 operator << (std::ostream &os,
const Data &d)
205 inline Ptr<const Packet>
221 #endif // _NDN_CONTENT_OBJECT_HEADER_H_
Data(Ptr< Packet > payload=Create< Packet >())
Constructor.
void Print(std::ostream &os) const
Print Interest in plain-text to the specified output stream.
Ptr< const Name > GetNamePtr() const
Get smart pointer to the interest name (to avoid extra memory usage)
Ptr< const Name > GetKeyLocator() const
Get key locator.
void SetTimestamp(const Time ×tamp)
Set content object timestamp.
const Name & GetName() const
Get name of the content object.
void SetKeyLocator(Ptr< Name > keyLocator)
Set key locator.
Ptr< const Packet > GetWire() const
Get wire formatted packet.
void SetFreshness(const Time &freshness)
Set freshness of the content object.
Time GetTimestamp() const
Get timestamp of the content object.
Class for Data parsing exception.
void SetPayload(Ptr< Packet > payload)
Get payload of data packet.
void SetName(Ptr< Name > name)
Set content object name.
uint32_t GetSignature() const
Get "fake" signature of the content object.
Time GetFreshness() const
Get freshness of the content object.
void SetWire(Ptr< const Packet > packet) const
Set (cache) wire formatted packet.
void SetSignature(uint32_t signature)
Set "fake" signature on the content object.
Ptr< const Packet > GetPayload() const
Set payload of data packet.