Represents a Data packet. More...
#include <data.hpp>
Inheritance diagram for ndn::Data:
Collaboration diagram for ndn::Data:Classes | |
| class | Error |
Public Member Functions | |
| Data (const Name &name=Name()) | |
| Create a new Data with the given name and empty Content. More... | |
| Data (const Block &wire) | |
| Create from wire encoding. More... | |
| uint64_t | getCongestionMark () const |
| get the value of the CongestionMark tag More... | |
| const Block & | getContent () const |
| Get Content. More... | |
| uint32_t | getContentType () const |
| const name::Component & | getFinalBlockId () const |
| const time::milliseconds & | getFreshnessPeriod () const |
| const Name & | getFullName () const |
| Get full name including implicit digest. More... | |
| const MetaInfo & | getMetaInfo () const |
| Get MetaInfo. More... | |
| const Name & | getName () const |
| Get name. More... | |
| const Signature & | getSignature () const |
| Get Signature. More... | |
| template<typename T > | |
| shared_ptr< T > | getTag () const |
| get a tag item More... | |
| bool | hasWire () const |
| Check if already has wire. More... | |
| template<typename T > | |
| void | removeTag () const |
| remove tag item More... | |
| void | setCongestionMark (uint64_t mark) |
| set the CongestionMark tag to the specified value More... | |
| Data & | setContent (const Block &block) |
| Set Content from a block. More... | |
| Data & | setContent (const uint8_t *value, size_t valueSize) |
| Copy Content value from raw buffer. More... | |
| Data & | setContent (const ConstBufferPtr &value) |
| Set Content from wire buffer. More... | |
| Data & | setContentType (uint32_t type) |
| Data & | setFinalBlockId (const name::Component &finalBlockId) |
| Data & | setFreshnessPeriod (const time::milliseconds &freshnessPeriod) |
| Data & | setMetaInfo (const MetaInfo &metaInfo) |
| Set MetaInfo. More... | |
| Data & | setName (const Name &name) |
| Set name. More... | |
| Data & | setSignature (const Signature &signature) |
| Set Signature. More... | |
| Data & | setSignatureValue (const Block &value) |
| Set SignatureValue. More... | |
| template<typename T > | |
| void | setTag (shared_ptr< T > tag) const |
| set a tag item More... | |
| void | wireDecode (const Block &wire) |
| Decode from the wire format. More... | |
| template<encoding::Tag TAG> | |
| size_t | wireEncode (EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const |
| Fast encoding or block size estimation. More... | |
| const Block & | wireEncode (EncodingBuffer &encoder, const Block &signatureValue) const |
| Finalize Data packet encoding with the specified SignatureValue. More... | |
| const Block & | wireEncode () const |
| Encode to a wire format. More... | |
Protected Member Functions | |
| void | resetWire () |
| Clear wire encoding and cached FullName. More... | |
|
explicit |
|
inherited |
get the value of the CongestionMark tag
Definition at line 28 of file packet-base.cpp.
| const Block & ndn::Data::getContent | ( | ) | const |
|
inline |
|
inline |
| const Name & ndn::Data::getFullName | ( | ) | const |
|
inline |
|
inline |
|
inlineinherited |
get a tag item
| T | type of the tag, which must be a subclass of ndn::Tag |
| nullptr | if no Tag of type T is stored |
Definition at line 67 of file tag-host.hpp.
|
inline |
|
inlineinherited |
remove tag item
Definition at line 94 of file tag-host.hpp.
|
protected |
|
inherited |
set the CongestionMark tag to the specified value
Definition at line 41 of file packet-base.cpp.
| Data & ndn::Data::setContent | ( | const uint8_t * | value, |
| size_t | valueSize | ||
| ) |
| Data & ndn::Data::setContent | ( | const ConstBufferPtr & | value | ) |
| Data & ndn::Data::setFinalBlockId | ( | const name::Component & | finalBlockId | ) |
| Data & ndn::Data::setFreshnessPeriod | ( | const time::milliseconds & | freshnessPeriod | ) |
|
inlineinherited |
set a tag item
| T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 80 of file tag-host.hpp.
| void ndn::Data::wireDecode | ( | const Block & | wire | ) |
| size_t ndn::Data::wireEncode | ( | EncodingImpl< TAG > & | encoder, |
| bool | wantUnsignedPortionOnly = false |
||
| ) | const |
Fast encoding or block size estimation.
| encoder | EncodingEstimator or EncodingBuffer instance |
| wantUnsignedPortionOnly | If true, only prepends Name, MetaInfo, Content, and SignatureInfo to encoder, but omit SignatureValue and outmost Type-Length of Data element. This is intended to be used with wireEncode(encoder, signatureValue). |
| Error | SignatureBits are not provided and wantUnsignedPortionOnly is false. |
| const Block & ndn::Data::wireEncode | ( | EncodingBuffer & | encoder, |
| const Block & | signatureValue | ||
| ) | const |
Finalize Data packet encoding with the specified SignatureValue.
| encoder | EncodingBuffer containing Name, MetaInfo, Content, and SignatureInfo, but without SignatureValue or outmost Type-Length of Data element |
| signatureValue | SignatureValue element |
This method is intended to be used in concert with Data::wireEncode(encoder, true)