ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
Loading...
Searching...
No Matches
link.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include "ndn/common.hpp"
14#include "ndn/data.hpp"
15#include "ndn/name.hpp"
16
17namespace ndn {
18
49class Link {
50public:
56 Link() = default;
57
62 explicit Link(const Name& name);
63
79
85 Error addDelegation(std::string_view uri);
86
91 size_t delegationCount() const { return delegationCount_; }
92
99 const Name* delegation(size_t index) const;
100
104 void clearDelegations();
105
111 bool hasDelegation(const Name& name) const;
122 const Name& name() const { return name_; }
123
128 Name& name() { return name_; }
129
135 Link& setName(const Name& name);
136
142 Error setName(std::string_view uri);
159 Error toData(Data& data) const;
160
169 static Result<Link> fromData(const Data& data);
172private:
173 Name name_;
174 std::array<Name, LINK_MAX_DELEGATIONS> delegations_;
175 size_t delegationCount_ = 0;
176};
177
178} // namespace ndn
NDN Data packet.
Definition data.hpp:49
NDN Name class.
Definition name.hpp:64
Common definitions for the NDN protocol stack.
Error
Error codes.
Definition common.hpp:24
NDN Data packet.
NDN Name class.
Result type template.
Definition common.hpp:147