\hypertarget{classIvExec}{
\section{IvExec Class Reference}
\label{classIvExec}\index{IvExec@{IvExec}}
}


\hyperlink{classVisitor}{Visitor} that executes instructions.  




{\ttfamily \#include $<$iv\_\-exec.hh$>$}

Inheritance diagram for IvExec:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classIvExec}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classIvExec_1_1RuntimeError}{RuntimeError}
\begin{DoxyCompactList}\small\item\em Run time errors, such as doing unsupported operations. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} \{ {\bfseries ACCEPT}, 
{\bfseries REJ}, 
{\bfseries DEFAULT}
 \}
\begin{DoxyCompactList}\small\item\em A FlowAction is what has to be done with \hyperlink{protocolthe-p}{the} route. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIvExec_ac59d198acfec64b14f12c03d6602b4da}{
void {\bfseries set\_\-policies} (vector$<$ \hyperlink{classPolicyInstr}{PolicyInstr} $\ast$ $>$ $\ast$policies)}
\label{classIvExec_ac59d198acfec64b14f12c03d6602b4da}

\item 
\hypertarget{classIvExec_a69162125c303f175fc9f4e5115dc34d6}{
void {\bfseries set\_\-set\_\-manager} (\hyperlink{classSetManager}{SetManager} $\ast$sman)}
\label{classIvExec_a69162125c303f175fc9f4e5115dc34d6}

\item 
\hypertarget{classIvExec_a3614f4eda63b7a721e5cb1c56627a2b5}{
\hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} \hyperlink{classIvExec_a3614f4eda63b7a721e5cb1c56627a2b5}{run} (\hyperlink{classVarRW}{VarRW} $\ast$varrw)}
\label{classIvExec_a3614f4eda63b7a721e5cb1c56627a2b5}

\begin{DoxyCompactList}\small\item\em Execute \hyperlink{protocolthe-p}{the} policies. \item\end{DoxyCompactList}\item 
\hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} \hyperlink{classIvExec_a5c7211404dcfaa0f473cd4fe6f9c51c7}{runPolicy} (\hyperlink{classPolicyInstr}{PolicyInstr} \&pi)
\begin{DoxyCompactList}\small\item\em Execute a policy. \item\end{DoxyCompactList}\item 
\hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} \hyperlink{classIvExec_adb259d9a6dd83048ccec5dde941314d4}{runTerm} (\hyperlink{classTermInstr}{TermInstr} \&ti)
\begin{DoxyCompactList}\small\item\em Execute a term. \item\end{DoxyCompactList}\item 
void \hyperlink{classIvExec_a8bfe16e2f9634236b8a0a9e97efc1845}{visit} (\hyperlink{classPush}{Push} \&p)
\item 
void \hyperlink{classIvExec_a182b8bee332c844e89506f580882a197}{visit} (\hyperlink{classPushSet}{PushSet} \&ps)
\item 
void \hyperlink{classIvExec_a1d6ba5b1977333b37cc24e8d475661f8}{visit} (\hyperlink{classOnFalseExit}{OnFalseExit} \&x)
\item 
void \hyperlink{classIvExec_ad2e989056d7f747f0455f8a75cd17d84}{visit} (\hyperlink{classLoad}{Load} \&l)
\item 
void \hyperlink{classIvExec_a8fb1fdd31f5a1be2693d12a8d79ad124}{visit} (\hyperlink{classStore}{Store} \&s)
\item 
void \hyperlink{classIvExec_aaeecbc65cdab36523405967ba61ad87d}{visit} (\hyperlink{classAccept}{Accept} \&a)
\item 
void \hyperlink{classIvExec_a22035a26972c8474f3e08bb742bae861}{visit} (\hyperlink{classReject}{Reject} \&r)
\item 
void \hyperlink{classIvExec_a92e89b989eff4571f4f66aa65ba477ce}{visit} (\hyperlink{classNaryInstr}{NaryInstr} \&nary)
\item 
\hypertarget{classIvExec_a4ac9dad0944fa5edc2a532d70638a573}{
void {\bfseries visit} (\hyperlink{classNext}{Next} \&next)}
\label{classIvExec_a4ac9dad0944fa5edc2a532d70638a573}

\item 
\hypertarget{classIvExec_a41a68f1a307277a6c1a8fa41e163dfa4}{
void {\bfseries visit} (\hyperlink{classSubr}{Subr} \&sub)}
\label{classIvExec_a41a68f1a307277a6c1a8fa41e163dfa4}

\item 
\hypertarget{classIvExec_a5f89a6c9acda9478aa2c791c745bc9a6}{
void {\bfseries set\_\-profiler} (\hyperlink{classPolicyProfiler}{PolicyProfiler} $\ast$)}
\label{classIvExec_a5f89a6c9acda9478aa2c791c745bc9a6}

\item 
\hypertarget{classIvExec_ae40c606c7131fcb7fead5edc058c8a38}{
string {\bfseries tracelog} ()}
\label{classIvExec_ae40c606c7131fcb7fead5edc058c8a38}

\item 
\hypertarget{classIvExec_aedbe458fe46fc15802b66a37f28cfa14}{
void {\bfseries set\_\-subr} (SUBR $\ast$subr)}
\label{classIvExec_aedbe458fe46fc15802b66a37f28cfa14}

\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static string \hyperlink{classIvExec_afd248353a872aabd82d50edaaf256c30}{fa2str} (const \hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} \&fa)
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIvExec_a113f98b9b9a6b55dde77e33153efb885}{
void \hyperlink{classIvExec_a113f98b9b9a6b55dde77e33153efb885}{clear\_\-trash} ()}
\label{classIvExec_a113f98b9b9a6b55dde77e33153efb885}

\begin{DoxyCompactList}\small\item\em Do garbage collection. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classIvExec_ae922e1fb473d030a18f829e32e03a3be}{
\hyperlink{classPolicyInstr}{PolicyInstr} $\ast$$\ast$ {\bfseries \_\-policies}}
\label{classIvExec_ae922e1fb473d030a18f829e32e03a3be}

\item 
\hypertarget{classIvExec_a1b7c8f4e5c4bc65695a31df4263b636e}{
unsigned {\bfseries \_\-policy\_\-count}}
\label{classIvExec_a1b7c8f4e5c4bc65695a31df4263b636e}

\item 
\hypertarget{classIvExec_ac3e565df580a2a2fd8781d5b97d59232}{
const \hyperlink{classElement}{Element} $\ast$$\ast$ {\bfseries \_\-stack\_\-bottom}}
\label{classIvExec_ac3e565df580a2a2fd8781d5b97d59232}

\item 
\hypertarget{classIvExec_a09e747825e26a0d20736597a5df9f235}{
const \hyperlink{classElement}{Element} $\ast$$\ast$ {\bfseries \_\-stack}}
\label{classIvExec_a09e747825e26a0d20736597a5df9f235}

\item 
\hypertarget{classIvExec_a0b4ba6e3d95d1dd2b8e4af9cbaa5f64a}{
const \hyperlink{classElement}{Element} $\ast$$\ast$ {\bfseries \_\-stackend}}
\label{classIvExec_a0b4ba6e3d95d1dd2b8e4af9cbaa5f64a}

\item 
\hypertarget{classIvExec_ad4530d9d2ce7099b4986f9958f9cca23}{
const \hyperlink{classElement}{Element} $\ast$$\ast$ {\bfseries \_\-stackptr}}
\label{classIvExec_ad4530d9d2ce7099b4986f9958f9cca23}

\item 
\hypertarget{classIvExec_a7a0d9176f7c92a5a6b49084155828066}{
\hyperlink{classSetManager}{SetManager} $\ast$ {\bfseries \_\-sman}}
\label{classIvExec_a7a0d9176f7c92a5a6b49084155828066}

\item 
\hypertarget{classIvExec_a0944e6ed07d31166fa307515cab7a983}{
\hyperlink{classVarRW}{VarRW} $\ast$ {\bfseries \_\-varrw}}
\label{classIvExec_a0944e6ed07d31166fa307515cab7a983}

\item 
\hypertarget{classIvExec_aaa593eba739c3c6a166db3f397a26ad9}{
bool {\bfseries \_\-finished}}
\label{classIvExec_aaa593eba739c3c6a166db3f397a26ad9}

\item 
\hypertarget{classIvExec_a19da6fc076ec501325e9cadef7bd5522}{
\hyperlink{classDispatcher}{Dispatcher} {\bfseries \_\-disp}}
\label{classIvExec_a19da6fc076ec501325e9cadef7bd5522}

\item 
\hypertarget{classIvExec_a04bfaea4f61ab39fed7f12533d8c2a31}{
\hyperlink{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{FlowAction} {\bfseries \_\-fa}}
\label{classIvExec_a04bfaea4f61ab39fed7f12533d8c2a31}

\item 
\hypertarget{classIvExec_a3837020c503256e3c41731226fed7d24}{
\hyperlink{classElement}{Element} $\ast$$\ast$ {\bfseries \_\-trash}}
\label{classIvExec_a3837020c503256e3c41731226fed7d24}

\item 
\hypertarget{classIvExec_a764a3c9a36cd88208935d8f9a47d92af}{
unsigned {\bfseries \_\-trashc}}
\label{classIvExec_a764a3c9a36cd88208935d8f9a47d92af}

\item 
\hypertarget{classIvExec_aaa35c4d18af808cd94ff87e93cea1743}{
unsigned {\bfseries \_\-trashs}}
\label{classIvExec_aaa35c4d18af808cd94ff87e93cea1743}

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

\item 
\hypertarget{classIvExec_a6264286814e4e2d9d8e7ee377ce7c0e6}{
\hyperlink{classPolicyProfiler}{PolicyProfiler} $\ast$ {\bfseries \_\-profiler}}
\label{classIvExec_a6264286814e4e2d9d8e7ee377ce7c0e6}

\item 
\hypertarget{classIvExec_a6dc0add39f1ca225cffcf81418edde1a}{
bool {\bfseries \_\-do\_\-trace}}
\label{classIvExec_a6dc0add39f1ca225cffcf81418edde1a}

\item 
\hypertarget{classIvExec_a5e854b2014c8b532a18e281ba9341b9a}{
bool {\bfseries \_\-did\_\-trace}}
\label{classIvExec_a5e854b2014c8b532a18e281ba9341b9a}

\item 
\hypertarget{classIvExec_abc2803c636b1b60b9b4e118ec8e00c83}{
Next::Flow {\bfseries \_\-ctr\_\-flow}}
\label{classIvExec_abc2803c636b1b60b9b4e118ec8e00c83}

\item 
\hypertarget{classIvExec_a0ade18daa61c05938b70d11b0f2c80e2}{
SUBR $\ast$ {\bfseries \_\-subr}}
\label{classIvExec_a0ade18daa61c05938b70d11b0f2c80e2}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classVisitor}{Visitor} that executes instructions. The execution process may be optimized by not using visitors. Having instructions implement a method that returns a flow action directly. 

\subsection{Member Enumeration Documentation}
\hypertarget{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}{
\index{IvExec@{IvExec}!FlowAction@{FlowAction}}
\index{FlowAction@{FlowAction}!IvExec@{IvExec}}
\subsubsection[{FlowAction}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf IvExec::FlowAction}}}
\label{classIvExec_a874d01dfdf7b357810a6013c1e9a1d6c}


A FlowAction is what has to be done with \hyperlink{protocolthe-p}{the} route. 

DEFAULT is \hyperlink{protocolthe-p}{the} default action which is normally \char`\"{}go to the next term\char`\"{}, or if \hyperlink{protocolthe-p}{the} last term, ACCEPT. 

\subsection{Member Function Documentation}
\hypertarget{classIvExec_afd248353a872aabd82d50edaaf256c30}{
\index{IvExec@{IvExec}!fa2str@{fa2str}}
\index{fa2str@{fa2str}!IvExec@{IvExec}}
\subsubsection[{fa2str}]{\setlength{\rightskip}{0pt plus 5cm}string IvExec::fa2str (
\begin{DoxyParamCaption}
\item[{const {\bf FlowAction} \&}]{fa}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classIvExec_afd248353a872aabd82d50edaaf256c30}
\begin{DoxyReturn}{Returns}
String representation of flow action. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em fa} & Flow action to convert. \\
\hline
\end{DoxyParams}
\hypertarget{classIvExec_a5c7211404dcfaa0f473cd4fe6f9c51c7}{
\index{IvExec@{IvExec}!runPolicy@{runPolicy}}
\index{runPolicy@{runPolicy}!IvExec@{IvExec}}
\subsubsection[{runPolicy}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IvExec::FlowAction} IvExec::runPolicy (
\begin{DoxyParamCaption}
\item[{{\bf PolicyInstr} \&}]{pi}
\end{DoxyParamCaption}
)}}
\label{classIvExec_a5c7211404dcfaa0f473cd4fe6f9c51c7}


Execute a policy. 


\begin{DoxyParams}{Parameters}
{\em pi} & policy to execute \\
\hline
\end{DoxyParams}
\hypertarget{classIvExec_adb259d9a6dd83048ccec5dde941314d4}{
\index{IvExec@{IvExec}!runTerm@{runTerm}}
\index{runTerm@{runTerm}!IvExec@{IvExec}}
\subsubsection[{runTerm}]{\setlength{\rightskip}{0pt plus 5cm}{\bf IvExec::FlowAction} IvExec::runTerm (
\begin{DoxyParamCaption}
\item[{{\bf TermInstr} \&}]{ti}
\end{DoxyParamCaption}
)}}
\label{classIvExec_adb259d9a6dd83048ccec5dde941314d4}


Execute a term. 


\begin{DoxyParams}{Parameters}
{\em ti} & term to execute. \\
\hline
\end{DoxyParams}
\hypertarget{classIvExec_aaeecbc65cdab36523405967ba61ad87d}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf Accept} \&}]{a}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_aaeecbc65cdab36523405967ba61ad87d}

\begin{DoxyParams}{Parameters}
{\em a} & accept \hyperlink{protocolthe-p}{the} route. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a8fb1fdd31f5a1be2693d12a8d79ad124}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf Store} \&}]{s}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a8fb1fdd31f5a1be2693d12a8d79ad124}

\begin{DoxyParams}{Parameters}
{\em s} & \hyperlink{classStore}{Store} to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a182b8bee332c844e89506f580882a197}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf PushSet} \&}]{ps}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a182b8bee332c844e89506f580882a197}

\begin{DoxyParams}{Parameters}
{\em ps} & push of a set to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a8bfe16e2f9634236b8a0a9e97efc1845}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf Push} \&}]{p}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a8bfe16e2f9634236b8a0a9e97efc1845}

\begin{DoxyParams}{Parameters}
{\em p} & push to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_ad2e989056d7f747f0455f8a75cd17d84}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf Load} \&}]{l}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_ad2e989056d7f747f0455f8a75cd17d84}

\begin{DoxyParams}{Parameters}
{\em l} & \hyperlink{classLoad}{Load} to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a92e89b989eff4571f4f66aa65ba477ce}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf NaryInstr} \&}]{nary}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a92e89b989eff4571f4f66aa65ba477ce}

\begin{DoxyParams}{Parameters}
{\em nary} & N-\/ary instruction to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a1d6ba5b1977333b37cc24e8d475661f8}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf OnFalseExit} \&}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a1d6ba5b1977333b37cc24e8d475661f8}

\begin{DoxyParams}{Parameters}
{\em x} & \hyperlink{classOnFalseExit}{OnFalseExit} to execute. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.

\hypertarget{classIvExec_a22035a26972c8474f3e08bb742bae861}{
\index{IvExec@{IvExec}!visit@{visit}}
\index{visit@{visit}!IvExec@{IvExec}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void IvExec::visit (
\begin{DoxyParamCaption}
\item[{{\bf Reject} \&}]{r}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classIvExec_a22035a26972c8474f3e08bb742bae861}

\begin{DoxyParams}{Parameters}
{\em r} & reject \hyperlink{protocolthe-p}{the} route. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classInstrVisitor}{InstrVisitor}.



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