26 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Link>));
27 BOOST_CONCEPT_ASSERT((WireEncodable<Link>));
28 BOOST_CONCEPT_ASSERT((WireEncodableWithEncodingBuffer<Link>));
29 BOOST_CONCEPT_ASSERT((WireDecodable<Link>));
30 static_assert(std::is_base_of<Data::Error, Link::Error>::value,
31 "Link::Error should inherit from Data::Error");
42 , m_delegations(delegations)
52 if (m_delegations.empty()) {
71 m_delegations.clear();
74 for (
const auto& del : content.elements()) {
76 m_delegations.emplace_back(del);
87 m_delegations = std::move(delegations);
94 if (std::find(m_delegations.begin(), m_delegations.end(), name) != m_delegations.end()) {
98 m_delegations.push_back(name);
106 auto last = std::remove(m_delegations.begin(), m_delegations.end(), name);
107 if (last == m_delegations.end()) {
111 m_delegations.erase(last, m_delegations.end());
Represents a TLV element of the NDN packet format.
Represents a Data packet.
void wireDecode(const Block &wire)
Decode from wire.
Data & setContent(const Block &block)
Set Content from a Block.
uint32_t getContentType() const
const Block & getContent() const noexcept
Get the Content element.
Data & setContentType(uint32_t type)
Link()
Create an empty Link object.
void setDelegationList(std::vector< Name > delegations)
Set the delegations.
void wireDecode(const Block &wire)
Decode from the wire format.
bool addDelegation(const Name &name)
Append a delegation at the end.
bool removeDelegation(const Name &name)
Remove a delegation whose name is name.
Represents an absolute name.
Block makeNestedBlock(uint32_t type, const U &value)
Create a TLV block containing a nested TLV element.
std::string to_string(const errinfo_stacktrace &x)
constexpr bool isCriticalType(uint32_t type) noexcept
Determine whether a TLV-TYPE is "critical" for evolvability purpose.
@ ContentType_Link
another name that identifies the actual data content