\hypertarget{classVarMap}{
\section{VarMap Class Reference}
\label{classVarMap}\index{VarMap@{VarMap}}
}


A \hyperlink{classVarMap}{VarMap} contains all information for legal protocol variables.  




{\ttfamily \#include $<$var\_\-map.hh$>$}

Inheritance diagram for VarMap:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classVarMap}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structVarMap_1_1Variable}{Variable}
\begin{DoxyCompactList}\small\item\em A variable has Access control, it has a name, and a type. \item\end{DoxyCompactList}\item 
class \hyperlink{classVarMap_1_1VarMapErr}{VarMapErr}
\begin{DoxyCompactList}\small\item\em Exception thrown on \hyperlink{classVarMap}{VarMap} errors such as on unknown variables. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{classVarMap_a06d03578d72ed9601c422ec8e8869edb}{Access} \{ {\bfseries READ}, 
{\bfseries READ\_\-WRITE}, 
{\bfseries WRITE}
 \}
\begin{DoxyCompactList}\small\item\em A variable may be READ \mbox{[}readonly\mbox{]} or READ\_\-WRITE \mbox{[}read/write\mbox{]}. \item\end{DoxyCompactList}\item 
\hypertarget{classVarMap_a65f7ef852a8831b5ef16b8bae8d600b3}{
typedef map$<$ VarRW::Id, \hyperlink{structVarMap_1_1Variable}{Variable} $\ast$ $>$ {\bfseries VariableMap}}
\label{classVarMap_a65f7ef852a8831b5ef16b8bae8d600b3}

\item 
\hypertarget{classVarMap_a4e92dfd35882b632b4e30eb00a166a8d}{
typedef map$<$ string, VariableMap $\ast$ $>$ {\bfseries ProtoMap}}
\label{classVarMap_a4e92dfd35882b632b4e30eb00a166a8d}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
const \hyperlink{structVarMap_1_1Variable}{Variable} \& \hyperlink{classVarMap_a01f2f5793048b95face8cb1987f8d5ed}{variable} (const string \&protocol, const VarRW::Id \&varname) const 
\begin{DoxyCompactList}\small\item\em Return \hyperlink{structVarMap_1_1Variable}{Variable} information for a variable of a specific protocol. \item\end{DoxyCompactList}\item 
\hypertarget{classVarMap_a2c7aba02e4afc9d546885a1e702349b5}{
VarRW::Id {\bfseries var2id} (const string \&protocol, const string \&varname) const }
\label{classVarMap_a2c7aba02e4afc9d546885a1e702349b5}

\item 
\hyperlink{classVarMap_afe655f699d65fd438202c44de5a43db1}{VarMap} (\hyperlink{classProcessWatchBase}{ProcessWatchBase} \&pw)
\begin{DoxyCompactList}\small\item\em As \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap} learns about new protocols, it will register interest with \hyperlink{protocolthe-p}{the} process watcher for that protocol to monitor \hyperlink{protocolthe-p}{the} status of \hyperlink{protocolthe-p}{the} protocol process. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVarMap_a1bcb71c510c06ba9d7ea9c4a59e745f2}{protocol\_\-known} (const string \&protocol)
\item 
void \hyperlink{classVarMap_a10fb9ec3e3fca374498d33d92760ae4c}{add\_\-protocol\_\-variable} (const string \&protocol, \hyperlink{structVarMap_1_1Variable}{Variable} $\ast$var)
\begin{DoxyCompactList}\small\item\em Add a variable to a protocol. \item\end{DoxyCompactList}\item 
string \hyperlink{classVarMap_a0b02276d9a408a4d9cc913587f30f659}{str} ()
\begin{DoxyCompactList}\small\item\em String representation of varmap. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classVarMap_ad35786656de2b996899c630a9c767697}{
typedef VariableMap {\bfseries MetaVarContainer}}
\label{classVarMap_ad35786656de2b996899c630a9c767697}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{classVarMap_a81f145a95441b0a17f7f2f4964241d46}{add\_\-metavariable} (\hyperlink{structVarMap_1_1Variable}{Variable} $\ast$var)
\begin{DoxyCompactList}\small\item\em Use this if you want a variable to be present for all protocols. \item\end{DoxyCompactList}\item 
void \hyperlink{classVarMap_aa448036f2dc6e22ac4756630f905e6ed}{add\_\-variable} (VariableMap \&vm, \hyperlink{structVarMap_1_1Variable}{Variable} $\ast$var)
\begin{DoxyCompactList}\small\item\em Add a variable to a specific protocol. \item\end{DoxyCompactList}\item 
const VariableMap \& \hyperlink{classVarMap_a0e605968e635e0ccb1182a5b80b23257}{variablemap} (const string \&protocol) const 
\begin{DoxyCompactList}\small\item\em A VariableMap relates a variable name to its \hyperlink{structVarMap_1_1Variable}{Variable} information \mbox{[}access and type\mbox{]}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classVarMap_af4d489f63c55f094344d1531ca4cf1c5}{
ProtoMap {\bfseries \_\-protocols}}
\label{classVarMap_af4d489f63c55f094344d1531ca4cf1c5}

\item 
\hypertarget{classVarMap_a1e81bd01b3c5ade3cb583a0e312afb46}{
\hyperlink{classProcessWatchBase}{ProcessWatchBase} \& {\bfseries \_\-process\_\-watch}}
\label{classVarMap_a1e81bd01b3c5ade3cb583a0e312afb46}

\item 
\hypertarget{classVarMap_a45f7827935a55e212e987f3eddebe3f7}{
MetaVarContainer {\bfseries \_\-metavars}}
\label{classVarMap_a45f7827935a55e212e987f3eddebe3f7}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A \hyperlink{classVarMap}{VarMap} contains all information for legal protocol variables. It contains all \hyperlink{protocolthe-p}{the} possible protocols. All \hyperlink{protocolthe-p}{the} possible variables those protocols support and whether \hyperlink{protocolthe-p}{the} variables are read-\/only or read-\/write.

This is crutial for semantic checking. 

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


As \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap} learns about new protocols, it will register interest with \hyperlink{protocolthe-p}{the} process watcher for that protocol to monitor \hyperlink{protocolthe-p}{the} status of \hyperlink{protocolthe-p}{the} protocol process. 


\begin{DoxyParams}{Parameters}
{\em pw} & processWatch to use. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classVarMap_a81f145a95441b0a17f7f2f4964241d46}{
\index{VarMap@{VarMap}!add\_\-metavariable@{add\_\-metavariable}}
\index{add\_\-metavariable@{add\_\-metavariable}!VarMap@{VarMap}}
\subsubsection[{add\_\-metavariable}]{\setlength{\rightskip}{0pt plus 5cm}void VarMap::add\_\-metavariable (
\begin{DoxyParamCaption}
\item[{{\bf Variable} $\ast$}]{var}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVarMap_a81f145a95441b0a17f7f2f4964241d46}


Use this if you want a variable to be present for all protocols. 


\begin{DoxyParams}{Parameters}
{\em var} & \hyperlink{protocolthe-p}{the} variable to add. Watch out for clashes and don't delete. \\
\hline
\end{DoxyParams}
\hypertarget{classVarMap_a10fb9ec3e3fca374498d33d92760ae4c}{
\index{VarMap@{VarMap}!add\_\-protocol\_\-variable@{add\_\-protocol\_\-variable}}
\index{add\_\-protocol\_\-variable@{add\_\-protocol\_\-variable}!VarMap@{VarMap}}
\subsubsection[{add\_\-protocol\_\-variable}]{\setlength{\rightskip}{0pt plus 5cm}void VarMap::add\_\-protocol\_\-variable (
\begin{DoxyParamCaption}
\item[{const string \&}]{protocol, }
\item[{{\bf Variable} $\ast$}]{var}
\end{DoxyParamCaption}
)}}
\label{classVarMap_a10fb9ec3e3fca374498d33d92760ae4c}


Add a variable to a protocol. 


\begin{DoxyParams}{Parameters}
{\em protocol} & protocol for which variable should be added. \\
\hline
{\em var} & \hyperlink{protocolthe-p}{the} variable to add. Do not delete. \\
\hline
\end{DoxyParams}
\hypertarget{classVarMap_aa448036f2dc6e22ac4756630f905e6ed}{
\index{VarMap@{VarMap}!add\_\-variable@{add\_\-variable}}
\index{add\_\-variable@{add\_\-variable}!VarMap@{VarMap}}
\subsubsection[{add\_\-variable}]{\setlength{\rightskip}{0pt plus 5cm}void VarMap::add\_\-variable (
\begin{DoxyParamCaption}
\item[{VariableMap \&}]{vm, }
\item[{{\bf Variable} $\ast$}]{var}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVarMap_aa448036f2dc6e22ac4756630f905e6ed}


Add a variable to a specific protocol. 


\begin{DoxyParams}{Parameters}
{\em vm} & VariableMap where variable should be added. \\
\hline
{\em var} & \hyperlink{protocolthe-p}{the} variable to add. Do not delete. \\
\hline
\end{DoxyParams}
\hypertarget{classVarMap_a1bcb71c510c06ba9d7ea9c4a59e745f2}{
\index{VarMap@{VarMap}!protocol\_\-known@{protocol\_\-known}}
\index{protocol\_\-known@{protocol\_\-known}!VarMap@{VarMap}}
\subsubsection[{protocol\_\-known}]{\setlength{\rightskip}{0pt plus 5cm}bool VarMap::protocol\_\-known (
\begin{DoxyParamCaption}
\item[{const string \&}]{protocol}
\end{DoxyParamCaption}
)}}
\label{classVarMap_a1bcb71c510c06ba9d7ea9c4a59e745f2}
\begin{DoxyReturn}{Returns}
True if \hyperlink{protocolthe-p}{the} protocol is known to \hyperlink{protocolthe-p}{the} \hyperlink{classVarMap}{VarMap}, false otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em protocol} & protocol caller wish to knows existance of. \\
\hline
\end{DoxyParams}
\hypertarget{classVarMap_a0b02276d9a408a4d9cc913587f30f659}{
\index{VarMap@{VarMap}!str@{str}}
\index{str@{str}!VarMap@{VarMap}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}string VarMap::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classVarMap_a0b02276d9a408a4d9cc913587f30f659}


String representation of varmap. 

Use only for debugging.

\begin{DoxyReturn}{Returns}
string representation of varmap. 
\end{DoxyReturn}
\hypertarget{classVarMap_a01f2f5793048b95face8cb1987f8d5ed}{
\index{VarMap@{VarMap}!variable@{variable}}
\index{variable@{variable}!VarMap@{VarMap}}
\subsubsection[{variable}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf VarMap::Variable} \& VarMap::variable (
\begin{DoxyParamCaption}
\item[{const string \&}]{protocol, }
\item[{const VarRW::Id \&}]{varname}
\end{DoxyParamCaption}
) const}}
\label{classVarMap_a01f2f5793048b95face8cb1987f8d5ed}


Return \hyperlink{structVarMap_1_1Variable}{Variable} information for a variable of a specific protocol. 

Throws an exception if no information is found.

Caller must not delete \hyperlink{protocolthe-p}{the} map.

\begin{DoxyReturn}{Returns}
access and type information for \hyperlink{protocolthe-p}{the} requested variable. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em protocol} & protocol of variable interested in. \\
\hline
{\em varname} & name of variable interested in. \\
\hline
\end{DoxyParams}
\hypertarget{classVarMap_a0e605968e635e0ccb1182a5b80b23257}{
\index{VarMap@{VarMap}!variablemap@{variablemap}}
\index{variablemap@{variablemap}!VarMap@{VarMap}}
\subsubsection[{variablemap}]{\setlength{\rightskip}{0pt plus 5cm}const VarMap::VariableMap \& VarMap::variablemap (
\begin{DoxyParamCaption}
\item[{const string \&}]{protocol}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classVarMap_a0e605968e635e0ccb1182a5b80b23257}


A VariableMap relates a variable name to its \hyperlink{structVarMap_1_1Variable}{Variable} information \mbox{[}access and type\mbox{]}. 

Throws an exception if no map is found.

\begin{DoxyReturn}{Returns}
variable map for requested protocol. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em protocol} & protocol name for which variable map is requested. \\
\hline
\end{DoxyParams}


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