NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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 "core/scheduler.hpp"
30 #include <ndn-cxx/encoding/nfd-constants.hpp>
31 
32 namespace nfd {
33 namespace rib {
34 
37 class Route
38 {
39 public:
41  : faceId(0)
42  , origin(0)
43  , flags(0)
44  , cost(0)
45  , expires(time::steady_clock::TimePoint::min())
46  , m_expirationEvent()
47  {
48  }
49 
50  bool
51  operator==(const Route& other) const;
52 
53 public:
54  void
56  {
57  m_expirationEvent = eid;
58  }
59 
60  const scheduler::EventId&
62  {
63  return m_expirationEvent;
64  }
65 
66  bool
68  {
70  }
71 
72  bool
73  isCapture() const
74  {
76  }
77 
78 public:
79  uint64_t faceId;
80  uint64_t origin;
81  uint64_t flags;
82  uint64_t cost;
84 
85 private:
86  scheduler::EventId m_expirationEvent;
87 };
88 
89 inline bool
90 compareFaceIdAndOrigin(const Route& lhs, const Route& rhs)
91 {
92  return (lhs.faceId == rhs.faceId && lhs.origin == rhs.origin);
93 }
94 
95 inline bool
96 compareFaceId(const Route& route, const uint64_t faceId)
97 {
98  return (route.faceId == faceId);
99 }
100 
101 std::ostream&
102 operator<<(std::ostream& os, const Route& route);
103 
104 } // namespace rib
105 } // namespace nfd
106 
107 #endif // NFD_RIB_ROUTE_HPP
time_point TimePoint
Definition: time.hpp:120
bool operator==(const Route &other) const
Definition: route.cpp:32
const scheduler::EventId & getExpirationEvent() const
Definition: route.hpp:61
void setExpirationEvent(const scheduler::EventId eid)
Definition: route.hpp:55
time::steady_clock::TimePoint expires
Definition: route.hpp:83
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Definition: fib-update.hpp:74
bool isChildInherit() const
Definition: route.hpp:67
uint64_t cost
Definition: route.hpp:82
uint64_t faceId
Definition: route.hpp:79
bool compareFaceIdAndOrigin(const Route &lhs, const Route &rhs)
Definition: route.hpp:90
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:80
represents a route for a name prefix
Definition: route.hpp:37
uint64_t flags
Definition: route.hpp:81
bool compareFaceId(const Route &route, const uint64_t faceId)
Definition: route.hpp:96
bool isCapture() const
Definition: route.hpp:73