\hypertarget{classFileVarRW}{
\section{FileVarRW Class Reference}
\label{classFileVarRW}\index{FileVarRW@{FileVarRW}}
}
Inheritance diagram for FileVarRW:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classFileVarRW}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classFileVarRW_1_1Error}{Error}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const \hyperlink{classElement}{Element} \& \hyperlink{classFileVarRW_aee690b6e4308bb2e5ecc38531fec5109}{read} (const Id \&)
\begin{DoxyCompactList}\small\item\em Read a variable from a route \mbox{[}such as nexthop\mbox{]}. \item\end{DoxyCompactList}\item 
void \hyperlink{classFileVarRW_a986d4b101c0ec1971794f89ff2864656}{write} (const Id \&, const \hyperlink{classElement}{Element} \&)
\begin{DoxyCompactList}\small\item\em Write a variable to a route. \item\end{DoxyCompactList}\item 
void \hyperlink{classFileVarRW_a9a64b305189c943c209b035afec1763a}{sync} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{classVarRW}{VarRW} must perform all pending writes to \hyperlink{protocolthe-p}{the} route now. \item\end{DoxyCompactList}\item 
\hypertarget{classFileVarRW_a9b6252e1a39aa976997a1b418d761e95}{
void {\bfseries printVars} ()}
\label{classFileVarRW_a9b6252e1a39aa976997a1b418d761e95}

\item 
\hypertarget{classFileVarRW_a4966f29c9dd523ea1fd81e9fcbf195aa}{
void {\bfseries load} (const string \&fname)}
\label{classFileVarRW_a4966f29c9dd523ea1fd81e9fcbf195aa}

\item 
\hypertarget{classFileVarRW_a324aa27d5baf2191800d737ba1c39ff5}{
void {\bfseries set\_\-verbose} (bool)}
\label{classFileVarRW_a324aa27d5baf2191800d737ba1c39ff5}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classFileVarRW_ac3965b45c68cc07b20f8b4fbb80b5f4e}{
bool {\bfseries doLine} (const string \&line)}
\label{classFileVarRW_ac3965b45c68cc07b20f8b4fbb80b5f4e}

\item 
\hypertarget{classFileVarRW_ab968d38f494f47b6c612d20c58be184d}{
void {\bfseries clear\_\-trash} ()}
\label{classFileVarRW_ab968d38f494f47b6c612d20c58be184d}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classFileVarRW_a6ca3529bbd75630b15864a0cced16855}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries \_\-map} \mbox{[}VAR\_\-MAX\mbox{]}}
\label{classFileVarRW_a6ca3529bbd75630b15864a0cced16855}

\item 
\hypertarget{classFileVarRW_a669299d66c1cae476251b4c62d269da9}{
\hyperlink{classElementFactory}{ElementFactory} {\bfseries \_\-ef}}
\label{classFileVarRW_a669299d66c1cae476251b4c62d269da9}

\item 
\hypertarget{classFileVarRW_a233be91700dafd8ec44b0b291740178f}{
\hyperlink{classElement}{Element} $\ast$ {\bfseries \_\-trash} \mbox{[}MAX\_\-TRASH\mbox{]}}
\label{classFileVarRW_a233be91700dafd8ec44b0b291740178f}

\item 
\hypertarget{classFileVarRW_aed769bc4f306c2caf31ee7ddbf3e6fc9}{
int {\bfseries \_\-trashc}}
\label{classFileVarRW_aed769bc4f306c2caf31ee7ddbf3e6fc9}

\item 
\hypertarget{classFileVarRW_a758dc7260547dea8974ea98638dd7c97}{
bool {\bfseries \_\-verbose}}
\label{classFileVarRW_a758dc7260547dea8974ea98638dd7c97}

\end{DoxyCompactItemize}
\subsection*{Static Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classFileVarRW_a6a6a0d056cc9b27cd6c14c0ec2c7aed8}{
static const int {\bfseries MAX\_\-TRASH} = 666}
\label{classFileVarRW_a6a6a0d056cc9b27cd6c14c0ec2c7aed8}

\end{DoxyCompactItemize}


\subsection{Member Function Documentation}
\hypertarget{classFileVarRW_aee690b6e4308bb2e5ecc38531fec5109}{
\index{FileVarRW@{FileVarRW}!read@{read}}
\index{read@{read}!FileVarRW@{FileVarRW}}
\subsubsection[{read}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Element} \& FileVarRW::read (
\begin{DoxyParamCaption}
\item[{const Id \&}]{id}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classFileVarRW_aee690b6e4308bb2e5ecc38531fec5109}


Read a variable from a route \mbox{[}such as nexthop\mbox{]}. 

If \hyperlink{protocolthe-p}{the} protocol doesn't support \hyperlink{protocolthe-p}{the} requested variable, and exception should be thrown.

If \hyperlink{protocolthe-p}{the} variable is not present in \hyperlink{protocolthe-p}{the} current route, then an \hyperlink{classElemNull}{ElemNull} should be returned \mbox{[}for example if ipv6 is requested on a v4 route\mbox{]}.

\hyperlink{classVarRW}{VarRW} is responsible for deleting \hyperlink{protocolthe-p}{the} object read \mbox{[}it owns it\mbox{]}. However care must be taken not to delete objects that were obtained by \hyperlink{classFileVarRW_a986d4b101c0ec1971794f89ff2864656}{write()} even though we pass them to \hyperlink{classFileVarRW_aee690b6e4308bb2e5ecc38531fec5109}{read()} later.

\begin{DoxyReturn}{Returns}
\hyperlink{classElement}{Element} requested, or \hyperlink{classElemNull}{ElemNull} of element is not available. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em id} & The variable that is being requested \mbox{[}such as metric\mbox{]}. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classVarRW_acb944450b84b487faeb1cbde243f76f4}{VarRW}.

\hypertarget{classFileVarRW_a9a64b305189c943c209b035afec1763a}{
\index{FileVarRW@{FileVarRW}!sync@{sync}}
\index{sync@{sync}!FileVarRW@{FileVarRW}}
\subsubsection[{sync}]{\setlength{\rightskip}{0pt plus 5cm}void FileVarRW::sync (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classFileVarRW_a9a64b305189c943c209b035afec1763a}


\hyperlink{classVarRW}{VarRW} must perform all pending writes to \hyperlink{protocolthe-p}{the} route now. 

This is usefull in scenarios where \hyperlink{classVarRW}{VarRW} decides to cache read and writes and perform \hyperlink{protocolthe-p}{the} actual writes at \hyperlink{protocolthe-p}{the} end \mbox{[}i.e. it stores pointers to elements\mbox{]}.

All pointers to elements \mbox{[}by write\mbox{]} may become invalid after a sync. 

Reimplemented from \hyperlink{classVarRW_a6ae2005b7cb7ca447185c36329bb2a14}{VarRW}.

\hypertarget{classFileVarRW_a986d4b101c0ec1971794f89ff2864656}{
\index{FileVarRW@{FileVarRW}!write@{write}}
\index{write@{write}!FileVarRW@{FileVarRW}}
\subsubsection[{write}]{\setlength{\rightskip}{0pt plus 5cm}void FileVarRW::write (
\begin{DoxyParamCaption}
\item[{const Id \&}]{id, }
\item[{const {\bf Element} \&}]{e}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classFileVarRW_a986d4b101c0ec1971794f89ff2864656}


Write a variable to a route. 

\hyperlink{classVarRW}{VarRW} does not own \hyperlink{classElement}{Element}, so it must not delete it.


\begin{DoxyParams}{Parameters}
{\em id} & Identifier of variable that must be written to. \\
\hline
{\em e} & Value that must be written to \hyperlink{protocolthe-p}{the} variable. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classVarRW_ad7447615a7d30de4c5ad847d1f885f25}{VarRW}.



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