Public Member Functions | |
Data () | |
Create a new Data object with default values and where the signature is a blank Sha256WithRsaSignature. | |
Data (const Name &name) | |
Create a new Data object with the given name and default values and where the signature is a blank Sha256WithRsaSignature. More... | |
Data (const Data &data) | |
The copy constructor: Create a deep copy of the given data object, including a clone of the signature object. More... | |
virtual | ~Data () |
The virtual destructor. | |
Data & | operator= (const Data &data) |
The assignment operator: Copy fields and make a clone of the signature. More... | |
SignedBlob | wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const |
Encode this Data for a particular wire format. More... | |
virtual void | wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this Data. More... | |
void | wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this Data. More... | |
void | wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
Decode the input using a particular wire format and update this Data. More... | |
void | get (DataLite &dataLite) const |
Set dataLite to point to the values in this Data object, without copying any memory. More... | |
void | set (const DataLite &dataLite) |
Clear this data object, and set the values by copying from dataLite. More... | |
const Signature * | getSignature () const |
Signature * | getSignature () |
const Name & | getName () const |
Name & | getName () |
const MetaInfo & | getMetaInfo () const |
MetaInfo & | getMetaInfo () |
const Blob & | getContent () const |
uint64_t | getIncomingFaceId () const |
Get the incoming face ID according to the incoming packet header. More... | |
const SignedBlob & | getDefaultWireEncoding () const |
Return a reference to the defaultWireEncoding, which was encoded with getDefaultWireEncodingFormat(). More... | |
WireFormat * | getDefaultWireEncodingFormat () const |
Get the WireFormat which is used by getDefaultWireEncoding(). More... | |
Data & | setSignature (const Signature &signature) |
Set the signature to a copy of the given signature. More... | |
virtual Data & | setName (const Name &name) |
Set name to a copy of the given Name. More... | |
Data & | setMetaInfo (const MetaInfo &metaInfo) |
Set metaInfo to a copy of the given MetaInfo. More... | |
Data & | setContent (const std::vector< uint8_t > &content) |
Set the content to a copy of the data in the vector. More... | |
Data & | setContent (const uint8_t *content, size_t contentLength) |
Data & | setContent (const Blob &content) |
Data & | setLpPacket (const ptr_lib::shared_ptr< LpPacket > &lpPacket) |
An internal library method to set the LpPacket for an incoming packet. More... | |
uint64_t | getChangeCount () const |
Get the change count, which is incremented each time this object (or a child object) is changed. More... | |
ndn::Data::Data | ( | const Name & | name | ) |
Create a new Data object with the given name and default values and where the signature is a blank Sha256WithRsaSignature.
name | A reference to the name which is copied. |
ndn::Data::Data | ( | const Data & | data | ) |
The copy constructor: Create a deep copy of the given data object, including a clone of the signature object.
data | The data object to copy. |
void ndn::Data::get | ( | DataLite & | dataLite | ) | const |
|
inline |
Get the change count, which is incremented each time this object (or a child object) is changed.
|
inline |
Return a reference to the defaultWireEncoding, which was encoded with getDefaultWireEncodingFormat().
The SignedBlob may have a null pointer.
|
inline |
Get the WireFormat which is used by getDefaultWireEncoding().
uint64_t ndn::Data::getIncomingFaceId | ( | ) | const |
Get the incoming face ID according to the incoming packet header.
The assignment operator: Copy fields and make a clone of the signature.
data | The other object to copy from. |
void ndn::Data::set | ( | const DataLite & | dataLite | ) |
Clear this data object, and set the values by copying from dataLite.
dataLite | A DataLite object. |
|
inline |
Set the content to a copy of the data in the vector.
content | A vector whose contents are copied. |
An internal library method to set the LpPacket for an incoming packet.
The application should not call this.
lpPacket | The LpPacket. This does not make a copy. |
Set name to a copy of the given Name.
This is virtual so that a subclass can override to validate the name.
name | The Name which is copied. |
Reimplemented in ndn::IdentityCertificate.
Set the signature to a copy of the given signature.
signature | The signature object which is cloned. |
|
virtual |
Decode the input using a particular wire format and update this Data.
If wireFormat is the default wire format, also set the defaultWireEncoding to another pointer to the input Blob.
input | The input byte array to be decoded as an immutable Blob. |
wireFormat | A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat(). |
Reimplemented in ndn::IdentityCertificate, ndn::Link, and ndn::Certificate.
|
inline |
Decode the input using a particular wire format and update this Data.
If wireFormat is the default wire format, also set the defaultWireEncoding field to a copy of the input. (To not copy the input, see wireDecode(Blob).)
input | The input byte array to be decoded. |
inputLength | The length of input. |
wireFormat | A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat(). |
|
inline |
Decode the input using a particular wire format and update this Data.
If wireFormat is the default wire format, also set the defaultWireEncoding field to a copy of the input. (To not copy the input, see wireDecode(Blob).)
input | The input byte array to be decoded. |
wireFormat | A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat(). |
SignedBlob ndn::Data::wireEncode | ( | WireFormat & | wireFormat = *WireFormat::getDefaultWireFormat() | ) | const |
Encode this Data for a particular wire format.
If wireFormat is the default wire format, also set the defaultWireEncoding field to the encoded result. Even though this is const, if wireFormat is the default wire format we update the defaultWireEncoding.
wireFormat | A WireFormat object used to encode the input. If omitted, use WireFormat getDefaultWireFormat(). |