|
|
The RouteWalker class walks the routes in a RouteDB. It assumes the walking is broken up into a number of shorter walks, and that each short walk is triggered from a XorpTimer. The end of a short walk causes state to saved and is signalled using the pause() method. When the next short walk is ready to start, resume() should be called. These calls save and resume state are relatively expensive.
typedef A Addr | Addr |
typedef IPNet<A> Net | Net |
typedef RouteDB<A>::RouteContainer RouteContainer | RouteContainer |
typedef RouteDB<A>::Route Route | Route |
enum State { STATE_RUNNING, STATE_PAUSED } | State |
RouteWalker (RouteDB<A>& route_db)
| RouteWalker |
~RouteWalker ()
| ~RouteWalker |
State state ()
| state |
[const]
Returns: current state of instance.
const Route* next_route ()
| next_route |
Move iterator to next available route.
Returns: true on success, false if route not available or instance is not in the STATE_RUNNING state.
const Route* current_route ()
| current_route |
Get current route.
Returns: pointer to route if available, 0 if route not available or not in STATE_RUNNING state.
void pause (uint32_t pause_ms)
| pause |
Pause route walking operation. The instance state is transitioned from STATE_RUNNING to STATE_PAUSED on the assumption that route walking will be resumed at some point in the future (resume). If the current route has a deletion timer associated with it that would expire within pause_ms, the timer expiry is pushed back so it will expire at a time after the expected resume time. Thus in most cases a walk can safely resume from where it was paused.
Parameters:
pause_ms | the expected time before resume is called. |
void resume ()
| resume |
Resume route walking. The instance state is transitioned from STATE_PAUSED to STATE_RUNNING. The internal iterator is checked for validity and recovery steps taken should the route pointed to have been deleted.
void reset ()
| reset |
Effect a reset. The internal iterator is moved to the first stored route and the state is set to STATE_RUNNING.
RouteWalker (const RouteWalker&)
| RouteWalker |
[protected]
RouteWalker& operator= (const RouteWalker&)
| operator= |
[protected]