\hypertarget{classVersionFilter}{
\section{VersionFilter Class Reference}
\label{classVersionFilter}\index{VersionFilter@{VersionFilter}}
}


Policy filters which support versioning \mbox{[}i.e.  




{\ttfamily \#include $<$version\_\-filter.hh$>$}

Inheritance diagram for VersionFilter:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classVersionFilter}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{classVersionFilter_aaca9398796e9df39a3d818b3945aadcc}{VersionFilter} (const VarRW::Id \&fname)
\item 
void \hyperlink{classVersionFilter_a89e537f3adb6c1519e3b3e554ffb8af5}{configure} (const string \&str)
\begin{DoxyCompactList}\small\item\em Configure \hyperlink{protocolthe-p}{the} filter. \item\end{DoxyCompactList}\item 
void \hyperlink{classVersionFilter_a02522bb1286dba1fbdd0bc46e425de4b}{reset} ()
\begin{DoxyCompactList}\small\item\em Reset \hyperlink{protocolthe-p}{the} filter. \item\end{DoxyCompactList}\item 
bool \hyperlink{classVersionFilter_abced89d9bb375753e185b2700def56ca}{acceptRoute} (\hyperlink{classVarRW}{VarRW} \&varrw)
\begin{DoxyCompactList}\small\item\em See if a route is accepted by \hyperlink{protocolthe-p}{the} filter. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classVersionFilter_a39736ab6ce6f9bf22c76897a9a06a937}{
\hyperlink{classref__ptr}{RefPf} {\bfseries \_\-filter}}
\label{classVersionFilter_a39736ab6ce6f9bf22c76897a9a06a937}

\item 
\hypertarget{classVersionFilter_ade185d57c5640dc6546dd974a0ba6830}{
VarRW::Id {\bfseries \_\-fname}}
\label{classVersionFilter_ade185d57c5640dc6546dd974a0ba6830}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
Policy filters which support versioning \mbox{[}i.e. keep old version\mbox{]}.

The idea is to create a new policy filter on each configuration. Whenever a route is being processed, you read which filter to run. If this filter is 0, \mbox{[}null pointer\mbox{]} then give it \hyperlink{protocolthe-p}{the} last configuration. Else just run whatever filter is returned.

Filters should be referenced counted by routes. When reference count reaches 0, it should be deleted.

Why not keep filters internally here and read a filter id from route? Well because we cannot assume when to increment and decrement \hyperlink{protocolthe-p}{the} reference count. Say it's a normal route lookup and we do \hyperlink{protocolthe-p}{the} filtering, and it results to \char`\"{}accepted\char`\"{}. It doesn't imply we need to +1 \hyperlink{protocolthe-p}{the} reference count. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classVersionFilter_aaca9398796e9df39a3d818b3945aadcc}{
\index{VersionFilter@{VersionFilter}!VersionFilter@{VersionFilter}}
\index{VersionFilter@{VersionFilter}!VersionFilter@{VersionFilter}}
\subsubsection[{VersionFilter}]{\setlength{\rightskip}{0pt plus 5cm}VersionFilter::VersionFilter (
\begin{DoxyParamCaption}
\item[{const VarRW::Id \&}]{fname}
\end{DoxyParamCaption}
)}}
\label{classVersionFilter_aaca9398796e9df39a3d818b3945aadcc}

\begin{DoxyParams}{Parameters}
{\em fname} & \hyperlink{protocolthe-p}{the} variable to read/write in order to access filter. \\
\hline
\end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{classVersionFilter_abced89d9bb375753e185b2700def56ca}{
\index{VersionFilter@{VersionFilter}!acceptRoute@{acceptRoute}}
\index{acceptRoute@{acceptRoute}!VersionFilter@{VersionFilter}}
\subsubsection[{acceptRoute}]{\setlength{\rightskip}{0pt plus 5cm}bool VersionFilter::acceptRoute (
\begin{DoxyParamCaption}
\item[{{\bf VarRW} \&}]{varrw}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classVersionFilter_abced89d9bb375753e185b2700def56ca}


See if a route is accepted by \hyperlink{protocolthe-p}{the} filter. 

The route may be modified by \hyperlink{protocolthe-p}{the} filter \mbox{[}through \hyperlink{classVarRW}{VarRW}\mbox{]}.

\begin{DoxyReturn}{Returns}
true if \hyperlink{protocolthe-p}{the} route is accepted, false otherwise. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em varrw} & \hyperlink{protocolthe-p}{the} \hyperlink{classVarRW}{VarRW} associated with \hyperlink{protocolthe-p}{the} route being filtered. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classFilterBase_a3c2be411c10e8d42fe9ac69edd7378ff}{FilterBase}.

\hypertarget{classVersionFilter_a89e537f3adb6c1519e3b3e554ffb8af5}{
\index{VersionFilter@{VersionFilter}!configure@{configure}}
\index{configure@{configure}!VersionFilter@{VersionFilter}}
\subsubsection[{configure}]{\setlength{\rightskip}{0pt plus 5cm}void VersionFilter::configure (
\begin{DoxyParamCaption}
\item[{const string \&}]{str}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classVersionFilter_a89e537f3adb6c1519e3b3e554ffb8af5}


Configure \hyperlink{protocolthe-p}{the} filter. 


\begin{DoxyParams}{Parameters}
{\em str} & filter configuration. \\
\hline
\end{DoxyParams}


Implements \hyperlink{classFilterBase_afb5726167c1530611499febf7bfc9835}{FilterBase}.

\hypertarget{classVersionFilter_a02522bb1286dba1fbdd0bc46e425de4b}{
\index{VersionFilter@{VersionFilter}!reset@{reset}}
\index{reset@{reset}!VersionFilter@{VersionFilter}}
\subsubsection[{reset}]{\setlength{\rightskip}{0pt plus 5cm}void VersionFilter::reset (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{classVersionFilter_a02522bb1286dba1fbdd0bc46e425de4b}


Reset \hyperlink{protocolthe-p}{the} filter. 

Filter becomes a NO-\/operation -\/-\/ default action should be returned everytime an acceptRoute is called. 

Implements \hyperlink{classFilterBase_a0c8325520c41f4c475a9f8e831ca273c}{FilterBase}.



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