\hypertarget{QSTD_8h}{
\section{QSTD.h File Reference}
\label{QSTD_8h}\index{QSTD.h@{QSTD.h}}
}
Interface to the Science Statistics for Physics datagrams.  


\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{QSTD_8h_cdab86e8510faa85c8d87795a98ff517}{
typedef struct \hyperlink{struct__QSTD}{\_\-QSTD} \textbf{QSTD}}
\label{QSTD_8h_cdab86e8510faa85c8d87795a98ff517}

\item 
\hypertarget{QSTD_8h_79ac155c018f9e63d11d7815849510e0}{
typedef struct \hyperlink{struct__QSTD__ctx}{\_\-QSTD\_\-ctx} \textbf{QSTD\_\-ctx}}
\label{QSTD_8h_79ac155c018f9e63d11d7815849510e0}

\item 
\hypertarget{QSTD_8h_9eff0f43101a28fbe0dd20249ad180fe}{
typedef struct \_\-LSF\_\-datagram \textbf{LSF\_\-datagram}}
\label{QSTD_8h_9eff0f43101a28fbe0dd20249ad180fe}

\item 
\hypertarget{QSTD_8h_1fb84a08d95682b7029ca89d40aa53c3}{
typedef struct \_\-LSF\_\-contribution \textbf{LSF\_\-contribution}}
\label{QSTD_8h_1fb84a08d95682b7029ca89d40aa53c3}

\item 
\hypertarget{QSTD_8h_e776b0ac9ea008fdfdd39bbd8b6ecf4e}{
typedef struct \_\-LSF\_\-record \textbf{LSF\_\-record}}
\label{QSTD_8h_e776b0ac9ea008fdfdd39bbd8b6ecf4e}

\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{struct__QSTD}{QSTD} $\ast$ \hyperlink{QSTD_8h_9ea6da996d375f9639782b35f50275e6}{QSTD\_\-alloc} (void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em Allocates and constructs a QSTD handle. \item\end{CompactList}\item 
const LSF\_\-contribution $\ast$ \hyperlink{QSTD_8h_b7cdc6defd6188fc7dfdc86e664c57c3}{QSTD\_\-updateAtDatagram} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, const LSF\_\-datagram $\ast$dgm)
\begin{CompactList}\small\item\em Updates the context at datagram time. \item\end{CompactList}\item 
int \hyperlink{QSTD_8h_b7335188cdd5c1cba797b3520bbc3ae4}{QSTD\_\-updateAtContribution} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, const LSF\_\-contribution $\ast$ctb)
\begin{CompactList}\small\item\em Updates the context at datagram time. \item\end{CompactList}\item 
int \hyperlink{QSTD_8h_dd3390102cb4d8c800ce7de8dfca5438}{QSTD\_\-updateAtRecord} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, const LSF\_\-record $\ast$rec)
\begin{CompactList}\small\item\em Updates the context at record time. \item\end{CompactList}\item 
void \hyperlink{QSTD_8h_23ca6f78bfd6ebb27ee1b603e9279a7c}{QSTD\_\-destruct} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd)
\begin{CompactList}\small\item\em The destructor for a QSTD control structure. \item\end{CompactList}\item 
const \hyperlink{struct__QSTD__ctx}{QSTD\_\-ctx} $\ast$ \hyperlink{QSTD_8h_962816f9773df3313831c8393a81a189}{QSTD\_\-ctxGet} (const \hyperlink{struct__QSTD}{QSTD} $\ast$qstd)
\begin{CompactList}\small\item\em Locates the statistics context (meta-data). \item\end{CompactList}\item 
int \hyperlink{QSTD_8h_7cb7a5fbec0b287d215ea336b2bff698}{QSTD\_\-sizeof} (void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em Returns the size, in bytes, of a QSTD control structure. \item\end{CompactList}\item 
\hyperlink{struct__QSTD}{QSTD} $\ast$ \hyperlink{QSTD_8h_58b8d0059fb60679eae0130c58dcae7d}{QSTD\_\-construct} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em The constructor for a QSTD control structure. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the Science Statistics for Physics datagrams. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: QSTD.h,v 1.1 2008/06/10 22:25:45 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{QSTD_8h_9ea6da996d375f9639782b35f50275e6}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-alloc@{QSTD\_\-alloc}}
\index{QSTD\_\-alloc@{QSTD\_\-alloc}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-alloc}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QSTD}$\ast$ QSTD\_\-alloc (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSTD_8h_9ea6da996d375f9639782b35f50275e6}


Allocates and constructs a QSTD handle. 

\begin{Desc}
\item[Returns:]Pointer to the allocated handle\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em must\_\-be\_\-null}]Reserved for future use. \end{description}
\end{Desc}


References QSTD\_\-construct().\hypertarget{QSTD_8h_58b8d0059fb60679eae0130c58dcae7d}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-construct@{QSTD\_\-construct}}
\index{QSTD\_\-construct@{QSTD\_\-construct}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-construct}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QSTD}$\ast$ QSTD\_\-construct ({\bf QSTD} $\ast$ {\em qstd}, \/  void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSTD_8h_58b8d0059fb60679eae0130c58dcae7d}


The constructor for a QSTD control structure. 

\begin{Desc}
\item[Returns:]Pointer to the QSTD control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The control structure to be constructed. If NULL, a control structure will be allocated \item[{\em must\_\-be\_\-null}]Reserved for future use. \end{description}
\end{Desc}


References \_\-QSTD\_\-ctx::com, \_\-QSTD::ctx, \_\-QSTD::cumulative, \_\-QSTD\_\-ctx::cumulative, \_\-QSTD::free, \_\-QSTD::labelsHandlers, QSSP\_\-ctxConstruct(), \_\-QSTD\_\-ctx::qstd, qstd\_\-file\_\-cache\_\-get(), QSTD\_\-labelsHandlersDefGet(), QSTD\_\-sizeof(), QSTD\_\-versionsHandlersDefGet(), and \_\-QSTD::versionsHandlers.

Referenced by QSTD\_\-alloc().\hypertarget{QSTD_8h_962816f9773df3313831c8393a81a189}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-ctxGet@{QSTD\_\-ctxGet}}
\index{QSTD\_\-ctxGet@{QSTD\_\-ctxGet}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-ctxGet}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf QSTD\_\-ctx}$\ast$ QSTD\_\-ctxGet (const {\bf QSTD} $\ast$ {\em qstd})}}
\label{QSTD_8h_962816f9773df3313831c8393a81a189}


Locates the statistics context (meta-data). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The statistics context \end{description}
\end{Desc}


References \_\-QSTD::ctx.\hypertarget{QSTD_8h_23ca6f78bfd6ebb27ee1b603e9279a7c}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-destruct@{QSTD\_\-destruct}}
\index{QSTD\_\-destruct@{QSTD\_\-destruct}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-destruct}]{\setlength{\rightskip}{0pt plus 5cm}void QSTD\_\-destruct ({\bf QSTD} $\ast$ {\em qstd})}}
\label{QSTD_8h_23ca6f78bfd6ebb27ee1b603e9279a7c}


The destructor for a QSTD control structure. 

\begin{Desc}
\item[Returns:]Pointer to the QSS control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The control structure to be destructed. \end{description}
\end{Desc}


References \_\-QSTD::free.\hypertarget{QSTD_8h_7cb7a5fbec0b287d215ea336b2bff698}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-sizeof@{QSTD\_\-sizeof}}
\index{QSTD\_\-sizeof@{QSTD\_\-sizeof}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-sizeof (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSTD_8h_7cb7a5fbec0b287d215ea336b2bff698}


Returns the size, in bytes, of a QSTD control structure. 

\begin{Desc}
\item[Returns:]The size, in bytes, of a QSTD control structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em must\_\-be\_\-null}]Parameter reserved for future use \end{description}
\end{Desc}


Referenced by QSTD\_\-construct().\hypertarget{QSTD_8h_b7335188cdd5c1cba797b3520bbc3ae4}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-updateAtContribution@{QSTD\_\-updateAtContribution}}
\index{QSTD\_\-updateAtContribution@{QSTD\_\-updateAtContribution}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-updateAtContribution}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-updateAtContribution ({\bf QSTD} $\ast$ {\em qstd}, \/  const LSF\_\-contribution $\ast$ {\em ctb})}}
\label{QSTD_8h_b7335188cdd5c1cba797b3520bbc3ae4}


Updates the context at datagram time. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em If}]have a statistics sample contribution, the number of records in the contribution. \item[{\em $>$0,if}]have a record contributor \item[{\em =0,if}]have the contribution context \item[{\em -1,if}]unrecognized\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The statistics context to update. \item[{\em ctb}]The statistics contribution \end{description}
\end{Desc}
\hypertarget{QSTD_8h_b7cdc6defd6188fc7dfdc86e664c57c3}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-updateAtDatagram@{QSTD\_\-updateAtDatagram}}
\index{QSTD\_\-updateAtDatagram@{QSTD\_\-updateAtDatagram}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-updateAtDatagram}]{\setlength{\rightskip}{0pt plus 5cm}const LSF\_\-contribution$\ast$ QSTD\_\-updateAtDatagram ({\bf QSTD} $\ast$ {\em qstd}, \/  const LSF\_\-datagram $\ast$ {\em dgm})}}
\label{QSTD_8h_b7cdc6defd6188fc7dfdc86e664c57c3}


Updates the context at datagram time. 

\begin{Desc}
\item[Returns:]The contribution to resume processsing at\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The statistics context to update. \item[{\em dgm}]The statistics datagram \end{description}
\end{Desc}


References \_\-QSTD\_\-ctx::com, \_\-QSTD\_\-ctxVersions::conditions, \_\-QSTD::ctx, \_\-QSTD::cumulative, \_\-QSSP\_\-ctx::dgm, \_\-QSSP\_\-ctx::files, \_\-QSTD\_\-ctx::labels, \_\-QSTD::labelsHandlers, \_\-QSTD\_\-ctxVersions::master, QSSP\_\-ctxUpdateAtDatagram(), QSTD\_\-labelsHandlersResolveFull(), QSTD\_\-VERSION\_\-K\_\-CONDITIONS, QSTD\_\-VERSION\_\-K\_\-SAMPLE, QSTD\_\-versionsGet(), QSTD\_\-versionsHandlersResolveFull(), \_\-QSTD\_\-ctxVersions::sample, \_\-QSTD\_\-ctx::version, \_\-QSTD::versions, and \_\-QSTD::versionsHandlers.\hypertarget{QSTD_8h_dd3390102cb4d8c800ce7de8dfca5438}{
\index{QSTD.h@{QSTD.h}!QSTD\_\-updateAtRecord@{QSTD\_\-updateAtRecord}}
\index{QSTD\_\-updateAtRecord@{QSTD\_\-updateAtRecord}!QSTD.h@{QSTD.h}}
\subsubsection[{QSTD\_\-updateAtRecord}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-updateAtRecord ({\bf QSTD} $\ast$ {\em qstd}, \/  const LSF\_\-record $\ast$ {\em rec})}}
\label{QSTD_8h_dd3390102cb4d8c800ce7de8dfca5438}


Updates the context at record time. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em Non-negative}]values indicate are one of the QSTD\_\-type's \item[{\em Negative}]values indicate an unsuccessful update\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The statistics context to update. \item[{\em rec}]The statistics record \end{description}
\end{Desc}


References \_\-QSTD::ctx, qstd\_\-sampleV0\_\-decode(), \_\-QSTD\_\-ctxVersions::sample, and \_\-QSTD\_\-ctx::version.