\hypertarget{classSourceMatchCodeGenerator}{
\section{SourceMatchCodeGenerator Class Reference}
\label{classSourceMatchCodeGenerator}\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
}


\hyperlink{classCode}{Code} generator for source match filters.  




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

Inheritance diagram for SourceMatchCodeGenerator:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classSourceMatchCodeGenerator}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classSourceMatchCodeGenerator_1_1NoProtoSpec}{NoProtoSpec}
\begin{DoxyCompactList}\small\item\em Exception thrown if no protocol was specified in source block. \item\end{DoxyCompactList}\item 
class \hyperlink{classSourceMatchCodeGenerator_1_1ProtoRedefined}{ProtoRedefined}
\begin{DoxyCompactList}\small\item\em Exception thrown if protocol was re-\/defined in source block. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSourceMatchCodeGenerator_a1966b2431e3f3033651a634a2eea6b1c}{
typedef pair$<$ bool, uint32\_\-t $>$ {\bfseries Taginfo}}
\label{classSourceMatchCodeGenerator_a1966b2431e3f3033651a634a2eea6b1c}

\item 
\hypertarget{classSourceMatchCodeGenerator_a128b41510814dc0c18603bc2d45da96e}{
typedef vector$<$ Taginfo $>$ {\bfseries Tags}}
\label{classSourceMatchCodeGenerator_a128b41510814dc0c18603bc2d45da96e}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classSourceMatchCodeGenerator_a224b08d929aac926ea49f32a89e3c1f3}{SourceMatchCodeGenerator} (uint32\_\-t tagstart, const \hyperlink{classVarMap}{VarMap} \&varmap, \hyperlink{classPolicyMap}{PolicyMap} \&pmap, map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&ptags)
\item 
\hypertarget{classSourceMatchCodeGenerator_a4de7cf93af6f9acf6aad24b251ba6bf7}{
const \hyperlink{classElement}{Element} $\ast$ {\bfseries visit\_\-policy} (\hyperlink{classPolicyStatement}{PolicyStatement} \&policy)}
\label{classSourceMatchCodeGenerator_a4de7cf93af6f9acf6aad24b251ba6bf7}

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

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

\item 
vector$<$ \hyperlink{classCode}{Code} $\ast$ $>$ \& \hyperlink{classSourceMatchCodeGenerator_ad2eef42ef2502b209b632d2aa3b61572}{codes} ()
\begin{DoxyCompactList}\small\item\em The targets of source match code may be multiple as different protocols may refer to different source terms. \item\end{DoxyCompactList}\item 
const Tags \& \hyperlink{classSourceMatchCodeGenerator_ae33e9728468e59181cc666858f469223}{tags} () const 
\begin{DoxyCompactList}\small\item\em The source match code generator will map source blocks to tags. \item\end{DoxyCompactList}\item 
uint32\_\-t \hyperlink{classSourceMatchCodeGenerator_ac3c2297b766e326d9b817ee1cc12ba54}{next\_\-tag} () const 
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSourceMatchCodeGenerator_a753bec4d20aae81368b0a7575571b66a}{
const string \& {\bfseries protocol} ()}
\label{classSourceMatchCodeGenerator_a753bec4d20aae81368b0a7575571b66a}

\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSourceMatchCodeGenerator_a9c32350b2571b8e5ba2410259fa79806}{
typedef map$<$ string, \hyperlink{classCode}{Code} $\ast$ $>$ {\bfseries CodeMap}}
\label{classSourceMatchCodeGenerator_a9c32350b2571b8e5ba2410259fa79806}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSourceMatchCodeGenerator_a9960ec221ad80e7ddaff02560013957e}{
void {\bfseries do\_\-term} (\hyperlink{classTerm}{Term} \&term)}
\label{classSourceMatchCodeGenerator_a9960ec221ad80e7ddaff02560013957e}

\item 
\hypertarget{classSourceMatchCodeGenerator_abc436bb95c4c28c8c86900375747affc}{
void \hyperlink{classSourceMatchCodeGenerator_abc436bb95c4c28c8c86900375747affc}{addTerm} ()}
\label{classSourceMatchCodeGenerator_abc436bb95c4c28c8c86900375747affc}

\begin{DoxyCompactList}\small\item\em Adds \hyperlink{protocolthe-p}{the} \hyperlink{protocolthe-p}{the} code of \hyperlink{protocolthe-p}{the} current term being analyzed. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classSourceMatchCodeGenerator_a7807ba394bdd1bb2d3b3ff0b0625a3c5}{
uint32\_\-t {\bfseries \_\-currtag}}
\label{classSourceMatchCodeGenerator_a7807ba394bdd1bb2d3b3ff0b0625a3c5}

\item 
\hypertarget{classSourceMatchCodeGenerator_a0ba916141fe8701e7fcc1025fcaa783f}{
string {\bfseries \_\-protocol}}
\label{classSourceMatchCodeGenerator_a0ba916141fe8701e7fcc1025fcaa783f}

\item 
\hypertarget{classSourceMatchCodeGenerator_acfd85c7a0ac1dc0ad90c64b74b89fda8}{
CodeMap {\bfseries \_\-codes}}
\label{classSourceMatchCodeGenerator_acfd85c7a0ac1dc0ad90c64b74b89fda8}

\item 
\hypertarget{classSourceMatchCodeGenerator_ab5f728f884579bf62cd973b89792a2c1}{
vector$<$ \hyperlink{classCode}{Code} $\ast$ $>$ {\bfseries \_\-codes\_\-vect}}
\label{classSourceMatchCodeGenerator_ab5f728f884579bf62cd973b89792a2c1}

\item 
\hypertarget{classSourceMatchCodeGenerator_ae3a74c1e436ed06b64415b774aae9223}{
Tags {\bfseries \_\-tags}}
\label{classSourceMatchCodeGenerator_ae3a74c1e436ed06b64415b774aae9223}

\item 
\hypertarget{classSourceMatchCodeGenerator_afa261bd5c332a99273ca162278006608}{
map$<$ string, set$<$ uint32\_\-t $>$ $>$ \& {\bfseries \_\-protocol\_\-tags}}
\label{classSourceMatchCodeGenerator_afa261bd5c332a99273ca162278006608}

\item 
\hypertarget{classSourceMatchCodeGenerator_a40f03c9989ac162c98b02d10484dbefe}{
bool {\bfseries \_\-protocol\_\-statement}}
\label{classSourceMatchCodeGenerator_a40f03c9989ac162c98b02d10484dbefe}

\item 
\hypertarget{classSourceMatchCodeGenerator_ada46226c635838ef9b7fa3be735c76ae}{
string {\bfseries \_\-policy}}
\label{classSourceMatchCodeGenerator_ada46226c635838ef9b7fa3be735c76ae}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{classCode}{Code} generator for source match filters. This is a specialized version of \hyperlink{protocolthe-p}{the} import filter \hyperlink{classCodeGenerator}{CodeGenerator}.

It skips dest and action blocks in policies. The action block is replaced with \hyperlink{protocolthe-p}{the} actual policy tagging. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSourceMatchCodeGenerator_a224b08d929aac926ea49f32a89e3c1f3}{
\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}!SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}!SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
\subsubsection[{SourceMatchCodeGenerator}]{\setlength{\rightskip}{0pt plus 5cm}SourceMatchCodeGenerator::SourceMatchCodeGenerator (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{tagstart, }
\item[{const {\bf VarMap} \&}]{varmap, }
\item[{{\bf PolicyMap} \&}]{pmap, }
\item[{map$<$ string, set$<$ uint32\_\-t $>$ $>$ \&}]{ptags}
\end{DoxyParamCaption}
)}}
\label{classSourceMatchCodeGenerator_a224b08d929aac926ea49f32a89e3c1f3}

\begin{DoxyParams}{Parameters}
{\em tagstart} & \hyperlink{protocolthe-p}{the} first policy tag available. \\
\hline
{\em varmap} & \hyperlink{protocolthe-p}{the} varmap. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classSourceMatchCodeGenerator_ad2eef42ef2502b209b632d2aa3b61572}{
\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}!codes@{codes}}
\index{codes@{codes}!SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
\subsubsection[{codes}]{\setlength{\rightskip}{0pt plus 5cm}vector$<$ {\bf Code} $\ast$ $>$ \& SourceMatchCodeGenerator::codes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classSourceMatchCodeGenerator_ad2eef42ef2502b209b632d2aa3b61572}


The targets of source match code may be multiple as different protocols may refer to different source terms. 

Thus many different code fragments may be generated.

\begin{DoxyReturn}{Returns}
seturn all \hyperlink{protocolthe-p}{the} code fragments generated. 
\end{DoxyReturn}
\hypertarget{classSourceMatchCodeGenerator_ac3c2297b766e326d9b817ee1cc12ba54}{
\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}!next\_\-tag@{next\_\-tag}}
\index{next\_\-tag@{next\_\-tag}!SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
\subsubsection[{next\_\-tag}]{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t SourceMatchCodeGenerator::next\_\-tag (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classSourceMatchCodeGenerator_ac3c2297b766e326d9b817ee1cc12ba54}
\begin{DoxyReturn}{Returns}
The next available policy tag. 
\end{DoxyReturn}
\hypertarget{classSourceMatchCodeGenerator_ae33e9728468e59181cc666858f469223}{
\index{SourceMatchCodeGenerator@{SourceMatchCodeGenerator}!tags@{tags}}
\index{tags@{tags}!SourceMatchCodeGenerator@{SourceMatchCodeGenerator}}
\subsubsection[{tags}]{\setlength{\rightskip}{0pt plus 5cm}const SourceMatchCodeGenerator::Tags \& SourceMatchCodeGenerator::tags (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classSourceMatchCodeGenerator_ae33e9728468e59181cc666858f469223}


The source match code generator will map source blocks to tags. 

If a source block is empty, a tag will not be used.

\begin{DoxyReturn}{Returns}
information about tags used. 
\end{DoxyReturn}


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