\hypertarget{classUpdateQueue}{
\section{UpdateQueue$<$ A $>$ Class Template Reference}
\label{classUpdateQueue}\index{UpdateQueue@{UpdateQueue}}
}


Update Queue for RIP \hyperlink{classRoute}{Route} entries.  




{\ttfamily \#include $<$update\_\-queue.hh$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classUpdateQueue_a80d41466eab32cd05b4b8c9ddbfd4654}{
typedef \hyperlink{classref__ptr}{ref\_\-ptr}$<$ \hyperlink{classUpdateQueueReader}{Reader} $>$ {\bfseries ReadIterator}}
\label{classUpdateQueue_a80d41466eab32cd05b4b8c9ddbfd4654}

\item 
\hypertarget{classUpdateQueue_a38eac2718b8cb12c745d4a30ba5fed2c}{
typedef \hyperlink{classRouteEntryRef}{RouteEntryRef}$<$ A $>$ {\bfseries RouteUpdate}}
\label{classUpdateQueue_a38eac2718b8cb12c745d4a30ba5fed2c}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classUpdateQueue_a223c5301e91a62999a8953c6e1a60934}{
void \hyperlink{classUpdateQueue_a223c5301e91a62999a8953c6e1a60934}{push\_\-back} (const \hyperlink{classRouteEntryRef}{RouteUpdate} \&ru)}
\label{classUpdateQueue_a223c5301e91a62999a8953c6e1a60934}

\begin{DoxyCompactList}\small\item\em Add update to back of queue. \item\end{DoxyCompactList}\item 
\hypertarget{classUpdateQueue_a06f486fdd1cc5ebae74de2ea94237e8d}{
void \hyperlink{classUpdateQueue_a06f486fdd1cc5ebae74de2ea94237e8d}{flush} ()}
\label{classUpdateQueue_a06f486fdd1cc5ebae74de2ea94237e8d}

\begin{DoxyCompactList}\small\item\em Remove all queued entries and reset all read iterators to \hyperlink{protocolthe-p}{the} front of \hyperlink{protocolthe-p}{the} queue. \item\end{DoxyCompactList}\item 
\hyperlink{classref__ptr}{ReadIterator} \hyperlink{classUpdateQueue_a19bfc39c1a7e7756bac0fe8b070fa598}{create\_\-reader} ()
\begin{DoxyCompactList}\small\item\em Create a read iterator. \item\end{DoxyCompactList}\item 
void \hyperlink{classUpdateQueue_a40019b8dc03910dac434ffc02b46cd26}{destroy\_\-reader} (\hyperlink{classref__ptr}{ReadIterator} \&r)
\begin{DoxyCompactList}\small\item\em Destroy read iterator. \item\end{DoxyCompactList}\item 
bool \hyperlink{classUpdateQueue_a8ce397c540cc9541227dfac01dcea65b}{reader\_\-valid} (const \hyperlink{classref__ptr}{ReadIterator} \&r)
\begin{DoxyCompactList}\small\item\em Check ReadIterator's validity. \item\end{DoxyCompactList}\item 
const \hyperlink{classRouteEntry}{RouteEntry}$<$ A $>$ $\ast$ \hyperlink{classUpdateQueue_a666efd8c3fa3dee4be4e5184563a0014}{next} (\hyperlink{classref__ptr}{ReadIterator} \&r)
\begin{DoxyCompactList}\small\item\em Increment iterator and return pointer to entry if available. \item\end{DoxyCompactList}\item 
const \hyperlink{classRouteEntry}{RouteEntry}$<$ A $>$ $\ast$ \hyperlink{classUpdateQueue_a1c1b223807fbdb2ea58e5c9e980adfd5}{get} (\hyperlink{classref__ptr}{ReadIterator} \&r) const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} \hyperlink{classRouteEntry}{RouteEntry} associated with \hyperlink{protocolthe-p}{the} read iterator. \item\end{DoxyCompactList}\item 
void \hyperlink{classUpdateQueue_a30e7797a6fae0ddefb21e183923b8cf1}{ffwd} (\hyperlink{classref__ptr}{ReadIterator} \&r)
\begin{DoxyCompactList}\small\item\em Advance read iterator to end of update queue. \item\end{DoxyCompactList}\item 
\hypertarget{classUpdateQueue_afdd895617bac3575d395d1e369c9ba3b}{
void \hyperlink{classUpdateQueue_afdd895617bac3575d395d1e369c9ba3b}{rwd} (\hyperlink{classref__ptr}{ReadIterator} \&r)}
\label{classUpdateQueue_afdd895617bac3575d395d1e369c9ba3b}

\begin{DoxyCompactList}\small\item\em Move read iterator to first entry of update queue. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classUpdateQueue_a867c48da7b271ba97409a2af810d4a18}{updates\_\-queued} () const 
\begin{DoxyCompactList}\small\item\em Return number of updates held. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classUpdateQueue_aea9df23eb11be90e902eed0695a83476}{
typedef \hyperlink{classUpdateQueueReader}{UpdateQueueReader}$<$ A $>$ {\bfseries Reader}}
\label{classUpdateQueue_aea9df23eb11be90e902eed0695a83476}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classUpdateQueue_ac638d7293d952fe885c419ea6550ddc8}{
\hyperlink{classUpdateQueueImpl}{UpdateQueueImpl}$<$ A $>$ $\ast$ {\bfseries \_\-impl}}
\label{classUpdateQueue_ac638d7293d952fe885c419ea6550ddc8}

\end{DoxyCompactItemize}


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

Update Queue for RIP \hyperlink{classRoute}{Route} entries. The Update Queue has is conceptually a single writer multi-\/reader queue. It is used to store state for triggered updates and may be used unsolicited responses (routing table announcements). 

\subsection{Member Function Documentation}
\hypertarget{classUpdateQueue_a19bfc39c1a7e7756bac0fe8b070fa598}{
\index{UpdateQueue@{UpdateQueue}!create\_\-reader@{create\_\-reader}}
\index{create\_\-reader@{create\_\-reader}!UpdateQueue@{UpdateQueue}}
\subsubsection[{create\_\-reader}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ {\bf UpdateQueue}$<$ A $>$::{\bf ReadIterator} {\bf UpdateQueue}$<$ A $>$::create\_\-reader (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classUpdateQueue_a19bfc39c1a7e7756bac0fe8b070fa598}


Create a read iterator. 

These are reference counted entities that need to be stored in order to operate. The newly created reader is set to \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} update queue. \hypertarget{classUpdateQueue_a40019b8dc03910dac434ffc02b46cd26}{
\index{UpdateQueue@{UpdateQueue}!destroy\_\-reader@{destroy\_\-reader}}
\index{destroy\_\-reader@{destroy\_\-reader}!UpdateQueue@{UpdateQueue}}
\subsubsection[{destroy\_\-reader}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf UpdateQueue}$<$ A $>$::destroy\_\-reader (
\begin{DoxyParamCaption}
\item[{{\bf ReadIterator} \&}]{r}
\end{DoxyParamCaption}
)}}
\label{classUpdateQueue_a40019b8dc03910dac434ffc02b46cd26}


Destroy read iterator. 

This method detaches \hyperlink{protocolthe-p}{the} iterator from \hyperlink{protocolthe-p}{the} update queue. Use of \hyperlink{protocolthe-p}{the} iterator after this call is unsafe. \hypertarget{classUpdateQueue_a30e7797a6fae0ddefb21e183923b8cf1}{
\index{UpdateQueue@{UpdateQueue}!ffwd@{ffwd}}
\index{ffwd@{ffwd}!UpdateQueue@{UpdateQueue}}
\subsubsection[{ffwd}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ void {\bf UpdateQueue}$<$ A $>$::ffwd (
\begin{DoxyParamCaption}
\item[{{\bf ReadIterator} \&}]{r}
\end{DoxyParamCaption}
)}}
\label{classUpdateQueue_a30e7797a6fae0ddefb21e183923b8cf1}


Advance read iterator to end of update queue. 

Calls to \hyperlink{classUpdateQueue_a666efd8c3fa3dee4be4e5184563a0014}{next} and \hyperlink{classUpdateQueue_a1c1b223807fbdb2ea58e5c9e980adfd5}{get} will return 0 until further updates occur. \hypertarget{classUpdateQueue_a1c1b223807fbdb2ea58e5c9e980adfd5}{
\index{UpdateQueue@{UpdateQueue}!get@{get}}
\index{get@{get}!UpdateQueue@{UpdateQueue}}
\subsubsection[{get}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ const {\bf RouteEntry}$<$ A $>$ $\ast$ {\bf UpdateQueue}$<$ A $>$::get (
\begin{DoxyParamCaption}
\item[{{\bf ReadIterator} \&}]{r}
\end{DoxyParamCaption}
) const}}
\label{classUpdateQueue_a1c1b223807fbdb2ea58e5c9e980adfd5}


Get \hyperlink{protocolthe-p}{the} \hyperlink{classRouteEntry}{RouteEntry} associated with \hyperlink{protocolthe-p}{the} read iterator. 

\begin{DoxyReturn}{Returns}
A pointer to a \hyperlink{classRouteEntry}{RouteEntry} if available, 0 otherwise. 
\end{DoxyReturn}
\hypertarget{classUpdateQueue_a666efd8c3fa3dee4be4e5184563a0014}{
\index{UpdateQueue@{UpdateQueue}!next@{next}}
\index{next@{next}!UpdateQueue@{UpdateQueue}}
\subsubsection[{next}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ const {\bf RouteEntry}$<$ A $>$ $\ast$ {\bf UpdateQueue}$<$ A $>$::next (
\begin{DoxyParamCaption}
\item[{{\bf ReadIterator} \&}]{r}
\end{DoxyParamCaption}
)}}
\label{classUpdateQueue_a666efd8c3fa3dee4be4e5184563a0014}


Increment iterator and return pointer to entry if available. 

\begin{DoxyReturn}{Returns}
A pointer to a \hyperlink{classRouteEntry}{RouteEntry} if available, 0 otherwise. 
\end{DoxyReturn}
\hypertarget{classUpdateQueue_a8ce397c540cc9541227dfac01dcea65b}{
\index{UpdateQueue@{UpdateQueue}!reader\_\-valid@{reader\_\-valid}}
\index{reader\_\-valid@{reader\_\-valid}!UpdateQueue@{UpdateQueue}}
\subsubsection[{reader\_\-valid}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ bool {\bf UpdateQueue}$<$ A $>$::reader\_\-valid (
\begin{DoxyParamCaption}
\item[{const {\bf ReadIterator} \&}]{r}
\end{DoxyParamCaption}
)}}
\label{classUpdateQueue_a8ce397c540cc9541227dfac01dcea65b}


Check ReadIterator's validity. 


\begin{DoxyParams}{Parameters}
{\em r} & reader to be checked. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if r is an active read iterator, false if iterator does not belong to this instance or has been destroyed. 
\end{DoxyReturn}
\hypertarget{classUpdateQueue_a867c48da7b271ba97409a2af810d4a18}{
\index{UpdateQueue@{UpdateQueue}!updates\_\-queued@{updates\_\-queued}}
\index{updates\_\-queued@{updates\_\-queued}!UpdateQueue@{UpdateQueue}}
\subsubsection[{updates\_\-queued}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename A $>$ uint32\_\-t {\bf UpdateQueue}$<$ A $>$::updates\_\-queued (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classUpdateQueue_a867c48da7b271ba97409a2af810d4a18}


Return number of updates held. 

Note: this may be more than are available for reading since there is internal buffering and \hyperlink{classUpdateQueue}{UpdateQueue} iterators attach at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} \hyperlink{classUpdateQueue}{UpdateQueue}.

\begin{DoxyReturn}{Returns}
number of updates queued. 
\end{DoxyReturn}


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