\hypertarget{classSemanticVarRW}{
\section{SemanticVarRW Class Reference}
\label{classSemanticVarRW}\index{SemanticVarRW@{SemanticVarRW}}
}


A \hyperlink{classVarRW}{VarRW} used for semantic checking.  




{\ttfamily \#include $<$semantic\_\-varrw.hh$>$}

Inheritance diagram for SemanticVarRW:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classSemanticVarRW}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classSemanticVarRW_1_1var__error}{var\_\-error}
\begin{DoxyCompactList}\small\item\em Exception thrown on illegal variable use. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSemanticVarRW_a02d9620d54dd0ad0100cb293059e1207}{SemanticVarRW} (\hyperlink{classVarMap}{VarMap} \&vars)
\item 
const \hyperlink{classElement}{Element} \& \hyperlink{classSemanticVarRW_a44f56ad0b390770b0826b1f3841dab16}{read} (const Id \&id)
\begin{DoxyCompactList}\small\item\em \hyperlink{classVarRW}{VarRW} read interface. \item\end{DoxyCompactList}\item 
void \hyperlink{classSemanticVarRW_adff85700d425e866acbcb304c1fd6a1f}{write} (const Id \&id, const \hyperlink{classElement}{Element} \&elem)
\begin{DoxyCompactList}\small\item\em \hyperlink{classVarRW}{VarRW} write interface. \item\end{DoxyCompactList}\item 
void \hyperlink{classSemanticVarRW_a404d1ce8d054fb545e468cd810f44508}{sync} ()
\begin{DoxyCompactList}\small\item\em \hyperlink{classVarRW}{VarRW} sync interface. \item\end{DoxyCompactList}\item 
void \hyperlink{classSemanticVarRW_acca32a722337ee72d78df9c024ea5887}{set\_\-protocol} (const string \&proto)
\begin{DoxyCompactList}\small\item\em Change \hyperlink{protocolthe-p}{the} protocol being simulated. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSemanticVarRW_af55721ea564cf6ea550636382bc666c5}{
string {\bfseries \_\-protocol}}
\label{classSemanticVarRW_af55721ea564cf6ea550636382bc666c5}

\item 
\hypertarget{classSemanticVarRW_a32a4d417dcb273a175a14b026db9d9e0}{
\hyperlink{classVarMap}{VarMap} \& {\bfseries \_\-vars}}
\label{classSemanticVarRW_a32a4d417dcb273a175a14b026db9d9e0}

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

\item 
\hypertarget{classSemanticVarRW_a33119925aae4cfceee9e100216daa227}{
set$<$ \hyperlink{classElement}{Element} $\ast$ $>$ {\bfseries \_\-trash}}
\label{classSemanticVarRW_a33119925aae4cfceee9e100216daa227}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A \hyperlink{classVarRW}{VarRW} used for semantic checking. This \hyperlink{classVarRW}{VarRW} checks if elements may be read/written to and does typechecking according to \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap}.

The user may set which protocols should be \char`\"{}simulated\char`\"{} by \hyperlink{protocolthe-p}{the} \hyperlink{classVarRW}{VarRW}.

The \hyperlink{classSemanticVarRW}{SemanticVarRW} will create dummy elements which are initialized to a default value. This may not be optimal for semantic checking. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSemanticVarRW_a02d9620d54dd0ad0100cb293059e1207}{
\index{SemanticVarRW@{SemanticVarRW}!SemanticVarRW@{SemanticVarRW}}
\index{SemanticVarRW@{SemanticVarRW}!SemanticVarRW@{SemanticVarRW}}
\subsubsection[{SemanticVarRW}]{\setlength{\rightskip}{0pt plus 5cm}SemanticVarRW::SemanticVarRW (
\begin{DoxyParamCaption}
\item[{{\bf VarMap} \&}]{vars}
\end{DoxyParamCaption}
)}}
\label{classSemanticVarRW_a02d9620d54dd0ad0100cb293059e1207}

\begin{DoxyParams}{Parameters}
{\em vars} & \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap} to use. \\
\hline
\end{DoxyParams}


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


\hyperlink{classVarRW}{VarRW} read interface. 

Checks if a variable may be read.

Throws exception on error.

\begin{DoxyReturn}{Returns}
dummy element initialized to a default value. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em id} & name of variable. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classVarRW_acb944450b84b487faeb1cbde243f76f4}{VarRW}.

\hypertarget{classSemanticVarRW_acca32a722337ee72d78df9c024ea5887}{
\index{SemanticVarRW@{SemanticVarRW}!set\_\-protocol@{set\_\-protocol}}
\index{set\_\-protocol@{set\_\-protocol}!SemanticVarRW@{SemanticVarRW}}
\subsubsection[{set\_\-protocol}]{\setlength{\rightskip}{0pt plus 5cm}void SemanticVarRW::set\_\-protocol (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto}
\end{DoxyParamCaption}
)}}
\label{classSemanticVarRW_acca32a722337ee72d78df9c024ea5887}


Change \hyperlink{protocolthe-p}{the} protocol being simulated. 


\begin{DoxyParams}{Parameters}
{\em proto} & protocol to simulate. \\
\hline
\end{DoxyParams}
\hypertarget{classSemanticVarRW_a404d1ce8d054fb545e468cd810f44508}{
\index{SemanticVarRW@{SemanticVarRW}!sync@{sync}}
\index{sync@{sync}!SemanticVarRW@{SemanticVarRW}}
\subsubsection[{sync}]{\setlength{\rightskip}{0pt plus 5cm}void SemanticVarRW::sync (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classSemanticVarRW_a404d1ce8d054fb545e468cd810f44508}


\hyperlink{classVarRW}{VarRW} sync interface. 

Does garbage collection. 

Reimplemented from \hyperlink{classVarRW_a6ae2005b7cb7ca447185c36329bb2a14}{VarRW}.

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


\hyperlink{classVarRW}{VarRW} write interface. 

Checks if a variable may be written to, and if \hyperlink{protocolthe-p}{the} type is correct.

Throws exception on error.


\begin{DoxyParams}{Parameters}
{\em id} & name of variable. \\
\hline
{\em elem} & value of 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/semantic\_\-varrw.hh\item 
/home/greearb/git/xorp.ct.github/xorp/policy/semantic\_\-varrw.cc\end{DoxyCompactItemize}
