\hypertarget{classPolicyStatement}{
\section{PolicyStatement Class Reference}
\label{classPolicyStatement}\index{PolicyStatement@{PolicyStatement}}
}


A policy statement is a collection of terms.  




{\ttfamily \#include $<$policy\_\-statement.hh$>$}

Inheritance diagram for PolicyStatement:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classPolicyStatement}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classPolicyStatement_1_1PolicyStatementErr}{PolicyStatementErr}
\begin{DoxyCompactList}\small\item\em Exception thrown on error such as when no term is found. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyStatement_a7ed60f24b8f3af8ef8644292bed34b5b}{
typedef \hyperlink{classConfigNodeIdMap}{ConfigNodeIdMap}$<$ \hyperlink{classTerm}{Term} $\ast$ $>$ {\bfseries TermContainer}}
\label{classPolicyStatement_a7ed60f24b8f3af8ef8644292bed34b5b}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classPolicyStatement_ac3aab0e6f28f3d1a3f641485b03e9897}{PolicyStatement} (const string \&name, \hyperlink{classSetMap}{SetMap} \&smap, \hyperlink{classPolicyMap}{PolicyMap} \&pmap)
\item 
void \hyperlink{classPolicyStatement_aad3e3bba18bfd33b4944838a3ac13a77}{add\_\-term} (const \hyperlink{classConfigNodeId}{ConfigNodeId} \&order, \hyperlink{classTerm}{Term} $\ast$term)
\begin{DoxyCompactList}\small\item\em Append a term at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} policy. \item\end{DoxyCompactList}\item 
\hyperlink{classTerm}{Term} \& \hyperlink{classPolicyStatement_a323e7d07413c6d15c4f4bac661b213bc}{find\_\-term} (const string \&name) const 
\begin{DoxyCompactList}\small\item\em Throws exception if no term is found. \item\end{DoxyCompactList}\item 
bool \hyperlink{classPolicyStatement_a0dc9939b5241c789638dcd3e2fcb1284}{term\_\-exists} (const string \&name) const 
\begin{DoxyCompactList}\small\item\em Checks if a term already exists. \item\end{DoxyCompactList}\item 
bool \hyperlink{classPolicyStatement_aa72eadb15f46e9b7d70ae85c597c0206}{delete\_\-term} (const string \&name)
\begin{DoxyCompactList}\small\item\em Attempts to delete a term. \item\end{DoxyCompactList}\item 
\hypertarget{classPolicyStatement_a059dd22bc6eb86e43e6f59b69373168e}{
void \hyperlink{classPolicyStatement_a059dd22bc6eb86e43e6f59b69373168e}{set\_\-policy\_\-end} ()}
\label{classPolicyStatement_a059dd22bc6eb86e43e6f59b69373168e}

\begin{DoxyCompactList}\small\item\em Perform operations at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} policy. \item\end{DoxyCompactList}\item 
const string \& \hyperlink{classPolicyStatement_a2b553c5469b9e780c5c05e803478d86b}{name} () const 
\item 
bool \hyperlink{classPolicyStatement_ae3859d31534c0dc575840f7e2c91036f}{accept} (\hyperlink{classVisitor}{Visitor} \&v)
\begin{DoxyCompactList}\small\item\em \hyperlink{classVisitor}{Visitor} implementation. \item\end{DoxyCompactList}\item 
\hyperlink{classConfigNodeIdMap}{TermContainer} \& \hyperlink{classPolicyStatement_a806d934f2174cc8608ab0edf3b9088aa}{terms} ()
\item 
void \hyperlink{classPolicyStatement_a60c4c8a98b022f51015182679aae98fa}{set\_\-dependency} (const DEPS \&sets, const DEPS \&policies)
\begin{DoxyCompactList}\small\item\em Replace \hyperlink{protocolthe-p}{the} set dependencies. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyStatement_adab148267aaddedf89c4747bb737c800}{
typedef list$<$ pair$<$ \hyperlink{classConfigNodeId}{ConfigNodeId}, \hyperlink{classTerm}{Term} $\ast$ $>$ $>$ {\bfseries OOL}}
\label{classPolicyStatement_adab148267aaddedf89c4747bb737c800}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classPolicyStatement_acae1b50afb9f754978f6035f39a10f48}{
void \hyperlink{classPolicyStatement_acae1b50afb9f754978f6035f39a10f48}{del\_\-dependencies} ()}
\label{classPolicyStatement_acae1b50afb9f754978f6035f39a10f48}

\begin{DoxyCompactList}\small\item\em Delete all set dependencies of this policy. \item\end{DoxyCompactList}\item 
TermContainer::iterator \hyperlink{classPolicyStatement_a31dcd602e6c9d8dc2eaa2a3b95c47dc3}{get\_\-term\_\-iter} (const string \&name)
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} iterator for a specific term. \item\end{DoxyCompactList}\item 
\hypertarget{classPolicyStatement_abcd954ce134355fa0fe6bd5cf4ef7ae0}{
TermContainer::const\_\-iterator {\bfseries get\_\-term\_\-iter} (const string \&name) const }
\label{classPolicyStatement_abcd954ce134355fa0fe6bd5cf4ef7ae0}

\item 
OOL::iterator \hyperlink{classPolicyStatement_af09fbd9463891f4bf40386b07c2a411c}{find\_\-out\_\-of\_\-order\_\-term} (const \hyperlink{classConfigNodeId}{ConfigNodeId} \&order)
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} iterator for a term that is out of order. \item\end{DoxyCompactList}\item 
OOL::iterator \hyperlink{classPolicyStatement_a9928ce5495f154ff3357bbbd2caad3e0}{find\_\-out\_\-of\_\-order\_\-term} (const string \&name)
\begin{DoxyCompactList}\small\item\em Get \hyperlink{protocolthe-p}{the} iterator for a term that is out of order. \item\end{DoxyCompactList}\item 
\hypertarget{classPolicyStatement_a996a29238aa28a2b220e7e25c05fa7bc}{
OOL::const\_\-iterator {\bfseries find\_\-out\_\-of\_\-order\_\-term} (const string \&name) const }
\label{classPolicyStatement_a996a29238aa28a2b220e7e25c05fa7bc}

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

\item 
\hypertarget{classPolicyStatement_a6a78f84cb2b0fc7fcebff823ae5acb32}{
\hyperlink{classConfigNodeIdMap}{TermContainer} {\bfseries \_\-terms}}
\label{classPolicyStatement_a6a78f84cb2b0fc7fcebff823ae5acb32}

\item 
\hypertarget{classPolicyStatement_a60367f17c55ce050a036d7445b45c55f}{
list$<$ pair$<$ \hyperlink{classConfigNodeId}{ConfigNodeId}, \hyperlink{classTerm}{Term} $\ast$ $>$ $>$ {\bfseries \_\-out\_\-of\_\-order\_\-terms}}
\label{classPolicyStatement_a60367f17c55ce050a036d7445b45c55f}

\item 
\hypertarget{classPolicyStatement_a1f150ede13831febab5d6db3f5d90e90}{
DEPS {\bfseries \_\-sets}}
\label{classPolicyStatement_a1f150ede13831febab5d6db3f5d90e90}

\item 
\hypertarget{classPolicyStatement_a48da81a2d9249056426b2a265696ee44}{
DEPS {\bfseries \_\-policies}}
\label{classPolicyStatement_a48da81a2d9249056426b2a265696ee44}

\item 
\hypertarget{classPolicyStatement_a23a1d981f99d73edac24f88e6f5799c4}{
\hyperlink{classSetMap}{SetMap} \& {\bfseries \_\-smap}}
\label{classPolicyStatement_a23a1d981f99d73edac24f88e6f5799c4}

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

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A policy statement is a collection of terms. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classPolicyStatement_ac3aab0e6f28f3d1a3f641485b03e9897}{
\index{PolicyStatement@{PolicyStatement}!PolicyStatement@{PolicyStatement}}
\index{PolicyStatement@{PolicyStatement}!PolicyStatement@{PolicyStatement}}
\subsubsection[{PolicyStatement}]{\setlength{\rightskip}{0pt plus 5cm}PolicyStatement::PolicyStatement (
\begin{DoxyParamCaption}
\item[{const string \&}]{name, }
\item[{{\bf SetMap} \&}]{smap, }
\item[{{\bf PolicyMap} \&}]{pmap}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_ac3aab0e6f28f3d1a3f641485b03e9897}

\begin{DoxyParams}{Parameters}
{\em name} & \hyperlink{protocolthe-p}{the} name of \hyperlink{protocolthe-p}{the} policy. \\
\hline
{\em smap} & \hyperlink{protocolthe-p}{the} \hyperlink{classSetMap}{SetMap}. Used for dependency tracking. \\
\hline
{\em pmap} & \hyperlink{protocolthe-p}{the} \hyperlink{classPolicyMap}{PolicyMap}. Used for dependency tracking. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classPolicyStatement_ae3859d31534c0dc575840f7e2c91036f}{
\index{PolicyStatement@{PolicyStatement}!accept@{accept}}
\index{accept@{accept}!PolicyStatement@{PolicyStatement}}
\subsubsection[{accept}]{\setlength{\rightskip}{0pt plus 5cm}bool PolicyStatement::accept (
\begin{DoxyParamCaption}
\item[{{\bf Visitor} \&}]{v}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_ae3859d31534c0dc575840f7e2c91036f}


\hyperlink{classVisitor}{Visitor} implementation. 


\begin{DoxyParams}{Parameters}
{\em v} & visitor to visit policy. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_aad3e3bba18bfd33b4944838a3ac13a77}{
\index{PolicyStatement@{PolicyStatement}!add\_\-term@{add\_\-term}}
\index{add\_\-term@{add\_\-term}!PolicyStatement@{PolicyStatement}}
\subsubsection[{add\_\-term}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyStatement::add\_\-term (
\begin{DoxyParamCaption}
\item[{const {\bf ConfigNodeId} \&}]{order, }
\item[{{\bf Term} $\ast$}]{term}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_aad3e3bba18bfd33b4944838a3ac13a77}


Append a term at \hyperlink{protocolthe-p}{the} end of \hyperlink{protocolthe-p}{the} policy. 

Caller must not delete / modify pointer.


\begin{DoxyParams}{Parameters}
{\em order} & node ID with position of term. \\
\hline
{\em term} & term to append to policy. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_aa72eadb15f46e9b7d70ae85c597c0206}{
\index{PolicyStatement@{PolicyStatement}!delete\_\-term@{delete\_\-term}}
\index{delete\_\-term@{delete\_\-term}!PolicyStatement@{PolicyStatement}}
\subsubsection[{delete\_\-term}]{\setlength{\rightskip}{0pt plus 5cm}bool PolicyStatement::delete\_\-term (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_aa72eadb15f46e9b7d70ae85c597c0206}


Attempts to delete a term. 

\begin{DoxyReturn}{Returns}
true on successful delete, false otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em name} & name of term to delete. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_af09fbd9463891f4bf40386b07c2a411c}{
\index{PolicyStatement@{PolicyStatement}!find\_\-out\_\-of\_\-order\_\-term@{find\_\-out\_\-of\_\-order\_\-term}}
\index{find\_\-out\_\-of\_\-order\_\-term@{find\_\-out\_\-of\_\-order\_\-term}!PolicyStatement@{PolicyStatement}}
\subsubsection[{find\_\-out\_\-of\_\-order\_\-term}]{\setlength{\rightskip}{0pt plus 5cm}list$<$ pair$<$ {\bf ConfigNodeId}, {\bf Term} $\ast$ $>$ $>$::iterator PolicyStatement::find\_\-out\_\-of\_\-order\_\-term (
\begin{DoxyParamCaption}
\item[{const {\bf ConfigNodeId} \&}]{order}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyStatement_af09fbd9463891f4bf40386b07c2a411c}


Get \hyperlink{protocolthe-p}{the} iterator for a term that is out of order. 


\begin{DoxyParams}{Parameters}
{\em order} & \hyperlink{protocolthe-p}{the} order for \hyperlink{protocolthe-p}{the} term. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
iterator for term. 
\end{DoxyReturn}
\hypertarget{classPolicyStatement_a9928ce5495f154ff3357bbbd2caad3e0}{
\index{PolicyStatement@{PolicyStatement}!find\_\-out\_\-of\_\-order\_\-term@{find\_\-out\_\-of\_\-order\_\-term}}
\index{find\_\-out\_\-of\_\-order\_\-term@{find\_\-out\_\-of\_\-order\_\-term}!PolicyStatement@{PolicyStatement}}
\subsubsection[{find\_\-out\_\-of\_\-order\_\-term}]{\setlength{\rightskip}{0pt plus 5cm}list$<$ pair$<$ {\bf ConfigNodeId}, {\bf Term} $\ast$ $>$ $>$::iterator PolicyStatement::find\_\-out\_\-of\_\-order\_\-term (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyStatement_a9928ce5495f154ff3357bbbd2caad3e0}


Get \hyperlink{protocolthe-p}{the} iterator for a term that is out of order. 


\begin{DoxyParams}{Parameters}
{\em name} & \hyperlink{protocolthe-p}{the} name for \hyperlink{protocolthe-p}{the} term. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
iterator for term. 
\end{DoxyReturn}
\hypertarget{classPolicyStatement_a323e7d07413c6d15c4f4bac661b213bc}{
\index{PolicyStatement@{PolicyStatement}!find\_\-term@{find\_\-term}}
\index{find\_\-term@{find\_\-term}!PolicyStatement@{PolicyStatement}}
\subsubsection[{find\_\-term}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Term} \& PolicyStatement::find\_\-term (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
) const}}
\label{classPolicyStatement_a323e7d07413c6d15c4f4bac661b213bc}


Throws exception if no term is found. 

\begin{DoxyReturn}{Returns}
term requested. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em name} & name of term to find. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_a31dcd602e6c9d8dc2eaa2a3b95c47dc3}{
\index{PolicyStatement@{PolicyStatement}!get\_\-term\_\-iter@{get\_\-term\_\-iter}}
\index{get\_\-term\_\-iter@{get\_\-term\_\-iter}!PolicyStatement@{PolicyStatement}}
\subsubsection[{get\_\-term\_\-iter}]{\setlength{\rightskip}{0pt plus 5cm}PolicyStatement::TermContainer::iterator PolicyStatement::get\_\-term\_\-iter (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{classPolicyStatement_a31dcd602e6c9d8dc2eaa2a3b95c47dc3}


Get \hyperlink{protocolthe-p}{the} iterator for a specific term. 

\begin{DoxyReturn}{Returns}
iterator for term. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em name} & name of \hyperlink{protocolthe-p}{the} term. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_a2b553c5469b9e780c5c05e803478d86b}{
\index{PolicyStatement@{PolicyStatement}!name@{name}}
\index{name@{name}!PolicyStatement@{PolicyStatement}}
\subsubsection[{name}]{\setlength{\rightskip}{0pt plus 5cm}const string \& PolicyStatement::name (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}
\label{classPolicyStatement_a2b553c5469b9e780c5c05e803478d86b}
\begin{DoxyReturn}{Returns}
name of policy. 
\end{DoxyReturn}
\hypertarget{classPolicyStatement_a60c4c8a98b022f51015182679aae98fa}{
\index{PolicyStatement@{PolicyStatement}!set\_\-dependency@{set\_\-dependency}}
\index{set\_\-dependency@{set\_\-dependency}!PolicyStatement@{PolicyStatement}}
\subsubsection[{set\_\-dependency}]{\setlength{\rightskip}{0pt plus 5cm}void PolicyStatement::set\_\-dependency (
\begin{DoxyParamCaption}
\item[{const DEPS \&}]{sets, }
\item[{const DEPS \&}]{policies}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_a60c4c8a98b022f51015182679aae98fa}


Replace \hyperlink{protocolthe-p}{the} set dependencies. 


\begin{DoxyParams}{Parameters}
{\em sets} & \hyperlink{protocolthe-p}{the} new sets this policy is dependent on. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_a0dc9939b5241c789638dcd3e2fcb1284}{
\index{PolicyStatement@{PolicyStatement}!term\_\-exists@{term\_\-exists}}
\index{term\_\-exists@{term\_\-exists}!PolicyStatement@{PolicyStatement}}
\subsubsection[{term\_\-exists}]{\setlength{\rightskip}{0pt plus 5cm}bool PolicyStatement::term\_\-exists (
\begin{DoxyParamCaption}
\item[{const string \&}]{name}
\end{DoxyParamCaption}
) const}}
\label{classPolicyStatement_a0dc9939b5241c789638dcd3e2fcb1284}


Checks if a term already exists. 

\begin{DoxyReturn}{Returns}
true if term exists, false otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em name} & term name. \\
\hline
\end{DoxyParams}
\hypertarget{classPolicyStatement_a806d934f2174cc8608ab0edf3b9088aa}{
\index{PolicyStatement@{PolicyStatement}!terms@{terms}}
\index{terms@{terms}!PolicyStatement@{PolicyStatement}}
\subsubsection[{terms}]{\setlength{\rightskip}{0pt plus 5cm}{\bf PolicyStatement::TermContainer} \& PolicyStatement::terms (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classPolicyStatement_a806d934f2174cc8608ab0edf3b9088aa}
\begin{DoxyReturn}{Returns}
terms of this policy 
\end{DoxyReturn}


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