routing-table-status.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NLSR_TLV_ROUTING_TABLE_STATUS_HPP
23 #define NLSR_TLV_ROUTING_TABLE_STATUS_HPP
24 
25 #include "routing-table-entry.hpp"
26 #include "destination.hpp"
27 
28 #include <ndn-cxx/util/time.hpp>
29 #include <ndn-cxx/encoding/block.hpp>
30 #include <ndn-cxx/encoding/encoding-buffer.hpp>
31 #include <ndn-cxx/encoding/tlv.hpp>
32 #include <ndn-cxx/name.hpp>
33 
34 #include <list>
35 
36 namespace nlsr {
37 namespace tlv {
38 
47 {
48 public:
49  class Error : public ndn::tlv::Error
50  {
51  public:
52  explicit
53  Error(const std::string& what)
54  : ndn::tlv::Error(what)
55  {
56  }
57  };
58 
59  typedef std::list<RoutingTable> RTList;
60 
62 
63  explicit
64  RoutingTableStatus(const ndn::Block& block);
65 
66  const std::list<RoutingTable>&
68  {
69  return m_routingtables;
70  }
71 
73  addRoutingTable(const RoutingTable& routeTable);
74 
77 
78  bool
80 
81  template<ndn::encoding::Tag TAG>
82  size_t
83  wireEncode(ndn::EncodingImpl<TAG>& block) const;
84 
85  const ndn::Block&
86  wireEncode() const;
87 
88  void
89  wireDecode(const ndn::Block& wire);
90 
91 private:
92  RTList m_routingtables;
93  bool m_hasRoutingtable;
94 
95  mutable ndn::Block m_wire;
96 };
97 
99 
100 std::ostream&
101 operator<<(std::ostream& os, const RoutingTableStatus& rtStatus);
102 
103 } // namespace tlv
104 } // namespace nlsr
105 
106 #endif // NLSR_TLV_ROUTING_TABLE_STATUS_HPP
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
Definition: tlv-nlsr.hpp:28
RoutingTableStatus & addRoutingTable(const RoutingTable &routeTable)
const ndn::Block & wireEncode() const
Data abstraction for routing table status.
Data abstraction for RouteTableInfo.
std::list< RoutingTable > RTList
Copyright (c) 2014-2018, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
RoutingTableStatus & clearRoutingTable()
const std::list< RoutingTable > & getRoutingtable() const
std::ostream & operator<<(std::ostream &os, const AdjacencyLsa &adjacencyLsa)
void wireDecode(const ndn::Block &wire)
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(AdjacencyLsa)