25 #include <ndn-cpp/data.hpp>
26 #include <ndn-cpp/delegation-set.hpp>
43 getMetaInfo().setType(ndn_ContentType_LINK);
54 getMetaInfo().setType(ndn_ContentType_LINK);
90 (
int preference,
const Name& name,
93 delegations_.
add(preference, name);
94 encodeContent(wireFormat);
112 bool wasRemoved = delegations_.
remove(name);
114 encodeContent(wireFormat);
137 getMetaInfo().setType(ndn_ContentType_LINK);
140 DelegationSet delegations_;
void add(int preference, const Name &name)
Add a new DelegationSet::Delegation to the list of delegations, sorted by preference number then by n...
Definition: delegation-set.cpp:55
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
Link()
Create a Link with default values and where the list of delegations is empty and the meta info type i...
Definition: link.hpp:41
const DelegationSet & getDelegations() const
Get the list of delegation for read only.
Definition: link.hpp:125
A Name holds an array of Name::Component and represents an NDN name.
Definition: name.hpp:40
A DelegationSet holds a list of DelegationSet::Delegation entries which is used as the content of a L...
Definition: delegation-set.hpp:38
A Blob holds a pointer to an immutable byte array implemented as const std::vector.
Definition: blob.hpp:42
Link(const Name &name)
Create a Link with the given name and default values and where the list of delegations is empty and t...
Definition: link.hpp:51
bool removeDelegation(const Name &name, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Remove every delegation with the given name.
Definition: link.hpp:109
Blob wireEncode(WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const
Encode this DelegationSet for a particular wire format.
Definition: delegation-set.hpp:189
Data & setContent(const std::vector< uint8_t > &content)
Set the content to a copy of the data in the vector.
Definition: data.hpp:225
bool remove(const Name &name)
Remove every DelegationSet::Delegation with the given name.
Definition: delegation-set.cpp:73
Link & addDelegation(int preference, const Name &name, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Add a new delegation to the list of delegations, sorted by preference number then by name...
Definition: link.hpp:90
The Link class extends Data and represents a Link instance where the Data content is an encoded deleg...
Definition: link.hpp:35
virtual void wireDecode(const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat())
Override to call the base class wireDecode then populate the list of delegations from the content...
Definition: link.cpp:44