26 #ifndef NFD_DAEMON_RIB_RIB_ENTRY_HPP
27 #define NFD_DAEMON_RIB_RIB_ENTRY_HPP
38 class RibEntry :
public std::enable_shared_from_this<RibEntry>
63 const std::list<shared_ptr<RibEntry>>&
70 addChild(shared_ptr<RibEntry> child);
85 std::pair<RibEntry::iterator, bool>
124 return m_inheritedRoutes;
133 RouteList::const_iterator
145 return m_nRoutesWithCaptureSet > 0;
182 ndn::PrefixAnnouncement
184 time::milliseconds maxExpiration = 1_h)
const;
195 return m_routes.empty();
201 return m_routes.begin();
207 return m_routes.end();
213 return m_routes.begin();
219 return m_routes.end();
224 std::list<shared_ptr<RibEntry>> m_children;
225 shared_ptr<RibEntry> m_parent;
235 uint64_t m_nRoutesWithCaptureSet = 0;
239 operator<<(std::ostream& os,
const RibEntry& entry);
Represents a RIB entry, which contains one or more Routes with the same prefix.
const RouteList & getInheritedRoutes() const noexcept
Returns the routes this namespace has inherited.
RouteList::const_iterator findInheritedRoute(const Route &route) const
Finds an inherited route with a matching face ID.
const Route * getRouteWithLowestCostByFaceId(uint64_t faceId) const
Returns the route with the lowest cost that has the passed face ID.
iterator findRoute(const Route &route)
void addInheritedRoute(const Route &route)
bool empty() const noexcept
void removeInheritedRoute(const Route &route)
std::pair< RibEntry::iterator, bool > insertRoute(const Route &route)
Inserts a new route into the entry's route list.
const_iterator end() const noexcept
const std::list< shared_ptr< RibEntry > > & getChildren() const noexcept
const RouteList & getRoutes() const noexcept
void eraseRoute(const Route &route)
Erases a Route with the same FaceId and origin.
RouteList::const_iterator const_iterator
const Route * getRouteWithLowestCostAndChildInheritByFaceId(uint64_t faceId) const
Returns the route with the lowest cost that has the passed face ID and its child inherit flag set.
RouteList::iterator iterator
void addChild(shared_ptr< RibEntry > child)
const Name & getName() const noexcept
ndn::PrefixAnnouncement getPrefixAnnouncement(time::milliseconds minExpiration=15_s, time::milliseconds maxExpiration=1_h) const
Retrieve a prefix announcement suitable for readvertising this route.
void removeChild(shared_ptr< RibEntry > child)
iterator begin() noexcept
const Route * getRouteWithSecondLowestCostByFaceId(uint64_t faceId) const
bool hasFaceId(uint64_t faceId) const
void setName(const Name &prefix)
const_iterator begin() const noexcept
bool hasChildInheritOnFaceId(uint64_t faceId) const
Determines if the entry has an inherited route with the passed face ID and its child inherit flag set...
std::list< Route > RouteList
shared_ptr< RibEntry > getParent() const
bool hasCapture() const noexcept
bool hasInheritedRoute(const Route &route) const
Determines if the entry has an inherited route with a matching face ID.
Represents a route for a name prefix.
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)