\hypertarget{classCodeGenerator}{
\section{CodeGenerator Class Reference}
\label{classCodeGenerator}\index{CodeGenerator@{CodeGenerator}}
}


Generic code generator.  




{\ttfamily \#include $<$code\_\-generator.hh$>$}

Inheritance diagram for CodeGenerator:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classCodeGenerator}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classCodeGenerator_1_1CodeGeneratorErr}{CodeGeneratorErr}
\begin{DoxyCompactList}\small\item\em Exception thrown if code generation fails. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCodeGenerator_a1c2270b678416ff896ee8db1b880b77d}{
{\bfseries CodeGenerator} (const \hyperlink{classVarMap}{VarMap} \&varmap, \hyperlink{classPolicyMap}{PolicyMap} \&pmap)}
\label{classCodeGenerator_a1c2270b678416ff896ee8db1b880b77d}

\item 
\hyperlink{classCodeGenerator_a943aee34c77c703cdc594ea7bec876a0}{CodeGenerator} (const string \&proto, const filter::Filter \&filter, const \hyperlink{classVarMap}{VarMap} \&varmap, \hyperlink{classPolicyMap}{PolicyMap} \&pmap)
\begin{DoxyCompactList}\small\item\em Generate code for a specific protocol and filter \mbox{[}target\mbox{]}. \item\end{DoxyCompactList}\item 
\hyperlink{classCodeGenerator_a1133c5160b9a03746126f64e4ade2305}{CodeGenerator} (const string \&proto, const \hyperlink{classVarMap}{VarMap} \&varmap, \hyperlink{classPolicyMap}{PolicyMap} \&pmap)
\begin{DoxyCompactList}\small\item\em Initialize code generation for an import of a specific protocol. \item\end{DoxyCompactList}\item 
\hypertarget{classCodeGenerator_ab13bf40f7d60bc118d1914a43cd39b1a}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeUn}{NodeUn} \&node)}
\label{classCodeGenerator_ab13bf40f7d60bc118d1914a43cd39b1a}

\item 
\hypertarget{classCodeGenerator_a92732d4fd5b02cfa0e83e9afa8ea8f2e}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeBin}{NodeBin} \&node)}
\label{classCodeGenerator_a92732d4fd5b02cfa0e83e9afa8ea8f2e}

\item 
\hypertarget{classCodeGenerator_aeec53eeefa4b76915b717ff1432de46c}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeAssign}{NodeAssign} \&node)}
\label{classCodeGenerator_aeec53eeefa4b76915b717ff1432de46c}

\item 
\hypertarget{classCodeGenerator_a0e35da722ec2d093b26d3b731c94fa73}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeElem}{NodeElem} \&node)}
\label{classCodeGenerator_a0e35da722ec2d093b26d3b731c94fa73}

\item 
\hypertarget{classCodeGenerator_a90c64948071988f33f17561d53590664}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeAny}{NodeVar} \&node)}
\label{classCodeGenerator_a90c64948071988f33f17561d53590664}

\item 
\hypertarget{classCodeGenerator_a979ac55de2f89c7b6701ab5deb156f6c}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeSet}{NodeSet} \&node)}
\label{classCodeGenerator_a979ac55de2f89c7b6701ab5deb156f6c}

\item 
\hypertarget{classCodeGenerator_a1b7b5218426f18c19dec98bf47fe04ab}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeAccept}{NodeAccept} \&node)}
\label{classCodeGenerator_a1b7b5218426f18c19dec98bf47fe04ab}

\item 
\hypertarget{classCodeGenerator_ad553630c84dc6852c964a239a68240a4}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeReject}{NodeReject} \&node)}
\label{classCodeGenerator_ad553630c84dc6852c964a239a68240a4}

\item 
\hypertarget{classCodeGenerator_a122f993feaba824d3f27738e8935358b}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classPolicyStatement}{PolicyStatement} \&policy)}
\label{classCodeGenerator_a122f993feaba824d3f27738e8935358b}

\item 
\hypertarget{classCodeGenerator_a7aef30e9f1ce47a1b5577b8e9d145c50}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classTerm}{Term} \&policy)}
\label{classCodeGenerator_a7aef30e9f1ce47a1b5577b8e9d145c50}

\item 
\hypertarget{classCodeGenerator_ad658437a882cc7db2702da7e18974b5b}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeProto}{NodeProto} \&policy)}
\label{classCodeGenerator_ad658437a882cc7db2702da7e18974b5b}

\item 
\hypertarget{classCodeGenerator_af6761ebdb4496c20c3a8fe5bac71ec15}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeNext}{NodeNext} \&node)}
\label{classCodeGenerator_af6761ebdb4496c20c3a8fe5bac71ec15}

\item 
\hypertarget{classCodeGenerator_a089f5c2fd4698c35a2ba4ab07ffb84bb}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit} (\hyperlink{classNodeSubr}{NodeSubr} \&node)}
\label{classCodeGenerator_a089f5c2fd4698c35a2ba4ab07ffb84bb}

\item 
const \hyperlink{classCode}{Code} \& \hyperlink{classCodeGenerator_a458ebcaaf1786a46190ac9e7be699186}{code} ()
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCodeGenerator_aa8fd59f8848d679dcd8cbbd28f4f9b80}{
virtual const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit\_\-policy} (\hyperlink{classPolicyStatement}{PolicyStatement} \&policy)}
\label{classCodeGenerator_aa8fd59f8848d679dcd8cbbd28f4f9b80}

\item 
\hypertarget{classCodeGenerator_a39f8efd5aa6c58f62f1bc3d8a249cc49}{
virtual const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit\_\-term} (\hyperlink{classTerm}{Term} \&term)}
\label{classCodeGenerator_a39f8efd5aa6c58f62f1bc3d8a249cc49}

\item 
\hypertarget{classCodeGenerator_adb82214d2ddc2d603a169afacabcc203}{
virtual const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit\_\-proto} (\hyperlink{classNodeProto}{NodeProto} \&node)}
\label{classCodeGenerator_adb82214d2ddc2d603a169afacabcc203}

\item 
\hypertarget{classCodeGenerator_a2dfa84a3aaefc77d24bd512e91811734}{
virtual const string \& {\bfseries protocol} ()}
\label{classCodeGenerator_a2dfa84a3aaefc77d24bd512e91811734}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCodeGenerator_adbb27f52f550cb279d9e3bbe05c6f722}{
\hyperlink{classCode}{Code} {\bfseries \_\-code}}
\label{classCodeGenerator_adbb27f52f550cb279d9e3bbe05c6f722}

\item 
\hypertarget{classCodeGenerator_a2c9137d49731bb5b75cb075f9d62e4a0}{
ostringstream {\bfseries \_\-os}}
\label{classCodeGenerator_a2c9137d49731bb5b75cb075f9d62e4a0}

\item 
\hypertarget{classCodeGenerator_a3e3271d204f8732d06a705164d9f1f1a}{
const \hyperlink{classVarMap}{VarMap} \& {\bfseries \_\-varmap}}
\label{classCodeGenerator_a3e3271d204f8732d06a705164d9f1f1a}

\item 
\hypertarget{classCodeGenerator_af48e2a0dffe40dcf8750105484c723c7}{
\hyperlink{classPolicyMap}{PolicyMap} \& {\bfseries \_\-pmap}}
\label{classCodeGenerator_af48e2a0dffe40dcf8750105484c723c7}

\item 
\hypertarget{classCodeGenerator_adfa51128e2871a5b8c2ab917c611fa69}{
bool {\bfseries \_\-subr}}
\label{classCodeGenerator_adfa51128e2871a5b8c2ab917c611fa69}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classCodeGenerator_af1d349297e2b5a7964f4675c2a875e94}{
string {\bfseries \_\-protocol}}
\label{classCodeGenerator_af1d349297e2b5a7964f4675c2a875e94}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Generic code generator. It is suitable for import filters.

This class visits a structure of \hyperlink{classNodes}{Nodes} and generates appropriate code. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classCodeGenerator_a943aee34c77c703cdc594ea7bec876a0}{
\index{CodeGenerator@{CodeGenerator}!CodeGenerator@{CodeGenerator}}
\index{CodeGenerator@{CodeGenerator}!CodeGenerator@{CodeGenerator}}
\subsubsection[{CodeGenerator}]{\setlength{\rightskip}{0pt plus 5cm}CodeGenerator::CodeGenerator (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto, }
\item[{const filter::Filter \&}]{filter, }
\item[{const {\bf VarMap} \&}]{varmap, }
\item[{{\bf PolicyMap} \&}]{pmap}
\end{DoxyParamCaption}
)}}
\label{classCodeGenerator_a943aee34c77c703cdc594ea7bec876a0}


Generate code for a specific protocol and filter \mbox{[}target\mbox{]}. 

This construct is mainly used by derived classes to set \hyperlink{protocolthe-p}{the} code target.


\begin{DoxyParams}{Parameters}
{\em proto} & target protocol. \\
\hline
{\em filter} & target filter type. \\
\hline
{\em varmap} & varmap. \\
\hline
\end{DoxyParams}
\hypertarget{classCodeGenerator_a1133c5160b9a03746126f64e4ade2305}{
\index{CodeGenerator@{CodeGenerator}!CodeGenerator@{CodeGenerator}}
\index{CodeGenerator@{CodeGenerator}!CodeGenerator@{CodeGenerator}}
\subsubsection[{CodeGenerator}]{\setlength{\rightskip}{0pt plus 5cm}CodeGenerator::CodeGenerator (
\begin{DoxyParamCaption}
\item[{const string \&}]{proto, }
\item[{const {\bf VarMap} \&}]{varmap, }
\item[{{\bf PolicyMap} \&}]{pmap}
\end{DoxyParamCaption}
)}}
\label{classCodeGenerator_a1133c5160b9a03746126f64e4ade2305}


Initialize code generation for an import of a specific protocol. 


\begin{DoxyParams}{Parameters}
{\em proto} & target protocol. \\
\hline
{\em varmap} & varmap. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classCodeGenerator_a458ebcaaf1786a46190ac9e7be699186}{
\index{CodeGenerator@{CodeGenerator}!code@{code}}
\index{code@{code}!CodeGenerator@{CodeGenerator}}
\subsubsection[{code}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Code} \& CodeGenerator::code (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classCodeGenerator_a458ebcaaf1786a46190ac9e7be699186}
\begin{DoxyReturn}{Returns}
code generated. 
\end{DoxyReturn}


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