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>
58 addChild(shared_ptr<RibEntry> child);
63 const std::list<shared_ptr<RibEntry>>&
79 std::pair<RibEntry::iterator, bool>
133 RouteList::const_iterator
179 ndn::PrefixAnnouncement
181 time::milliseconds maxExpiration = 1_h)
const;
197 setParent(shared_ptr<RibEntry> parent);
201 std::list<shared_ptr<RibEntry>> m_children;
202 shared_ptr<RibEntry> m_parent;
212 uint64_t m_nRoutesWithCaptureSet = 0;
228 RibEntry::setParent(shared_ptr<RibEntry> parent)
230 m_parent = std::move(parent);
233 inline shared_ptr<RibEntry>
239 inline const std::list<shared_ptr<RibEntry>>&
254 return m_inheritedRoutes;
260 return m_routes.begin();
266 return m_routes.end();
272 return m_routes.begin();
278 return m_routes.end();
Represents a RIB entry, which contains one or more Routes with the same prefix.
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)
void removeInheritedRoute(const Route &route)
shared_ptr< RibEntry > getParent() const
const_iterator end() const
std::pair< RibEntry::iterator, bool > insertRoute(const Route &route)
Inserts a new route into the entry's route list.
const RouteList & getInheritedRoutes() const
Returns the routes this namespace has inherited.
const RouteList & getRoutes() const
size_t getNRoutes() const
const_iterator begin() const
void eraseRoute(const Route &route)
Erases a Route with the same FaceId and origin.
RouteList::const_iterator const_iterator
const Name & getName() const
const std::list< shared_ptr< RibEntry > > & getChildren() const
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)
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)
const Route * getRouteWithSecondLowestCostByFaceId(uint64_t faceId) const
bool hasFaceId(uint64_t faceId) const
void setName(const Name &prefix)
bool hasRoute(const Route &route)
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
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)