\hypertarget{classRouteWalker}{
\section{RouteWalker$<$ A $>$ Class Template Reference}
\label{classRouteWalker}\index{RouteWalker@{RouteWalker}}
}


Asynchronous \hyperlink{classRouteDB}{RouteDB} walker.  




{\ttfamily \#include $<$route\_\-db.hh$>$}

Inheritance diagram for RouteWalker$<$ A $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classRouteWalker}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries State} \{ {\bfseries STATE\_\-RUNNING}, 
{\bfseries STATE\_\-PAUSED}
 \}
\item 
\hypertarget{classRouteWalker_a73bd69f517e7b924e5ceee8cf885330d}{
typedef A {\bfseries Addr}}
\label{classRouteWalker_a73bd69f517e7b924e5ceee8cf885330d}

\item 
\hypertarget{classRouteWalker_a7cbf6bebda8d967c9673773cae23a231}{
typedef \hyperlink{classIPNet}{IPNet}$<$ A $>$ {\bfseries Net}}
\label{classRouteWalker_a7cbf6bebda8d967c9673773cae23a231}

\item 
\hypertarget{classRouteWalker_af83d0af766a1d07d3b924a8d12f1a97a}{
typedef \hyperlink{classRouteDB}{RouteDB}$<$ A $>$::RouteContainer {\bfseries RouteContainer}}
\label{classRouteWalker_af83d0af766a1d07d3b924a8d12f1a97a}

\item 
\hypertarget{classRouteWalker_a24a63a1b137f24296af6e4eed793ffd2}{
typedef \hyperlink{classRouteDB}{RouteDB}$<$ A $>$::\hyperlink{classRouteEntry}{Route} {\bfseries Route}}
\label{classRouteWalker_a24a63a1b137f24296af6e4eed793ffd2}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classRouteWalker_a174f47f1451665ffb2d2095e82f7b3b1}{
{\bfseries RouteWalker} (\hyperlink{classRouteDB}{RouteDB}$<$ A $>$ \&route\_\-db)}
\label{classRouteWalker_a174f47f1451665ffb2d2095e82f7b3b1}

\item 
State \hyperlink{classRouteWalker_a8a20112a42374fd7ccb63479679a5469}{state} () const 
\item 
const \hyperlink{classRouteEntry}{Route} $\ast$ \hyperlink{classRouteWalker_a52e4a282c043b4a3bba05695fc6402a5}{next\_\-route} ()
\begin{DoxyCompactList}\small\item\em Move iterator to next available route. \item\end{DoxyCompactList}\item 
const \hyperlink{classRouteEntry}{Route} $\ast$ \hyperlink{classRouteWalker_ad2bcd3ea4f63ffa1128cad8ee76eeac9}{current\_\-route} ()
\begin{DoxyCompactList}\small\item\em Get current route. \item\end{DoxyCompactList}\item 
void \hyperlink{classRouteWalker_a276c34f185ce9294d9073303003e270d}{pause} (uint32\_\-t pause\_\-ms)
\begin{DoxyCompactList}\small\item\em \hyperlink{classPause}{Pause} route walking operation. \item\end{DoxyCompactList}\item 
void \hyperlink{classRouteWalker_ac11a92ae6f123357e0e324a6661f9865}{resume} ()
\begin{DoxyCompactList}\small\item\em Resume route walking. \item\end{DoxyCompactList}\item 
void \hyperlink{classRouteWalker_a7da4080250c3551f9ed853e1335ae058}{reset} ()
\begin{DoxyCompactList}\small\item\em Effect a reset. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classRouteWalker_ac8c1a8b55deb5582196237cbd717d3ea}{
\hyperlink{classRouteDB}{RouteDB}$<$ A $>$ \& {\bfseries \_\-route\_\-db}}
\label{classRouteWalker_ac8c1a8b55deb5582196237cbd717d3ea}

\item 
\hypertarget{classRouteWalker_aa7b2e643d1b9e3413af0f079974eff2a}{
State {\bfseries \_\-state}}
\label{classRouteWalker_aa7b2e643d1b9e3413af0f079974eff2a}

\item 
\hypertarget{classRouteWalker_a14717029a0cdb2b52a9d630ed40d4efa}{
\hyperlink{classIPNet}{Net} {\bfseries \_\-last\_\-visited}}
\label{classRouteWalker_a14717029a0cdb2b52a9d630ed40d4efa}

\item 
\hypertarget{classRouteWalker_aeebdf8cdbd6db9b016f40edd985a6130}{
RouteContainer::iterator {\bfseries \_\-pos}}
\label{classRouteWalker_aeebdf8cdbd6db9b016f40edd985a6130}

\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classRouteWalker_a8b0a556858c0c6558dd3aa5254b07b56}{
static const \hyperlink{classIPNet}{Net} {\bfseries NO\_\-NET}}
\label{classRouteWalker_a8b0a556858c0c6558dd3aa5254b07b56}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$typename A$>$ class RouteWalker$<$ A $>$}

Asynchronous \hyperlink{classRouteDB}{RouteDB} walker. The \hyperlink{classRouteWalker}{RouteWalker} class walks \hyperlink{protocolthe-p}{the} routes in a \hyperlink{classRouteDB}{RouteDB}. It assumes \hyperlink{protocolthe-p}{the} walking is broken up into a number of shorter walks, and that each short walk is triggered from a \hyperlink{classXorpTimer}{XorpTimer}. The end of a short walk causes state to saved and is signalled using \hyperlink{protocolthe-p}{the} \hyperlink{classRouteWalker_a276c34f185ce9294d9073303003e270d}{pause()} method. When \hyperlink{protocolthe-p}{the} next short walk is ready to start, \hyperlink{classRouteWalker_ac11a92ae6f123357e0e324a6661f9865}{resume()} should be called. These calls save and resume state are relatively expensive. 

\subsection{Member Function Documentation}
\hypertarget{classRouteWalker_ad2bcd3ea4f63ffa1128cad8ee76eeac9}{
\index{RouteWalker@{RouteWalker}!current\_\-route@{current\_\-route}}
\index{current\_\-route@{current\_\-route}!RouteWalker@{RouteWalker}}
\subsubsection[{current\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ const {\bf RouteWalker}$<$ A $>$::{\bf Route} $\ast$ {\bf RouteWalker}$<$ A $>$::current\_\-route (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classRouteWalker_ad2bcd3ea4f63ffa1128cad8ee76eeac9}


Get current route. 

\begin{DoxyReturn}{Returns}
pointer to route if available, 0 if route not available or not in STATE\_\-RUNNING state. 
\end{DoxyReturn}
\hypertarget{classRouteWalker_a52e4a282c043b4a3bba05695fc6402a5}{
\index{RouteWalker@{RouteWalker}!next\_\-route@{next\_\-route}}
\index{next\_\-route@{next\_\-route}!RouteWalker@{RouteWalker}}
\subsubsection[{next\_\-route}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ const {\bf RouteWalker}$<$ A $>$::{\bf Route} $\ast$ {\bf RouteWalker}$<$ A $>$::next\_\-route (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classRouteWalker_a52e4a282c043b4a3bba05695fc6402a5}


Move iterator to next available route. 

\begin{DoxyReturn}{Returns}
true on success, false if route not available or instance is not in \hyperlink{protocolthe-p}{the} STATE\_\-RUNNING state. 
\end{DoxyReturn}
\hypertarget{classRouteWalker_a276c34f185ce9294d9073303003e270d}{
\index{RouteWalker@{RouteWalker}!pause@{pause}}
\index{pause@{pause}!RouteWalker@{RouteWalker}}
\subsubsection[{pause}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf RouteWalker}$<$ A $>$::pause (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{pause\_\-ms}
\end{DoxyParamCaption}
)}}
\label{classRouteWalker_a276c34f185ce9294d9073303003e270d}


\hyperlink{classPause}{Pause} route walking operation. 

The instance state is transitioned from STATE\_\-RUNNING to STATE\_\-PAUSED on \hyperlink{protocolthe-p}{the} assumption that route walking will be resumed at some point in \hyperlink{protocolthe-p}{the} future (\hyperlink{classRouteWalker_ac11a92ae6f123357e0e324a6661f9865}{resume}). If \hyperlink{protocolthe-p}{the} current route has a deletion timer associated with it that would expire within pause\_\-ms, \hyperlink{protocolthe-p}{the} timer expiry is pushed back so it will expire at a time after \hyperlink{protocolthe-p}{the} expected resume time. Thus in most cases a walk can safely resume from where it was paused.


\begin{DoxyParams}{Parameters}
{\em pause\_\-ms} & \hyperlink{protocolthe-p}{the} expected time before resume is called. \\
\hline
\end{DoxyParams}
\hypertarget{classRouteWalker_a7da4080250c3551f9ed853e1335ae058}{
\index{RouteWalker@{RouteWalker}!reset@{reset}}
\index{reset@{reset}!RouteWalker@{RouteWalker}}
\subsubsection[{reset}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf RouteWalker}$<$ A $>$::reset (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classRouteWalker_a7da4080250c3551f9ed853e1335ae058}


Effect a reset. 

The internal iterator is moved to \hyperlink{protocolthe-p}{the} first stored route and \hyperlink{protocolthe-p}{the} state is set to STATE\_\-RUNNING. \hypertarget{classRouteWalker_ac11a92ae6f123357e0e324a6661f9865}{
\index{RouteWalker@{RouteWalker}!resume@{resume}}
\index{resume@{resume}!RouteWalker@{RouteWalker}}
\subsubsection[{resume}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf RouteWalker}$<$ A $>$::resume (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classRouteWalker_ac11a92ae6f123357e0e324a6661f9865}


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 \hyperlink{protocolthe-p}{the} route pointed to have been deleted. \hypertarget{classRouteWalker_a8a20112a42374fd7ccb63479679a5469}{
\index{RouteWalker@{RouteWalker}!state@{state}}
\index{state@{state}!RouteWalker@{RouteWalker}}
\subsubsection[{state}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A$>$ State {\bf RouteWalker}$<$ A $>$::state (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classRouteWalker_a8a20112a42374fd7ccb63479679a5469}
\begin{DoxyReturn}{Returns}
current state of instance. 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/rip/route\_\-db.hh\item 
/home/greearb/git/xorp.ct.github/xorp/rip/route\_\-db.cc\end{DoxyCompactItemize}
