28 #include <boost/range/adaptor/reversed.hpp>
55 template<encoding::Tag TAG>
59 size_t totalLength = 0;
64 totalLength += block.prependVarNumber(totalLength);
83 m_wire = buffer.block();
127 return os <<
"NextHopRecord("
153 m_nextHopRecords.push_back(nh);
161 m_nextHopRecords.clear();
166 template<encoding::Tag TAG>
170 size_t totalLength = 0;
172 for (
const auto& nh : m_nextHopRecords | boost::adaptors::reversed) {
173 totalLength += nh.wireEncode(block);
177 totalLength += block.prependVarNumber(totalLength);
196 m_wire = buffer.block();
220 m_nextHopRecords.clear();
225 m_nextHopRecords.emplace_back(*val);
236 aNextHops.
size() != bNextHops.size())
239 std::vector<bool> matched(bNextHops.size(),
false);
240 return std::all_of(aNextHops.begin(), aNextHops.end(),
242 for (size_t i = 0; i < bNextHops.size(); ++i) {
243 if (!matched[i] && bNextHops[i] == nh) {
255 os <<
"FibEntry(Prefix: " << entry.
getPrefix() <<
",\n"
Represents a TLV element of the NDN packet format.
element_const_iterator elements_begin() const noexcept
Equivalent to elements().begin().
element_const_iterator elements_end() const noexcept
Equivalent to elements().end().
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
uint32_t type() const noexcept
Return the TLV-TYPE of the Block.
void reset() noexcept
Reset the Block to a default-constructed state.
void parse() const
Parse TLV-VALUE into sub-elements.
Represents an absolute name.
size_t size() const noexcept
Returns the number of components.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder.
void wireDecode(const Block &wire)
Decode name from wire encoding.
FibEntry & clearNextHopRecords()
const Block & wireEncode() const
FibEntry & setPrefix(const Name &prefix)
void wireDecode(const Block &block)
FibEntry & addNextHopRecord(const NextHopRecord &nh)
const Name & getPrefix() const
const std::vector< NextHopRecord > & getNextHopRecords() const
NextHopRecord & setFaceId(uint64_t faceId)
void wireDecode(const Block &block)
NextHopRecord & setCost(uint64_t cost)
uint64_t getFaceId() const
const Block & wireEncode() const
#define NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
EncodingImpl< EstimatorTag > EncodingEstimator
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
EncodingImpl< EncoderTag > EncodingBuffer
Contains classes and functions related to the NFD Management protocol.
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
std::ostream & operator<<(std::ostream &os, const Data &data)
ostream_joiner< std::decay_t< DelimT >, CharT, Traits > make_ostream_joiner(std::basic_ostream< CharT, Traits > &os, DelimT &&delimiter)
Backport of ostream_joiner from the Library Fundamentals v2 TS.