NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
route.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_RIB_ROUTE_HPP
27 #define NFD_RIB_ROUTE_HPP
28 
29 #include "common.hpp"
30 #include "core/scheduler.hpp"
31 #include <ndn-cxx/encoding/nfd-constants.hpp>
32 
33 namespace nfd {
34 namespace rib {
35 
38 class Route
39 {
40 public:
42  : faceId(0)
43  , origin(0)
44  , flags(0)
45  , cost(0)
46  , expires(time::steady_clock::TimePoint::min())
47  , m_expirationEvent()
48  {
49  }
50 
51  bool
52  operator==(const Route& other) const;
53 
54 public:
55  void
57  {
58  m_expirationEvent = eid;
59  }
60 
61  const scheduler::EventId&
63  {
64  return m_expirationEvent;
65  }
66 
67  bool
69  {
71  }
72 
73  bool
74  isCapture() const
75  {
77  }
78 
79 public:
80  uint64_t faceId;
81  uint64_t origin;
82  uint64_t flags;
83  uint64_t cost;
85 
86 private:
87  scheduler::EventId m_expirationEvent;
88 };
89 
90 inline bool
91 compareFaceIdAndOrigin(const Route& lhs, const Route& rhs)
92 {
93  return (lhs.faceId == rhs.faceId && lhs.origin == rhs.origin);
94 }
95 
96 inline bool
97 compareFaceId(const Route& route, const uint64_t faceId)
98 {
99  return (route.faceId == faceId);
100 }
101 
102 std::ostream&
103 operator<<(std::ostream& os, const Route& route);
104 
105 } // namespace rib
106 } // namespace nfd
107 
108 #endif // NFD_RIB_ROUTE_HPP
time_point TimePoint
Definition: time.hpp:108
bool operator==(const Route &other) const
Definition: route.cpp:32
const scheduler::EventId & getExpirationEvent() const
Definition: route.hpp:62
void setExpirationEvent(const scheduler::EventId eid)
Definition: route.hpp:56
time::steady_clock::TimePoint expires
Definition: route.hpp:84
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Definition: fib-update.hpp:74
bool isChildInherit() const
Definition: route.hpp:68
uint64_t cost
Definition: route.hpp:83
uint64_t faceId
Definition: route.hpp:80
bool compareFaceIdAndOrigin(const Route &lhs, const Route &rhs)
Definition: route.hpp:91
std::shared_ptr< ns3::EventId > EventId
Definition: scheduler.hpp:39
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
uint64_t origin
Definition: route.hpp:81
represents a route for a name prefix
Definition: route.hpp:38
uint64_t flags
Definition: route.hpp:82
bool compareFaceId(const Route &route, const uint64_t faceId)
Definition: route.hpp:97
bool isCapture() const
Definition: route.hpp:74