\section{TPProto::Cache\-Method Class Reference}
\label{classTPProto_1_1CacheMethod}\index{TPProto::CacheMethod@{TPProto::CacheMethod}}
Base class for a method of caching frames. Works in partnership with \doxyref{Cache}{p.}{classTPProto_1_1Cache} to cache frames. \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} determains how to cache the frames.  


{\tt \#include $<$cachemethod.h$>$}

Inheritance diagram for TPProto::Cache\-Method::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classTPProto_1_1CacheMethod}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Cache\-Method} ()\label{classTPProto_1_1CacheMethod_e5e568984e2a60936dcb9ea3437a46af}

\begin{CompactList}\small\item\em Default Constructor. \item\end{CompactList}\item 
{\bf Cache\-Method} (const {\bf Cache\-Method} \&rhs)\label{classTPProto_1_1CacheMethod_1b2d635b40d3435b45b8af22e2f903cd}

\begin{CompactList}\small\item\em Copy Constructor, sets all fields to NULL. Subclasses should call this, and initialise any fields it might have. \item\end{CompactList}\item 
virtual {\bf $\sim$Cache\-Method} ()\label{classTPProto_1_1CacheMethod_91687519e0af48ce6b3355eefb1c5d13}

\begin{CompactList}\small\item\em Destructor, virtual. \item\end{CompactList}\item 
virtual void {\bf update} ()=0\label{classTPProto_1_1CacheMethod_2a9c4e84b07113a1281d25f4024ede2f}

\begin{CompactList}\small\item\em Called when the client wants to update the cache. Can do nothing. \item\end{CompactList}\item 
void {\bf set\-Cache} ({\bf Cache} $\ast$c)
\begin{CompactList}\small\item\em Sets the \doxyref{Cache}{p.}{classTPProto_1_1Cache} object this \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} is for. Cache\-Methods can (and need to) use the \doxyref{Cache}{p.}{classTPProto_1_1Cache} to get useful information. \item\end{CompactList}\item 
void {\bf set\-Protocol\-Layer} ({\bf Protocol\-Layer} $\ast$pl)
\begin{CompactList}\small\item\em Sets the \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer} to use. \item\end{CompactList}\item 
virtual void {\bf get\-By\-Id} (uint32\_\-t id)=0
\begin{CompactList}\small\item\em Gets a item from the cache by Id. \item\end{CompactList}\item 
virtual void {\bf mark\-Invalid} (uint32\_\-t id)=0
\begin{CompactList}\small\item\em Marks an item as invalid. If a method wishes to it can refetch it from the server. The pointer to the frame should not be consided valid, and does not get deleted by the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. \item\end{CompactList}\item 
void {\bf get\-All\-Ids} (const Id\-Set\-Callback \&cb)
\begin{CompactList}\small\item\em Gets all the ids. \item\end{CompactList}\item 
boost::signals::connection \textbf{watch\-All\-Ids} (const Id\-Set\-Callback \&cb)\label{classTPProto_1_1CacheMethod_6c29f9d9c623053771ee8dd5fd94bc75}

\item 
virtual {\bf Cache\-Method} $\ast$ {\bf clone} ()=0\label{classTPProto_1_1CacheMethod_91d359f765d0c7f5d195a4df8dc107d0}

\begin{CompactList}\small\item\em Returns an empty clone of this \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. body should be return new Cache\-Method\-Name\-Copy\-Constructor(this);. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void \textbf{get\-Id\-List} ()=0\label{classTPProto_1_1CacheMethod_71ea06feac3be6a3f96a98d14f357004}

\item 
void \textbf{new\-Id\-List} (std::set$<$ uint32\_\-t $>$ list)\label{classTPProto_1_1CacheMethod_3ac864a7bb9d61a42139e517a1b2df7f}

\item 
void \textbf{existing\-List} (std::set$<$ uint32\_\-t $>$ list)\label{classTPProto_1_1CacheMethod_d093037f5229d5ca372f4f5b861e998b}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf Cache} $\ast$ {\bf cache}\label{classTPProto_1_1CacheMethod_20b7f9b7b7b83347a447027e2f26d150}

\begin{CompactList}\small\item\em The \doxyref{Cache}{p.}{classTPProto_1_1Cache} this \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} will use. \item\end{CompactList}\item 
{\bf Protocol\-Layer} $\ast$ {\bf protocol}\label{classTPProto_1_1CacheMethod_61319b9bc72da61dcecc63c0dd6160e5}

\begin{CompactList}\small\item\em The \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer} that will be used. \item\end{CompactList}\item 
Id\-Set\-Signal \textbf{waiters}\label{classTPProto_1_1CacheMethod_a4426a612faba5550c648ef13553331c}

\item 
Id\-Set\-Signal \textbf{watchers}\label{classTPProto_1_1CacheMethod_e3a6f7ecd3c9f5baf523000fda2f213d}

\end{CompactItemize}


\subsection{Detailed Description}
Base class for a method of caching frames. Works in partnership with \doxyref{Cache}{p.}{classTPProto_1_1Cache} to cache frames. \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} determains how to cache the frames. 



\subsection{Member Function Documentation}
\index{TPProto::CacheMethod@{TPProto::Cache\-Method}!setCache@{setCache}}
\index{setCache@{setCache}!TPProto::CacheMethod@{TPProto::Cache\-Method}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Cache\-Method::set\-Cache ({\bf Cache} $\ast$ {\em c})}\label{classTPProto_1_1CacheMethod_03f057eb5ecd89972bbcf13788376a48}


Sets the \doxyref{Cache}{p.}{classTPProto_1_1Cache} object this \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} is for. Cache\-Methods can (and need to) use the \doxyref{Cache}{p.}{classTPProto_1_1Cache} to get useful information. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]The \doxyref{Cache}{p.}{classTPProto_1_1Cache} this cache method will be used for. \end{description}
\end{Desc}
\index{TPProto::CacheMethod@{TPProto::Cache\-Method}!setProtocolLayer@{setProtocolLayer}}
\index{setProtocolLayer@{setProtocolLayer}!TPProto::CacheMethod@{TPProto::Cache\-Method}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Cache\-Method::set\-Protocol\-Layer ({\bf Protocol\-Layer} $\ast$ {\em pl})}\label{classTPProto_1_1CacheMethod_52e7636ef7e79aa310161ce68d213007}


Sets the \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer} to use. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pl}]The \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer} to use. \end{description}
\end{Desc}
\index{TPProto::CacheMethod@{TPProto::Cache\-Method}!getById@{getById}}
\index{getById@{getById}!TPProto::CacheMethod@{TPProto::Cache\-Method}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void TPProto::Cache\-Method::get\-By\-Id (uint32\_\-t {\em id})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classTPProto_1_1CacheMethod_70241b52891e51e04e27763b08c51b77}


Gets a item from the cache by Id. 

Returned by call to \doxyref{Cache::new\-Item}{p.}{classTPProto_1_1Cache_202281d5db63116a41517d794f98c7df} or \doxyref{Cache::existing\-Item}{p.}{classTPProto_1_1Cache_4047c19364373975e47acaaea50665da}

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em id}]The Id of the item to get. \end{description}
\end{Desc}


Implemented in {\bf TPProto::Cache\-None\-Method} \doxyref{}{p.}{classTPProto_1_1CacheNoneMethod_5c3df343df7533b9ec6fe5b9ffcad2da}.\index{TPProto::CacheMethod@{TPProto::Cache\-Method}!markInvalid@{markInvalid}}
\index{markInvalid@{markInvalid}!TPProto::CacheMethod@{TPProto::Cache\-Method}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void TPProto::Cache\-Method::mark\-Invalid (uint32\_\-t {\em id})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classTPProto_1_1CacheMethod_f0740410842894f1c5f3f35068cd8275}


Marks an item as invalid. If a method wishes to it can refetch it from the server. The pointer to the frame should not be consided valid, and does not get deleted by the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em id}]The id of the item that is invalid. \end{description}
\end{Desc}


Implemented in {\bf TPProto::Cache\-None\-Method} \doxyref{}{p.}{classTPProto_1_1CacheNoneMethod_4ceddfa22902b1d48d5e3c365049056d}.\index{TPProto::CacheMethod@{TPProto::Cache\-Method}!getAllIds@{getAllIds}}
\index{getAllIds@{getAllIds}!TPProto::CacheMethod@{TPProto::Cache\-Method}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Cache\-Method::get\-All\-Ids (const Id\-Set\-Callback \& {\em cb})}\label{classTPProto_1_1CacheMethod_7fbc16715c2aaddd74ae8a401d5f4be9}


Gets all the ids. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cb}]The callback to send the set of ids to.. \end{description}
\end{Desc}


The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
tpproto/{\bf cachemethod.h}\item 
tpproto/cachemethod.cpp\end{CompactItemize}
