represents a Link object More...
#include <link.hpp>


Classes | |
| class | Error |
Public Member Functions | |
| Link () | |
| Create an empty Link object. More... | |
| Link (const Block &wire) | |
| Decode a Link object from a Block. More... | |
| Link (const Name &name, std::initializer_list< Name > delegations={}) | |
| Create a Link object with the given name and delegations. More... | |
| void | wireDecode (const Block &wire) |
| Decode from the wire format. More... | |
| span< const Name > | getDelegationList () const |
| Get the delegations. More... | |
| void | setDelegationList (std::vector< Name > delegations) |
| Set the delegations. More... | |
| bool | addDelegation (const Name &name) |
| Append a delegation at the end. More... | |
| bool | removeDelegation (const Name &name) |
Remove a delegation whose name is name. More... | |
Public Member Functions inherited from ndn::Data | |
| Data (const Name &name=Name()) | |
Construct an unsigned Data packet with given name and empty Content. More... | |
| Data (const Block &wire) | |
Construct a Data packet by decoding 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, span< const uint8_t > signature) const |
| Finalize Data packet encoding with the specified signature. More... | |
| const Block & | wireEncode () const |
| Encode into a Block. More... | |
| void | wireDecode (const Block &wire) |
Decode from wire. More... | |
| bool | hasWire () const noexcept |
| Check if this instance has cached wire encoding. More... | |
| const Name & | getFullName () const |
| Get full name including implicit digest. More... | |
| const Name & | getName () const noexcept |
| Get name. More... | |
| Data & | setName (const Name &name) |
| Set name. More... | |
| const MetaInfo & | getMetaInfo () const noexcept |
| Get MetaInfo. More... | |
| Data & | setMetaInfo (const MetaInfo &metaInfo) |
| Set MetaInfo. More... | |
| bool | hasContent () const noexcept |
| Return whether this Data has a Content element. More... | |
| const Block & | getContent () const noexcept |
| Get the Content element. More... | |
| Data & | setContent (const Block &block) |
| Set Content from a Block. More... | |
| Data & | setContent (span< const uint8_t > value) |
| Set Content by copying from a contiguous sequence of bytes. 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 & | unsetContent () |
| Remove the Content element. More... | |
| const SignatureInfo & | getSignatureInfo () const noexcept |
| Get SignatureInfo. More... | |
| Data & | setSignatureInfo (const SignatureInfo &info) |
| Set SignatureInfo. More... | |
| const Block & | getSignatureValue () const noexcept |
| Get SignatureValue. More... | |
| Data & | setSignatureValue (ConstBufferPtr value) |
| Set SignatureValue. More... | |
| InputBuffers | extractSignedRanges () const |
| Extract ranges of Data covered by the signature. More... | |
| uint32_t | getContentType () const |
| Data & | setContentType (uint32_t type) |
| time::milliseconds | getFreshnessPeriod () const |
| Data & | setFreshnessPeriod (time::milliseconds freshnessPeriod) |
| const optional< name::Component > & | getFinalBlock () const |
| Data & | setFinalBlock (optional< name::Component > finalBlockId) |
| int32_t | getSignatureType () const noexcept |
| Get SignatureType. More... | |
| optional< KeyLocator > | getKeyLocator () const noexcept |
| Get KeyLocator. More... | |
Public Member Functions inherited from ndn::PacketBase | |
| uint64_t | getCongestionMark () const |
| get the value of the CongestionMark tag More... | |
| void | setCongestionMark (uint64_t mark) |
| set the CongestionMark tag to the specified value More... | |
Public Member Functions inherited from ndn::TagHost | |
| template<typename T > | |
| shared_ptr< T > | getTag () const |
| get a tag item More... | |
| template<typename T > | |
| void | setTag (shared_ptr< T > tag) const |
| set a tag item More... | |
| template<typename T > | |
| void | removeTag () const |
| remove tag item More... | |
Additional Inherited Members | |
Protected Member Functions inherited from ndn::Data | |
| void | resetWire () |
| Clear wire encoding and cached FullName. More... | |
|
default |
|
explicit |
Create a Link object with the given name and delegations.
| name | A reference to the name of the redirected namespace |
| delegations | 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, delegations);
Definition at line 40 of file link.cpp.
References ndn::tlv::Content, ndn::tlv::ContentType_Link, ndn::encoding::makeNestedBlock(), ndn::Data::setContent(), and ndn::Data::setContentType().
| void ndn::Link::wireDecode | ( | const Block & | wire | ) |
Decode from the wire format.
| wire | a TLV block |
Definition at line 61 of file link.cpp.
References ndn::tlv::ContentType_Link, ndn::Data::getContent(), ndn::Data::getContentType(), ndn::tlv::isCriticalType(), ndn::tlv::Name, NDN_THROW, ndn::to_string(), and ndn::Data::wireDecode().
Referenced by Link().
|
inline |
Get the delegations.
Definition at line 81 of file link.hpp.
References addDelegation(), removeDelegation(), and setDelegationList().
| void ndn::Link::setDelegationList | ( | std::vector< Name > | delegations | ) |
Set the delegations.
Definition at line 85 of file link.cpp.
References nonstd::optional_lite::std11::move().
Referenced by getDelegationList().
| bool ndn::Link::addDelegation | ( | const Name & | name | ) |
Append a delegation at the end.
| name | Delegation name |
Definition at line 92 of file link.cpp.
Referenced by getDelegationList().
| bool ndn::Link::removeDelegation | ( | const Name & | name | ) |
Remove a delegation whose name is name.
| name | Delegation name |
Definition at line 104 of file link.cpp.
Referenced by getDelegationList().