\hypertarget{classTerm}{
\section{Term Class Reference}
\label{classTerm}\index{Term@{Term}}
}


A term is an atomic policy unit.  




{\ttfamily \#include $<$term.hh$>$}

Inheritance diagram for Term:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classTerm}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classTerm_1_1term__syntax__error}{term\_\-syntax\_\-error}
\begin{DoxyCompactList}\small\item\em Exception thrown on a syntax error while parsing configuration. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum {\bfseries BLOCKS} \{ {\bfseries SOURCE} =  0, 
{\bfseries DEST}, 
{\bfseries ACTION}, 
{\bfseries LAST\_\-BLOCK}
 \}
\item 
\hypertarget{classTerm_a7cac43eb60bde0f4b53bbc1f08a2494b}{
typedef \hyperlink{classConfigNodeIdMap}{ConfigNodeIdMap}$<$ \hyperlink{classNode}{Node} $\ast$ $>$ {\bfseries Nodes}}
\label{classTerm_a7cac43eb60bde0f4b53bbc1f08a2494b}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classTerm_afc877c37344d2f3983d2addd8037acc0}{Term} (const string \&name)
\item 
const string \& \hyperlink{classTerm_a37a2b71f080fdc3fc539649442d28665}{name} () const 
\item 
\hypertarget{classTerm_a80ef364400decf2d18d52cce309d802d}{
void \hyperlink{classTerm_a80ef364400decf2d18d52cce309d802d}{set\_\-term\_\-end} ()}
\label{classTerm_a80ef364400decf2d18d52cce309d802d}

\begin{DoxyCompactList}\small\item\em Perform operations at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} term. \item\end{DoxyCompactList}\item 
void \hyperlink{classTerm_a2b730a7fd41e4db31cc954dc8a939413}{set\_\-block} (const uint32\_\-t \&block, const \hyperlink{classConfigNodeId}{ConfigNodeId} \&order, const string \&statement)
\begin{DoxyCompactList}\small\item\em Updates \hyperlink{protocolthe-p}{the} source/dest/action block of a term. \item\end{DoxyCompactList}\item 
void \hyperlink{classTerm_a324ec1f04e0691a929186d33e5883b59}{del\_\-block} (const uint32\_\-t \&block, const \hyperlink{classConfigNodeId}{ConfigNodeId} \&order)
\begin{DoxyCompactList}\small\item\em Deletes statements in \hyperlink{protocolthe-p}{the} location specified by order and block. \item\end{DoxyCompactList}\item 
void \hyperlink{classTerm_acb8312b34532c25f8cc5c830769c8e21}{set\_\-block\_\-end} (uint32\_\-t block)
\begin{DoxyCompactList}\small\item\em Perform operations at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} block. \item\end{DoxyCompactList}\item 
const \hyperlink{classElement}{Element} $\ast$ \hyperlink{classTerm_a5e7e749e257c44649e0285994e6222ae}{accept} (\hyperlink{classVisitor}{Visitor} \&v)
\begin{DoxyCompactList}\small\item\em \hyperlink{classVisitor}{Visitor} implementation. \item\end{DoxyCompactList}\item 
\hyperlink{classConfigNodeIdMap}{Nodes} \& \hyperlink{classTerm_ac95bfac0182a7e3adaadab17e545aaa5}{source\_\-nodes} ()
\item 
\hyperlink{classConfigNodeIdMap}{Nodes} \& \hyperlink{classTerm_a79c87779de024f8c563b256ddea373cb}{dest\_\-nodes} ()
\item 
\hyperlink{classConfigNodeIdMap}{Nodes} \& \hyperlink{classTerm_add1aa3102554de62b8472e263564b4b9}{action\_\-nodes} ()
\item 
const string \& \hyperlink{classTerm_ac0a174dcfbf07ab74e197e0fd44de493}{from\_\-protocol} () const 
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block). \item\end{DoxyCompactList}\item 
void \hyperlink{classTerm_a3fdf35cbbc8a35641bdea15e54787b24}{set\_\-from\_\-protocol} (const string \&v)
\begin{DoxyCompactList}\small\item\em Set \hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block). \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static string \hyperlink{classTerm_a640751e0eb1b9a49e0587383ec3544de}{block2str} (uint32\_\-t num)
\begin{DoxyCompactList}\small\item\em Convert block number to human readable form. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classTerm_af03e3185dee52f14e2898aea7c5033cb}{
list$<$ pair$<$ \hyperlink{classConfigNodeId}{ConfigNodeId}, \hyperlink{classNode}{Node} $\ast$ $>$ $>$::iterator {\bfseries find\_\-out\_\-of\_\-order\_\-node} (const uint32\_\-t \&block, const \hyperlink{classConfigNodeId}{ConfigNodeId} \&order)}
\label{classTerm_af03e3185dee52f14e2898aea7c5033cb}

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

\item 
\hypertarget{classTerm_a041238f720c85421d968f7c5da07fc85}{
\hyperlink{classConfigNodeIdMap}{Nodes} $\ast$ {\bfseries \_\-block\_\-nodes} \mbox{[}3\mbox{]}}
\label{classTerm_a041238f720c85421d968f7c5da07fc85}

\item 
\hypertarget{classTerm_abf77f39664c99d6fab355b0d3c9cb26f}{
list$<$ pair$<$ \hyperlink{classConfigNodeId}{ConfigNodeId}, \hyperlink{classNode}{Node} $\ast$ $>$ $>$ {\bfseries \_\-out\_\-of\_\-order\_\-nodes} \mbox{[}3\mbox{]}}
\label{classTerm_abf77f39664c99d6fab355b0d3c9cb26f}

\item 
\hypertarget{classTerm_aa448a1b46285716a3ba57fc7eb44f553}{
\hyperlink{classConfigNodeIdMap}{Nodes} $\ast$\& {\bfseries \_\-source\_\-nodes}}
\label{classTerm_aa448a1b46285716a3ba57fc7eb44f553}

\item 
\hypertarget{classTerm_a5393f663ba3a068d6bfd9f487226700e}{
\hyperlink{classConfigNodeIdMap}{Nodes} $\ast$\& {\bfseries \_\-dest\_\-nodes}}
\label{classTerm_a5393f663ba3a068d6bfd9f487226700e}

\item 
\hypertarget{classTerm_ab71506de3ea63cd6a5ab65337f4f7306}{
\hyperlink{classConfigNodeIdMap}{Nodes} $\ast$\& {\bfseries \_\-action\_\-nodes}}
\label{classTerm_ab71506de3ea63cd6a5ab65337f4f7306}

\item 
\hypertarget{classTerm_a471159ed07afb6308d1293a375f5ea8c}{
string {\bfseries \_\-from\_\-protocol}}
\label{classTerm_a471159ed07afb6308d1293a375f5ea8c}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A term is an atomic policy unit. It is a complete specification of how a route needs to be matched, and what actions must be taken. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classTerm_afc877c37344d2f3983d2addd8037acc0}{
\index{Term@{Term}!Term@{Term}}
\index{Term@{Term}!Term@{Term}}
\subsubsection[{Term}]{\setlength{\rightskip}{0pt plus 5cm}Term::Term (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
)}}
\label{classTerm_afc877c37344d2f3983d2addd8037acc0}

\begin{DoxyParams}{Parameters}
{\em name} & term name. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classTerm_a5e7e749e257c44649e0285994e6222ae}{
\index{Term@{Term}!accept@{accept}}
\index{accept@{accept}!Term@{Term}}
\subsubsection[{accept}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Element}$\ast$ Term::accept (
\begin{DoxyParamCaption}
\item[{{\bf Visitor} \&}]{v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_a5e7e749e257c44649e0285994e6222ae}


\hyperlink{classVisitor}{Visitor} implementation. 


\begin{DoxyParams}{Parameters}
{\em v} & visitor used to visit this term. \\
\hline
\end{DoxyParams}
\hypertarget{classTerm_add1aa3102554de62b8472e263564b4b9}{
\index{Term@{Term}!action\_\-nodes@{action\_\-nodes}}
\index{action\_\-nodes@{action\_\-nodes}!Term@{Term}}
\subsubsection[{action\_\-nodes}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Nodes}\& Term::action\_\-nodes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_add1aa3102554de62b8472e263564b4b9}
\begin{DoxyReturn}{Returns}
parse tree of action block. 
\end{DoxyReturn}
\hypertarget{classTerm_a640751e0eb1b9a49e0587383ec3544de}{
\index{Term@{Term}!block2str@{block2str}}
\index{block2str@{block2str}!Term@{Term}}
\subsubsection[{block2str}]{\setlength{\rightskip}{0pt plus 5cm}string Term::block2str (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{num}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{classTerm_a640751e0eb1b9a49e0587383ec3544de}


Convert block number to human readable form. 


\begin{DoxyParams}{Parameters}
{\em num} & \hyperlink{protocolthe-p}{the} block number. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
human readable representation of block name. 
\end{DoxyReturn}
\hypertarget{classTerm_a324ec1f04e0691a929186d33e5883b59}{
\index{Term@{Term}!del\_\-block@{del\_\-block}}
\index{del\_\-block@{del\_\-block}!Term@{Term}}
\subsubsection[{del\_\-block}]{\setlength{\rightskip}{0pt plus 5cm}void Term::del\_\-block (
\begin{DoxyParamCaption}
\item[{const uint32\_\-t \&}]{block, }
\item[{const {\bf ConfigNodeId} \&}]{order}
\end{DoxyParamCaption}
)}}
\label{classTerm_a324ec1f04e0691a929186d33e5883b59}


Deletes statements in \hyperlink{protocolthe-p}{the} location specified by order and block. 


\begin{DoxyParams}{Parameters}
{\em block} & \hyperlink{protocolthe-p}{the} block to update (0:source, 1:dest, 2:action). \\
\hline
{\em order} & node ID with position of term. \\
\hline
\end{DoxyParams}
\hypertarget{classTerm_a79c87779de024f8c563b256ddea373cb}{
\index{Term@{Term}!dest\_\-nodes@{dest\_\-nodes}}
\index{dest\_\-nodes@{dest\_\-nodes}!Term@{Term}}
\subsubsection[{dest\_\-nodes}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Nodes}\& Term::dest\_\-nodes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_a79c87779de024f8c563b256ddea373cb}
\begin{DoxyReturn}{Returns}
parse tree of dest block. 
\end{DoxyReturn}
\hypertarget{classTerm_ac0a174dcfbf07ab74e197e0fd44de493}{
\index{Term@{Term}!from\_\-protocol@{from\_\-protocol}}
\index{from\_\-protocol@{from\_\-protocol}!Term@{Term}}
\subsubsection[{from\_\-protocol}]{\setlength{\rightskip}{0pt plus 5cm}const string\& Term::from\_\-protocol (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_ac0a174dcfbf07ab74e197e0fd44de493}


Get \hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block). 

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block) if set, otherwise an empty string. 
\end{DoxyReturn}
\hypertarget{classTerm_a37a2b71f080fdc3fc539649442d28665}{
\index{Term@{Term}!name@{name}}
\index{name@{name}!Term@{Term}}
\subsubsection[{name}]{\setlength{\rightskip}{0pt plus 5cm}const string\& Term::name (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_a37a2b71f080fdc3fc539649442d28665}
\begin{DoxyReturn}{Returns}
name of \hyperlink{protocolthe-p}{the} term. 
\end{DoxyReturn}
\hypertarget{classTerm_a2b730a7fd41e4db31cc954dc8a939413}{
\index{Term@{Term}!set\_\-block@{set\_\-block}}
\index{set\_\-block@{set\_\-block}!Term@{Term}}
\subsubsection[{set\_\-block}]{\setlength{\rightskip}{0pt plus 5cm}void Term::set\_\-block (
\begin{DoxyParamCaption}
\item[{const uint32\_\-t \&}]{block, }
\item[{const {\bf ConfigNodeId} \&}]{order, }
\item[{const string \&}]{statement}
\end{DoxyParamCaption}
)}}
\label{classTerm_a2b730a7fd41e4db31cc954dc8a939413}


Updates \hyperlink{protocolthe-p}{the} source/dest/action block of a term. 


\begin{DoxyParams}{Parameters}
{\em block} & \hyperlink{protocolthe-p}{the} block to update (0:source, 1:dest, 2:action). \\
\hline
{\em order} & node ID with position of term. \\
\hline
{\em statement} & \hyperlink{protocolthe-p}{the} statement to insert. \\
\hline
\end{DoxyParams}
\hypertarget{classTerm_acb8312b34532c25f8cc5c830769c8e21}{
\index{Term@{Term}!set\_\-block\_\-end@{set\_\-block\_\-end}}
\index{set\_\-block\_\-end@{set\_\-block\_\-end}!Term@{Term}}
\subsubsection[{set\_\-block\_\-end}]{\setlength{\rightskip}{0pt plus 5cm}void Term::set\_\-block\_\-end (
\begin{DoxyParamCaption}
\item[{uint32\_\-t}]{block}
\end{DoxyParamCaption}
)}}
\label{classTerm_acb8312b34532c25f8cc5c830769c8e21}


Perform operations at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} block. 


\begin{DoxyParams}{Parameters}
{\em block} & \hyperlink{protocolthe-p}{the} block to perform operations on (0:source, 1:dest, 2:action). \\
\hline
\end{DoxyParams}
\hypertarget{classTerm_a3fdf35cbbc8a35641bdea15e54787b24}{
\index{Term@{Term}!set\_\-from\_\-protocol@{set\_\-from\_\-protocol}}
\index{set\_\-from\_\-protocol@{set\_\-from\_\-protocol}!Term@{Term}}
\subsubsection[{set\_\-from\_\-protocol}]{\setlength{\rightskip}{0pt plus 5cm}void Term::set\_\-from\_\-protocol (
\begin{DoxyParamCaption}
\item[{const string \&}]{v}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_a3fdf35cbbc8a35641bdea15e54787b24}


Set \hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block). 


\begin{DoxyParams}{Parameters}
{\em v} & \hyperlink{protocolthe-p}{the} protocol name (in \hyperlink{protocolthe-p}{the} \char`\"{}from\char`\"{} block). \\
\hline
\end{DoxyParams}
\hypertarget{classTerm_ac95bfac0182a7e3adaadab17e545aaa5}{
\index{Term@{Term}!source\_\-nodes@{source\_\-nodes}}
\index{source\_\-nodes@{source\_\-nodes}!Term@{Term}}
\subsubsection[{source\_\-nodes}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Nodes}\& Term::source\_\-nodes (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classTerm_ac95bfac0182a7e3adaadab17e545aaa5}
\begin{DoxyReturn}{Returns}
parse tree of source block. 
\end{DoxyReturn}


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