represents a Link object More...
#include <ndn-cxx/link.hpp>
Inheritance diagram for ndn::Link:
Collaboration diagram for ndn::Link:Classes | |
| class | Error |
Public Member Functions | |
| Link () | |
| Create an empty Link object. More... | |
| Link (const Block &wire, bool wantSort=true) | |
| Decode a Link object from a Block. More... | |
| Link (const Name &name, std::initializer_list< Delegation > dels={}) | |
| Create a Link object with the given name and delegations. More... | |
| void | addDelegation (uint32_t preference, const Name &name) |
| Add a delegation in the format of <Name, Preference> More... | |
| InputBuffers | extractSignedRanges () const |
| Extract ranges of Data covered by the signature. More... | |
| uint64_t | getCongestionMark () const |
| get the value of the CongestionMark tag More... | |
| const Block & | getContent () const noexcept |
| Get the Content element. More... | |
| uint32_t | getContentType () const |
| const DelegationList & | getDelegationList () const |
| Get the delegations. More... | |
| const optional< name::Component > & | getFinalBlock () const |
| time::milliseconds | getFreshnessPeriod () const |
| const Name & | getFullName () const |
| Get full name including implicit digest. More... | |
| optional< KeyLocator > | getKeyLocator () const noexcept |
| Get KeyLocator. More... | |
| const MetaInfo & | getMetaInfo () const noexcept |
| Get MetaInfo. More... | |
| const Name & | getName () const noexcept |
| Get name. More... | |
| Signature | getSignature () const |
| Get Signature. More... | |
| const SignatureInfo & | getSignatureInfo () const noexcept |
| Get SignatureInfo. More... | |
| int32_t | getSignatureType () const noexcept |
| Get SignatureType. More... | |
| const Block & | getSignatureValue () const noexcept |
| Get SignatureValue. More... | |
| template<typename T > | |
| shared_ptr< T > | getTag () const |
| get a tag item More... | |
| bool | hasContent () const noexcept |
| Return whether this Data has a Content element. More... | |
| bool | hasWire () const noexcept |
| Check if this instance has cached wire encoding. More... | |
| bool | removeDelegation (const Name &name) |
Remove a delegation whose name is name. 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 length) |
| Set Content by copying from a raw buffer. More... | |
| Data & | setContent (ConstBufferPtr value) |
| Set Content from a shared buffer. More... | |
| Data & | setContentType (uint32_t type) |
| void | setDelegationList (const DelegationList &dels) |
| Set the delegations. More... | |
| Data & | setFinalBlock (optional< name::Component > finalBlockId) |
| Data & | setFreshnessPeriod (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 & | setSignatureInfo (const SignatureInfo &info) |
| Set SignatureInfo. More... | |
| Data & | setSignatureValue (ConstBufferPtr value) |
| Set SignatureValue. More... | |
| template<typename T > | |
| void | setTag (shared_ptr< T > tag) const |
| set a tag item More... | |
| Data & | unsetContent () |
| Remove the Content element. More... | |
| void | wireDecode (const Block &wire, bool wantSort=true) |
| Decode from the wire format. More... | |
| void | wireDecode (const Block &wire) |
Decode from wire. More... | |
| template<encoding::Tag TAG> | |
| size_t | wireEncode (EncodingImpl< TAG > &encoder, bool wantUnsignedPortionOnly=false) const |
Prepend wire encoding to encoder. More... | |
| const Block & | wireEncode (EncodingBuffer &encoder, const Block &signatureValue) const |
| Finalize Data packet encoding with the specified SignatureValue. More... | |
| const Block & | wireEncode () const |
| Encode into a Block. More... | |
Protected Member Functions | |
| void | resetWire () |
| Clear wire encoding and cached FullName. More... | |
|
default |
|
explicit |
|
explicit |
Create a Link object with the given name and delegations.
| name | A reference to the name of the redirected namespace |
| dels | Delegations in payload |
Note that in certain contexts that use Link::shared_from_this(), Link must be created using make_shared:
shared_ptr<Link> link = make_shared<Link>(name, dels);
| void ndn::Link::addDelegation | ( | uint32_t | preference, |
| const Name & | name | ||
| ) |
|
inherited |
Extract ranges of Data covered by the signature.
|
inherited |
get the value of the CongestionMark tag
Definition at line 28 of file packet-base.cpp.
|
inlinenoexceptinherited |
Get the Content element.
If the element is not present (hasContent() == false), an invalid Block will be returned.
The value of the returned Content Block (if valid) can be accessed through Block::value() / Block::value_size() or Block::value_begin() / Block::value_end().
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlinenoexceptinherited |
Get KeyLocator.
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inherited |
Get Signature.
|
inlinenoexceptinherited |
Get SignatureInfo.
|
inlinenoexceptinherited |
Get SignatureType.
|
inlinenoexceptinherited |
|
inherited |
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 66 of file tag-host.hpp.
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
| bool ndn::Link::removeDelegation | ( | const Name & | name | ) |
|
inherited |
remove tag item
Definition at line 93 of file tag-host.hpp.
|
protectedinherited |
|
inherited |
set the CongestionMark tag to the specified value
Definition at line 41 of file packet-base.cpp.
Set Content from a Block.
| block | TLV block to be used as Content; must be valid |
If the block's TLV-TYPE is tlv::Content, it will be used directly as this Data's Content element. Otherwise, the block will be nested into a Content element.
|
inherited |
|
inherited |
|
inherited |
| void ndn::Link::setDelegationList | ( | const DelegationList & | dels | ) |
|
inherited |
|
inherited |
Set Signature.
|
inherited |
Set SignatureInfo.
This is a low-level function that should not normally be called directly by applications. Instead, provide a SignatureInfo to the SigningInfo object passed to KeyChain::sign().
|
inherited |
Set SignatureValue.
| value | buffer containing the TLV-VALUE of the SignatureValue; must not be nullptr |
This is a low-level function that should not normally be called directly by applications. Instead, use KeyChain::sign() to sign the packet.
|
inherited |
set a tag item
| T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 79 of file tag-host.hpp.
|
inherited |
Remove the Content element.
| void ndn::Link::wireDecode | ( | const Block & | wire, |
| bool | wantSort = true |
||
| ) |
|
inherited |
|
inherited |
Prepend wire encoding to encoder.
| encoder | EncodingEstimator or EncodingBuffer instance. |
| wantUnsignedPortionOnly | If true, prepend only Name, MetaInfo, Content, and SignatureInfo to encoder, but omit SignatureValue and the outermost TLV Type and Length of the Data element. This is intended to be used with wireEncode(EncodingBuffer&, const Block&) const. |
| Error | Signature is not present and wantUnsignedPortionOnly is false. |
|
inherited |
Finalize Data packet encoding with the specified SignatureValue.
| encoder | EncodingBuffer containing Name, MetaInfo, Content, and SignatureInfo, but without SignatureValue and the outermost Type-Length of the Data element. |
| signatureValue | SignatureValue element. |
This method is intended to be used in concert with wireEncode(encoder, true), e.g.: