\section{TPProto::Board\-Cache Class Reference}
\label{classTPProto_1_1BoardCache}\index{TPProto::BoardCache@{TPProto::BoardCache}}
A \doxyref{Cache}{p.}{classTPProto_1_1Cache} that caches Boards.  


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

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

\begin{CompactList}\small\item\em Default Constructor. \item\end{CompactList}\item 
virtual {\bf $\sim$Board\-Cache} ()\label{classTPProto_1_1BoardCache_600e5c954ba882fbd47d6f1fdecb16ac}

\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
void {\bf update} ()\label{classTPProto_1_1BoardCache_c1c0e060470083d3e965f9528dded177}

\begin{CompactList}\small\item\em Updates the cache. In \doxyref{Board\-Cache}{p.}{classTPProto_1_1BoardCache}, we also see what our board's Id is, so we can direct people to it. \item\end{CompactList}\item 
void {\bf request\-Board} (uint32\_\-t bid, const Board\-Callback \&cb)
\begin{CompactList}\small\item\em Gets an \doxyref{Board}{p.}{classTPProto_1_1Board} from the cache. \item\end{CompactList}\item 
boost::signals::connection {\bf watch\-Board} (uint32\_\-t bid, const Board\-Callback \&cb)
\begin{CompactList}\small\item\em Watch for changes to a \doxyref{Board}{p.}{classTPProto_1_1Board} in the cache. \item\end{CompactList}\item 
void {\bf invalidate\-Board} (uint32\_\-t bid)
\begin{CompactList}\small\item\em Set an \doxyref{Board}{p.}{classTPProto_1_1Board} Id as invalid and mark to be refetched. \item\end{CompactList}\item 
void {\bf request\-Board\-Ids} (const Id\-Set\-Callback \&cb)\label{classTPProto_1_1BoardCache_6368eb2f65407fcbcdb1345248cefce5}

\begin{CompactList}\small\item\em Gets a set of all \doxyref{Board}{p.}{classTPProto_1_1Board} Ids. Returned via Id\-Set\-Callback. \item\end{CompactList}\item 
boost::signals::connection \textbf{watch\-Board\-Ids} (const Id\-Set\-Callback \&cb)\label{classTPProto_1_1BoardCache_dc6348bf3bdfc143dae5701ec84dfe12}

\item 
virtual {\bf Get\-Id\-Sequence} $\ast$ {\bf create\-Get\-Id\-Sequence\-Frame} ()\label{classTPProto_1_1BoardCache_1d451cc2107fc8814cf817c485876ebc}

\begin{CompactList}\small\item\em Create a Get\-Ids\-Sequence subclass frame for the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} to use. Must return the correct type of frame for this \doxyref{Cache}{p.}{classTPProto_1_1Cache}. \item\end{CompactList}\item 
virtual {\bf Get\-By\-Id} $\ast$ {\bf create\-Get\-By\-Id\-Frame} ()\label{classTPProto_1_1BoardCache_35c8501002ec06b57cfe91160633c739}

\begin{CompactList}\small\item\em Create a \doxyref{Get\-By\-Id}{p.}{classTPProto_1_1GetById} subclass frame for the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod} to use. Must return the correct type of frame for this \doxyref{Cache}{p.}{classTPProto_1_1Cache}. \item\end{CompactList}\item 
virtual uint32\_\-t {\bf get\-Id\-From\-Frame} ({\bf Frame} $\ast$frame)
\begin{CompactList}\small\item\em Get the Id from the \doxyref{Frame}{p.}{classTPProto_1_1Frame} provided. The \doxyref{Frame}{p.}{classTPProto_1_1Frame} is of the correct type. For example, for the \doxyref{Object}{p.}{classTPProto_1_1Object} cache, the \doxyref{Frame}{p.}{classTPProto_1_1Frame} will be an \doxyref{Object}{p.}{classTPProto_1_1Object}. \item\end{CompactList}\item 
virtual uint64\_\-t {\bf get\-Mod\-Time\-From\-Frame} ({\bf Frame} $\ast$frame)
\begin{CompactList}\small\item\em Get the Modification time from the \doxyref{Frame}{p.}{classTPProto_1_1Frame} provided. The \doxyref{Frame}{p.}{classTPProto_1_1Frame} is of the correct type. For example, for the \doxyref{Object}{p.}{classTPProto_1_1Object} cache, the \doxyref{Frame}{p.}{classTPProto_1_1Frame} will be an \doxyref{Object}{p.}{classTPProto_1_1Object}. \item\end{CompactList}\item 
virtual void {\bf new\-Item} (boost::shared\_\-ptr$<$ {\bf Frame} $>$ item)
\begin{CompactList}\small\item\em Receive a new or updated version of an item from the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. \item\end{CompactList}\item 
virtual void {\bf existing\-Item} (boost::shared\_\-ptr$<$ {\bf Frame} $>$ item)
\begin{CompactList}\small\item\em Receive an existing item from the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
A \doxyref{Cache}{p.}{classTPProto_1_1Cache} that caches Boards. 



\subsection{Member Function Documentation}
\index{TPProto::BoardCache@{TPProto::Board\-Cache}!requestBoard@{requestBoard}}
\index{requestBoard@{requestBoard}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Board\-Cache::request\-Board (uint32\_\-t {\em bid}, const Board\-Callback \& {\em cb})}\label{classTPProto_1_1BoardCache_ba9650835591eed1ceb1651eb91043a7}


Gets an \doxyref{Board}{p.}{classTPProto_1_1Board} from the cache. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bid}]The id of the \doxyref{Board}{p.}{classTPProto_1_1Board} to get. \item[{\em cb}]The callback to call when the \doxyref{Board}{p.}{classTPProto_1_1Board} is available. \end{description}
\end{Desc}
\index{TPProto::BoardCache@{TPProto::Board\-Cache}!watchBoard@{watchBoard}}
\index{watchBoard@{watchBoard}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}boost::signals::connection TPProto::Board\-Cache::watch\-Board (uint32\_\-t {\em bid}, const Board\-Callback \& {\em cb})}\label{classTPProto_1_1BoardCache_7a27a32d7f24f8c46638a6bcfcaa7b6b}


Watch for changes to a \doxyref{Board}{p.}{classTPProto_1_1Board} in the cache. 

The first time the board is change (or arrives for the first time) it is possible that two copies of the same board are delievered.

Also, do not watch the personal board using id 0, as this will fail (badly).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bid}]The id of the \doxyref{Board}{p.}{classTPProto_1_1Board} to watch. \item[{\em cb}]The callback to call when the \doxyref{Board}{p.}{classTPProto_1_1Board} changes. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]connection object to manage the subscription to this board. \end{Desc}
\index{TPProto::BoardCache@{TPProto::Board\-Cache}!invalidateBoard@{invalidateBoard}}
\index{invalidateBoard@{invalidateBoard}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Board\-Cache::invalidate\-Board (uint32\_\-t {\em bid})}\label{classTPProto_1_1BoardCache_9188f5e37bfbe731996ef299e2ba3906}


Set an \doxyref{Board}{p.}{classTPProto_1_1Board} Id as invalid and mark to be refetched. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em bid}]The id of the \doxyref{Board}{p.}{classTPProto_1_1Board} to invalidate. \end{description}
\end{Desc}
\index{TPProto::BoardCache@{TPProto::Board\-Cache}!getIdFromFrame@{getIdFromFrame}}
\index{getIdFromFrame@{getIdFromFrame}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint32\_\-t TPProto::Board\-Cache::get\-Id\-From\-Frame ({\bf Frame} $\ast$ {\em frame})\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1BoardCache_eb0631a79bf41a7c9854e2235d30a15a}


Get the Id from the \doxyref{Frame}{p.}{classTPProto_1_1Frame} provided. The \doxyref{Frame}{p.}{classTPProto_1_1Frame} is of the correct type. For example, for the \doxyref{Object}{p.}{classTPProto_1_1Object} cache, the \doxyref{Frame}{p.}{classTPProto_1_1Frame} will be an \doxyref{Object}{p.}{classTPProto_1_1Object}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em frame}]The \doxyref{Frame}{p.}{classTPProto_1_1Frame} to get the Id from. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The id of the frame. \end{Desc}


Implements {\bf TPProto::Cache} \doxyref{}{p.}{classTPProto_1_1Cache_75a6f039db7cb69b6019c928776c574f}.\index{TPProto::BoardCache@{TPProto::Board\-Cache}!getModTimeFromFrame@{getModTimeFromFrame}}
\index{getModTimeFromFrame@{getModTimeFromFrame}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint64\_\-t TPProto::Board\-Cache::get\-Mod\-Time\-From\-Frame ({\bf Frame} $\ast$ {\em frame})\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1BoardCache_6b2c55f73063a888e92a01123abcb778}


Get the Modification time from the \doxyref{Frame}{p.}{classTPProto_1_1Frame} provided. The \doxyref{Frame}{p.}{classTPProto_1_1Frame} is of the correct type. For example, for the \doxyref{Object}{p.}{classTPProto_1_1Object} cache, the \doxyref{Frame}{p.}{classTPProto_1_1Frame} will be an \doxyref{Object}{p.}{classTPProto_1_1Object}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em frame}]The \doxyref{Frame}{p.}{classTPProto_1_1Frame} to get the Modtime from. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The modtime of the frame. \end{Desc}


Implements {\bf TPProto::Cache} \doxyref{}{p.}{classTPProto_1_1Cache_019bddc598295778f9b0f8f05ad23c2f}.\index{TPProto::BoardCache@{TPProto::Board\-Cache}!newItem@{newItem}}
\index{newItem@{newItem}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Board\-Cache::new\-Item (boost::shared\_\-ptr$<$ {\bf Frame} $>$ {\em item})\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1BoardCache_51374f0d1f28c675cf05e3818c3c9642}


Receive a new or updated version of an item from the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]The existing item in a \doxyref{Frame}{p.}{classTPProto_1_1Frame} \end{description}
\end{Desc}


Implements {\bf TPProto::Cache} \doxyref{}{p.}{classTPProto_1_1Cache_202281d5db63116a41517d794f98c7df}.\index{TPProto::BoardCache@{TPProto::Board\-Cache}!existingItem@{existingItem}}
\index{existingItem@{existingItem}!TPProto::BoardCache@{TPProto::Board\-Cache}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Board\-Cache::existing\-Item (boost::shared\_\-ptr$<$ {\bf Frame} $>$ {\em item})\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1BoardCache_50e70cb0c6766907b5cda3370dec680c}


Receive an existing item from the \doxyref{Cache\-Method}{p.}{classTPProto_1_1CacheMethod}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]The existing item in a \doxyref{Frame}{p.}{classTPProto_1_1Frame} \end{description}
\end{Desc}


Implements {\bf TPProto::Cache} \doxyref{}{p.}{classTPProto_1_1Cache_4047c19364373975e47acaaea50665da}.

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