\section{TPProto::Frame\-Codec Class Reference}
\label{classTPProto_1_1FrameCodec}\index{TPProto::FrameCodec@{TPProto::FrameCodec}}
\doxyref{Frame\-Codec}{p.}{classTPProto_1_1FrameCodec} is the main working class the lower layer of libtpproto-cpp.  


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

Inheritance diagram for TPProto::Frame\-Codec::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classTPProto_1_1FrameCodec}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Frame\-Codec} ()
\begin{CompactList}\small\item\em Constructs object and sets up defaults. \item\end{CompactList}\item 
{\bf $\sim$Frame\-Codec} ()\label{classTPProto_1_1FrameCodec_5bcb1eaa126b2acc5f498600b4b325b6}

\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
void {\bf set\-Async\-Frame\-Listener} ({\bf Async\-Frame\-Listener} $\ast$afl)
\begin{CompactList}\small\item\em Sets the \doxyref{Async\-Frame\-Listener}{p.}{classTPProto_1_1AsyncFrameListener}. \item\end{CompactList}\item 
void {\bf set\-Logger} ({\bf Logger} $\ast$nlog)
\begin{CompactList}\small\item\em Sets the \doxyref{Logger}{p.}{classTPProto_1_1Logger}. \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}. \item\end{CompactList}\item 
int {\bf get\-Status} ()
\begin{CompactList}\small\item\em Gets the status of the connection. \item\end{CompactList}\item 
Frame\-Connection \textbf{send\-Frame} (boost::shared\_\-ptr$<$ {\bf Frame} $>$ f, const Frame\-Signal::slot\_\-type \&callback)\label{classTPProto_1_1FrameCodec_6a487af4fae91aca7fec9958a827cbc6}

\item 
void {\bf ready\-To\-Read} ()
\begin{CompactList}\small\item\em Called when the socket has data ready to be read. \item\end{CompactList}\item 
void {\bf ready\-To\-Send} ()
\begin{CompactList}\small\item\em Called when the socket is ready for data to be sent to it. \item\end{CompactList}\item 
void \textbf{received\-Frame} ({\bf Frame} $\ast$frame)\label{classTPProto_1_1FrameCodec_e84c8af1b3f59e8a3585ed58b5d5533a}

\end{CompactItemize}


\subsection{Detailed Description}
\doxyref{Frame\-Codec}{p.}{classTPProto_1_1FrameCodec} is the main working class the lower layer of libtpproto-cpp. 

The \doxyref{Frame\-Codec}{p.}{classTPProto_1_1FrameCodec} class is responsible for handling the running of the protocol. It interacts with the Thousand Parsec servers and avoids a lot of unneccessary handling by the client and higher layers. The \doxyref{Frame\-Codec}{p.}{classTPProto_1_1FrameCodec} class is not the best way for a client to access a tp server, use the upper layers for that, but it can be used if necessary. A \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer} must be set (by setting this object as the \doxyref{Frame\-Codec}{p.}{classTPProto_1_1FrameCodec} for the \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer}). 



\subsection{Constructor \& Destructor Documentation}
\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!FrameCodec@{FrameCodec}}
\index{FrameCodec@{FrameCodec}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}TPProto::Frame\-Codec::Frame\-Codec ()}\label{classTPProto_1_1FrameCodec_13bf629b02c178ef5c8de4a170a781d2}


Constructs object and sets up defaults. 

Defaults are\begin{itemize}
\item no \doxyref{TPSocket}{p.}{classTPProto_1_1TPSocket}\item no \doxyref{Async\-Frame\-Listener}{p.}{classTPProto_1_1AsyncFrameListener}\item \doxyref{Silent\-Logger}{p.}{classTPProto_1_1SilentLogger} for the \doxyref{Logger}{p.}{classTPProto_1_1Logger}\item version unknown \end{itemize}


\subsection{Member Function Documentation}
\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!setAsyncFrameListener@{setAsyncFrameListener}}
\index{setAsyncFrameListener@{setAsyncFrameListener}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Frame\-Codec::set\-Async\-Frame\-Listener ({\bf Async\-Frame\-Listener} $\ast$ {\em afl})}\label{classTPProto_1_1FrameCodec_1064ec390df97ca4286ff65203f8a78e}


Sets the \doxyref{Async\-Frame\-Listener}{p.}{classTPProto_1_1AsyncFrameListener}. 

Only one \doxyref{Async\-Frame\-Listener}{p.}{classTPProto_1_1AsyncFrameListener} is allowed currently. When a new listener is set, the old one if present is deleted. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em afl}]The \doxyref{Async\-Frame\-Listener}{p.}{classTPProto_1_1AsyncFrameListener} to use. \end{description}
\end{Desc}
\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!setLogger@{setLogger}}
\index{setLogger@{setLogger}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Frame\-Codec::set\-Logger ({\bf Logger} $\ast$ {\em nlog})}\label{classTPProto_1_1FrameCodec_fa28f3084f2f599896505dcc96bfdae5}


Sets the \doxyref{Logger}{p.}{classTPProto_1_1Logger}. 

This method sets a new \doxyref{Logger}{p.}{classTPProto_1_1Logger}. The old \doxyref{Logger}{p.}{classTPProto_1_1Logger} is deleted. If the pointer to the new \doxyref{Logger}{p.}{classTPProto_1_1Logger} is NULL, the default \doxyref{Silent\-Logger}{p.}{classTPProto_1_1SilentLogger} is used. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em nlog}]The new \doxyref{Logger}{p.}{classTPProto_1_1Logger} to use, or NULL \end{description}
\end{Desc}
\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!setProtocolLayer@{setProtocolLayer}}
\index{setProtocolLayer@{setProtocolLayer}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Frame\-Codec::set\-Protocol\-Layer ({\bf Protocol\-Layer} $\ast$ {\em pl})}\label{classTPProto_1_1FrameCodec_9704dd2e92a323d3efcb176a1d4e9eab}


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

This method sets the \doxyref{Protocol\-Layer}{p.}{classTPProto_1_1ProtocolLayer}. \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::FrameCodec@{TPProto::Frame\-Codec}!getStatus@{getStatus}}
\index{getStatus@{getStatus}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int TPProto::Frame\-Codec::get\-Status ()}\label{classTPProto_1_1FrameCodec_c8d49aac142530545ef339618632736a}


Gets the status of the connection. 

\begin{Desc}
\item[Returns:]The status (int). \end{Desc}
\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!readyToRead@{readyToRead}}
\index{readyToRead@{readyToRead}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Frame\-Codec::ready\-To\-Read ()\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1FrameCodec_b3685152543f15b2af38871034d3e205}


Called when the socket has data ready to be read. 

Protocol reading entry point is here. Non-blocking sockets should be used. 

Implements {\bf TPProto::Connection} \doxyref{}{p.}{classTPProto_1_1Connection_75c4ba0d071816553eae209f43189b96}.\index{TPProto::FrameCodec@{TPProto::Frame\-Codec}!readyToSend@{readyToSend}}
\index{readyToSend@{readyToSend}!TPProto::FrameCodec@{TPProto::Frame\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TPProto::Frame\-Codec::ready\-To\-Send ()\hspace{0.3cm}{\tt  [virtual]}}\label{classTPProto_1_1FrameCodec_3269e53fee288a156af0c8c4c77379d2}


Called when the socket is ready for data to be sent to it. 

This can be used to send queued data when non-blocking writes say they would have blocked. 

Implements {\bf TPProto::Connection} \doxyref{}{p.}{classTPProto_1_1Connection_dc5d7cbed3ddd193900305b915535e66}.

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