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, 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... | |
uint64_t | getCongestionMark () const |
get the value of the CongestionMark tag More... | |
const Block & | getContent () const |
Get Content. More... | |
uint32_t | getContentType () const |
const DelegationList & | getDelegationList () const |
Get the delegations. More... | |
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... | |
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 valueSize) |
Copy Content value from raw buffer. More... | |
Data & | setContent (const ConstBufferPtr &value) |
Set Content from wire buffer. More... | |
Data & | setContentType (uint32_t type) |
void | setDelegationList (const DelegationList &dels) |
Set the delegations. More... | |
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, bool wantSort=true) |
Decode from the wire format. 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... | |
|
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 |
get the value of the CongestionMark tag
Definition at line 28 of file packet-base.cpp.
|
inherited |
|
inlineinherited |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
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.
|
inlineinherited |
bool ndn::Link::removeDelegation | ( | const Name & | name | ) |
|
inlineinherited |
remove tag item
Definition at line 94 of file tag-host.hpp.
|
protectedinherited |
|
inherited |
set the CongestionMark tag to the specified value
Definition at line 41 of file packet-base.cpp.
|
inherited |
|
inherited |
|
inherited |
void ndn::Link::setDelegationList | ( | const DelegationList & | dels | ) |
|
inherited |
|
inherited |
|
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::Link::wireDecode | ( | const Block & | wire, |
bool | wantSort = true |
||
) |
|
inherited |
|
inherited |
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. |
|
inherited |
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)