fib-entry.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
21 #ifndef NLSR_FIB_ENTRY_HPP
22 #define NLSR_FIB_ENTRY_HPP
23 
24 #include <ndn-cxx/util/scheduler.hpp>
25 
26 #include "nexthop-list.hpp"
27 
28 namespace nlsr {
29 
30 class FibEntry
31 {
32 public:
34  : m_name()
35  , m_seqNo(1)
36  , m_nexthopList()
37  {
38  }
39 
40  FibEntry(const ndn::Name& name)
41  : m_seqNo(1)
42  , m_nexthopList()
43  {
44  m_name = name;
45  }
46 
47  const ndn::Name&
48  getName() const
49  {
50  return m_name;
51  }
52 
55  {
56  return m_nexthopList;
57  }
58 
59  void
60  setRefreshEventId(ndn::EventId id)
61  {
62  m_refreshEventId = id;
63  }
64 
65  ndn::EventId
67  {
68  return m_refreshEventId;
69  }
70 
71  void
72  setSeqNo(int32_t fsn)
73  {
74  m_seqNo = fsn;
75  }
76 
77  int32_t
78  getSeqNo() const
79  {
80  return m_seqNo;
81  }
82 
83  void
84  writeLog();
85 
87 
88  const_iterator
89  begin() const;
90 
91  const_iterator
92  end() const;
93 
94 private:
95  ndn::Name m_name;
96  ndn::EventId m_refreshEventId;
97  int32_t m_seqNo;
98  NexthopList m_nexthopList;
99 };
100 
103 {
104  return m_nexthopList.cbegin();
105 }
106 
109 {
110  return m_nexthopList.cend();
111 }
112 
113 } // namespace nlsr
114 
115 #endif // NLSR_FIB_ENTRY_HPP
void writeLog()
Definition: fib-entry.cpp:29
const_iterator cend() const
const_iterator cbegin() const
const_iterator begin() const
Definition: fib-entry.hpp:102
ndn::EventId getRefreshEventId() const
Definition: fib-entry.hpp:66
NexthopList & getNexthopList()
Definition: fib-entry.hpp:54
void setSeqNo(int32_t fsn)
Definition: fib-entry.hpp:72
void setRefreshEventId(ndn::EventId id)
Definition: fib-entry.hpp:60
int32_t getSeqNo() const
Definition: fib-entry.hpp:78
NexthopList::const_iterator const_iterator
Definition: fib-entry.hpp:86
Copyright (c) 2014-2017, The University of Memphis, Regents of the University of California, Arizona Board of Regents.
const ndn::Name & getName() const
Definition: fib-entry.hpp:48
FibEntry(const ndn::Name &name)
Definition: fib-entry.hpp:40
std::set< NextHop, NextHopComparator >::const_iterator const_iterator
const_iterator end() const
Definition: fib-entry.hpp:108