26 #ifndef NFD_DAEMON_RIB_ROUTE_HPP
27 #define NFD_DAEMON_RIB_ROUTE_HPP
31 #include <ndn-cxx/encoding/nfd-constants.hpp>
32 #include <ndn-cxx/mgmt/nfd/route-flags-traits.hpp>
33 #include <ndn-cxx/prefix-announcement.hpp>
34 #include <ndn-cxx/util/scheduler.hpp>
36 #include <type_traits>
42 class Route :
public ndn::nfd::RouteFlagsTraits<Route>
53 Route(
const ndn::PrefixAnnouncement& ann, uint64_t
faceId);
55 const scheduler::EventId&
58 return m_expirationEvent;
64 m_expirationEvent = eid;
70 m_expirationEvent.cancel();
73 std::underlying_type_t<ndn::nfd::RouteFlags>
81 ndn::nfd::RouteOrigin
origin = ndn::nfd::ROUTE_ORIGIN_APP;
83 std::underlying_type_t<ndn::nfd::RouteFlags>
flags = ndn::nfd::ROUTE_FLAGS_NONE;
84 std::optional<time::steady_clock::time_point>
expires;
103 scheduler::EventId m_expirationEvent;
112 return !(lhs == rhs);
Represents a route for a name prefix.
Route()=default
Default constructor.
ndn::nfd::RouteOrigin origin
std::underlying_type_t< ndn::nfd::RouteFlags > getFlags() const
std::underlying_type_t< ndn::nfd::RouteFlags > flags
time::steady_clock::time_point annExpires
Expiration time of the prefix announcement.
std::optional< time::steady_clock::time_point > expires
void setExpirationEvent(const scheduler::EventId &eid)
void cancelExpirationEvent()
std::optional< ndn::PrefixAnnouncement > announcement
The prefix announcement that caused the creation of this route.
const scheduler::EventId & getExpirationEvent() const
bool operator!=(const Route &lhs, const Route &rhs)
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
bool operator==(const Route &lhs, const Route &rhs)