\hypertarget{classElemAny}{
\section{ElemAny$<$ T $>$ Class Template Reference}
\label{classElemAny}\index{ElemAny@{ElemAny}}
}


Generic \hyperlink{classElement}{Element} wrapper for existing classes.  




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

Inheritance diagram for ElemAny$<$ T $>$:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classElemAny}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{classElemAny_1_1ElemInitError}{ElemInitError}
\begin{DoxyCompactList}\small\item\em exception thrown if c-\/stype string initialization fails. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classElemAny_a7b59c0b468685a94f61200af16b7fa68}{
{\bfseries ElemAny} (const T \&val)}
\label{classElemAny_a7b59c0b468685a94f61200af16b7fa68}

\item 
\hyperlink{classElemAny_ab3425c6dd8f00e611eae3fdd0860272a}{ElemAny} (const char $\ast$c\_\-str)
\begin{DoxyCompactList}\small\item\em If \hyperlink{protocolthe-p}{the} c-\/style constructor of \hyperlink{protocolthe-p}{the} wrapped class throws and exception, it is caught and an \hyperlink{classElemAny_1_1ElemInitError}{ElemInitError} exception is thrown. \item\end{DoxyCompactList}\item 
bool \hyperlink{classElemAny_a9c9c071e3327ae00fa188430184358ef}{operator==} (const \hyperlink{classElemAny}{ElemAny}$<$ T $>$ \&rhs) const 
\begin{DoxyCompactList}\small\item\em Invokes \hyperlink{protocolthe-p}{the} == operator on \hyperlink{protocolthe-p}{the} actual classes being wrapped. \item\end{DoxyCompactList}\item 
bool \hyperlink{classElemAny_af18f033c156a1d4f1ebf3495a444129f}{operator$<$} (const \hyperlink{classElemAny}{ElemAny}$<$ T $>$ \&rhs) const 
\begin{DoxyCompactList}\small\item\em Invoke \hyperlink{protocolthe-p}{the} $<$ operator in \hyperlink{protocolthe-p}{the} wrapped class. \item\end{DoxyCompactList}\item 
string \hyperlink{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}{str} () const 
\begin{DoxyCompactList}\small\item\em Invokes \hyperlink{protocolthe-p}{the} \hyperlink{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}{str()} method of \hyperlink{protocolthe-p}{the} actual class being wrapped. \item\end{DoxyCompactList}\item 
const T \& \hyperlink{classElemAny_a7b410d2ec4af32238362a2e4752c3709}{val} () const 
\item 
const char $\ast$ \hyperlink{classElemAny_abb18fcf463916fbabfc09e4720ce6306}{type} () const 
\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classElemAny_a0af581cdae76d7e35bfebe5c815b6fe4}{
static const char $\ast$ {\bfseries id} = \char`\"{}ipv4range\char`\"{}}
\label{classElemAny_a0af581cdae76d7e35bfebe5c815b6fe4}

\item 
\hypertarget{classElemAny_aaa93f15cdba0da7e924ca005e809111c}{
static Hash {\bfseries \_\-hash} = HASH\_\-ELEM\_\-IPV4RANGE}
\label{classElemAny_aaa93f15cdba0da7e924ca005e809111c}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classElemAny_ad6eb27db920fecd9cb5cdc37145b089e}{
T {\bfseries \_\-val}}
\label{classElemAny_ad6eb27db920fecd9cb5cdc37145b089e}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$ class ElemAny$<$ T $>$}

Generic \hyperlink{classElement}{Element} wrapper for existing classes. Classes being wrapped need to provide a \hyperlink{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}{str()} method and must have a c-\/style string constructor. They also must support various relational operators such as ==. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classElemAny_ab3425c6dd8f00e611eae3fdd0860272a}{
\index{ElemAny@{ElemAny}!ElemAny@{ElemAny}}
\index{ElemAny@{ElemAny}!ElemAny@{ElemAny}}
\subsubsection[{ElemAny}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ {\bf ElemAny}$<$ T $>$::{\bf ElemAny} (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{c\_\-str}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classElemAny_ab3425c6dd8f00e611eae3fdd0860272a}


If \hyperlink{protocolthe-p}{the} c-\/style constructor of \hyperlink{protocolthe-p}{the} wrapped class throws and exception, it is caught and an \hyperlink{classElemAny_1_1ElemInitError}{ElemInitError} exception is thrown. 

The original exception is lost. 

\subsection{Member Function Documentation}
\hypertarget{classElemAny_af18f033c156a1d4f1ebf3495a444129f}{
\index{ElemAny@{ElemAny}!operator$<$@{operator$<$}}
\index{operator$<$@{operator$<$}!ElemAny@{ElemAny}}
\subsubsection[{operator$<$}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf ElemAny}$<$ T $>$::operator$<$ (
\begin{DoxyParamCaption}
\item[{const {\bf ElemAny}$<$ T $>$ \&}]{rhs}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classElemAny_af18f033c156a1d4f1ebf3495a444129f}


Invoke \hyperlink{protocolthe-p}{the} $<$ operator in \hyperlink{protocolthe-p}{the} wrapped class. 

\begin{DoxyReturn}{Returns}
whether this is less than argument. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em rhs} & element to compare with. \\
\hline
\end{DoxyParams}
\hypertarget{classElemAny_a9c9c071e3327ae00fa188430184358ef}{
\index{ElemAny@{ElemAny}!operator==@{operator==}}
\index{operator==@{operator==}!ElemAny@{ElemAny}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ bool {\bf ElemAny}$<$ T $>$::operator== (
\begin{DoxyParamCaption}
\item[{const {\bf ElemAny}$<$ T $>$ \&}]{rhs}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classElemAny_a9c9c071e3327ae00fa188430184358ef}


Invokes \hyperlink{protocolthe-p}{the} == operator on \hyperlink{protocolthe-p}{the} actual classes being wrapped. 

\begin{DoxyReturn}{Returns}
whether \hyperlink{protocolthe-p}{the} two values are equal. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em rhs} & element to compare with. \\
\hline
\end{DoxyParams}
\hypertarget{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}{
\index{ElemAny@{ElemAny}!str@{str}}
\index{str@{str}!ElemAny@{ElemAny}}
\subsubsection[{str}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ string {\bf ElemAny}$<$ T $>$::str (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}


Invokes \hyperlink{protocolthe-p}{the} \hyperlink{classElemAny_ad0a12a266430f2366d1a26b96c5046d9}{str()} method of \hyperlink{protocolthe-p}{the} actual class being wrapped. 

\begin{DoxyReturn}{Returns}
string representation of element. 
\end{DoxyReturn}


Implements \hyperlink{classElement_a1acf1c63bbe1374c574bf19e3a000552}{Element}.

\hypertarget{classElemAny_abb18fcf463916fbabfc09e4720ce6306}{
\index{ElemAny@{ElemAny}!type@{type}}
\index{type@{type}!ElemAny@{ElemAny}}
\subsubsection[{type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ const char$\ast$ {\bf ElemAny}$<$ T $>$::type (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline, virtual\mbox{]}}}}
\label{classElemAny_abb18fcf463916fbabfc09e4720ce6306}
\begin{DoxyReturn}{Returns}
string representation of element type. 
\end{DoxyReturn}


Implements \hyperlink{classElement_a17396c7d64fd4fc15713d3d803b57a56}{Element}.

\hypertarget{classElemAny_a7b410d2ec4af32238362a2e4752c3709}{
\index{ElemAny@{ElemAny}!val@{val}}
\index{val@{val}!ElemAny@{ElemAny}}
\subsubsection[{val}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ const T\& {\bf ElemAny}$<$ T $>$::val (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily  \mbox{[}inline\mbox{]}}}}
\label{classElemAny_a7b410d2ec4af32238362a2e4752c3709}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} actual object of \hyperlink{protocolthe-p}{the} class being wrapped. 
\end{DoxyReturn}


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