29 #include <boost/range/adaptor/reversed.hpp>
34 BOOST_CONCEPT_ASSERT((StatusDatasetItem<NextHopRecord>));
35 BOOST_CONCEPT_ASSERT((StatusDatasetItem<FibEntry>));
64 template<encoding::Tag TAG>
68 size_t totalLength = 0;
73 totalLength += block.prependVarNumber(totalLength);
92 m_wire = buffer.block();
136 return os <<
"NextHopRecord("
162 m_nextHopRecords.push_back(nh);
170 m_nextHopRecords.clear();
175 template<encoding::Tag TAG>
179 size_t totalLength = 0;
181 for (
const auto& nh : m_nextHopRecords | boost::adaptors::reversed) {
182 totalLength += nh.wireEncode(block);
186 totalLength += block.prependVarNumber(totalLength);
205 m_wire = buffer.block();
229 m_nextHopRecords.clear();
234 m_nextHopRecords.emplace_back(*val);
245 aNextHops.
size() != bNextHops.size())
248 std::vector<bool> matched(bNextHops.size(),
false);
249 return std::all_of(aNextHops.begin(), aNextHops.end(),
251 for (size_t i = 0; i < bNextHops.size(); ++i) {
252 if (!matched[i] && bNextHops[i] == nh) {
264 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
Fast encoding or block size estimation.
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
const uint64_t INVALID_FACE_ID
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.