\hypertarget{QSTD_8c}{
\section{QSTD.c File Reference}
\label{QSTD_8c}\index{QSTD.c@{QSTD.c}}
}
Decodes the Science Statistics (Physics) for the handlers.  


{\tt \#include $<$QSSP/QSTD.h$>$}\par
{\tt \#include $<$QSSP/QSSP\_\-span.h$>$}\par
{\tt \#include $<$QSSP/QSTD\_\-labels.h$>$}\par
{\tt \#include $<$QSTD\_\-versions.h$>$}\par
{\tt \#include $<$QSTD\_\-pvtdefs.h$>$}\par
{\tt \#include $<$dprintf.h$>$}\par
{\tt \#include $<$QSP/QFCP\_\-cache.h$>$}\par
{\tt \#include $<$QSD/QFR\_\-file.h$>$}\par
{\tt \#include $<$QSD/QFC\_\-member.h$>$}\par
{\tt \#include $<$EFC/EFS\_\-ids.h$>$}\par
{\tt \#include $<$LSF/LSF.h$>$}\par
{\tt \#include $<$LSF/LSF\_\-scan.h$>$}\par
{\tt \#include $<$LSF/LSF\_\-reason.h$>$}\par
{\tt \#include $<$LDT/BFU.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{QSTD_8c_d3d66fd81edd50e3afade4ccec9a466a}{
\#define \textbf{RND\_\-8}(\_\-v)~((\_\-v + 7) \& $\sim$0x7)}
\label{QSTD_8c_d3d66fd81edd50e3afade4ccec9a466a}

\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef const unsigned int $\ast$($\ast$ \hyperlink{QSTD_8c_1363338d024feea20a4e77c88021bd27}{DecodeSampleV0} )(\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Signature to decode a statistics sample from the input data. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline QFCP\_\-cache $\ast$ \hyperlink{QSTD_8c_cd79fa9bf4f5dd288001469afdc0e64f}{qstd\_\-file\_\-cache\_\-get} (void)
\begin{CompactList}\small\item\em Returns a pointer to the file cache. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSTD_8c_51607afe36bf2cea8aac96b8a6cde36f}{decode\_\-statsV0\_\-norm} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__statisticsV0}{QSTD\_\-statisticsV0} $\ast$stats, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a normal (not differenced) statistics record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSTD_8c_055411e1cbc5b014d21ee5ede0f62838}{decode\_\-statsV0\_\-diff} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__statisticsV0}{QSTD\_\-statisticsV0} $\ast$stats, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes the statistics in difference format. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSTD_8c_ff39ee22bce68e6fc9230c8762b4929b}{decode\_\-sampleV0\_\-0} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 0 sample record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSTD_8c_ed7f661571409259397ed1eb9e84417d}{decode\_\-sampleV0\_\-1} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 1 sample record. \item\end{CompactList}\item 
static const unsigned int $\ast$ \hyperlink{QSTD_8c_c1125809133e622d2c14ace262814ebd}{decode\_\-sampleV0\_\-2} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, \hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)
\begin{CompactList}\small\item\em Decodes a format 2 sample record. \item\end{CompactList}\item 
\hyperlink{struct__QSTD}{QSTD} $\ast$ \hyperlink{QSTD_8c_17a3615377329bfd2340865737ada49c}{QSTD\_\-alloc} (void $\ast$must\_\-be\_\-null)
\begin{CompactList}\small\item\em Allocates and constructs a QSTD handle. \item\end{CompactList}\item 
\hyperlink{struct__QSTD}{QSTD} $\ast$ \hyperlink{QSTD_8c_39dd2f3e85be5c63b4aae363d54d024f}{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}\item 
void \hyperlink{QSTD_8c_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_8c_1337c0a6c12364bc692ff115649e24cb}{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_8c_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 
const LSF\_\-contribution $\ast$ \hyperlink{QSTD_8c_2c36550c66e7a835a99cf4ab590b95bf}{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_8c_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 
static \_\-\_\-inline void \hyperlink{QSTD_8c_984a0edf51bebd6197399553623de1a1}{qstd\_\-sampleV0\_\-add} (\hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$dst, const \hyperlink{struct__QSTD__sampleV0}{QSTD\_\-sampleV0} $\ast$src)
\begin{CompactList}\small\item\em Adds the source sample to the destination sample. \item\end{CompactList}\item 
static \_\-\_\-inline int \hyperlink{QSTD_8c_a402ddb1edde42b2fff986565b508978}{qstd\_\-sampleV0\_\-decode} (\hyperlink{struct__QSTD}{QSTD} $\ast$qstd, unsigned int type\_\-id, unsigned char bridge, const unsigned int $\ast$dat)
\begin{CompactList}\small\item\em Decodes the statistics data. \item\end{CompactList}\item 
int \hyperlink{QSTD_8c_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}\end{CompactItemize}


\subsection{Detailed Description}
Decodes the Science Statistics (Physics) for the handlers. 

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


\footnotesize\begin{verbatim}

   CVS $Id: QSTD.c,v 1.6 2011/03/29 00:14:57 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Typedef Documentation}
\hypertarget{QSTD_8c_1363338d024feea20a4e77c88021bd27}{
\index{QSTD.c@{QSTD.c}!DecodeSampleV0@{DecodeSampleV0}}
\index{DecodeSampleV0@{DecodeSampleV0}!QSTD.c@{QSTD.c}}
\subsubsection[{DecodeSampleV0}]{\setlength{\rightskip}{0pt plus 5cm}const unsigned int $\ast$($\ast$ {\bf DecodeSampleV0})({\bf QSTD} $\ast$qstd, {\bf QSTD\_\-sampleV0} $\ast$sample, const unsigned int $\ast$dat, unsigned char bridge)}}
\label{QSTD_8c_1363338d024feea20a4e77c88021bd27}


Signature to decode a statistics sample from the input data. 

\begin{Desc}
\item[Returns:]The next decode location\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The QSTD context handle \item[{\em sample}]The structure to receive the decoded data from \item[{\em dat}]The input data \item[{\em bridge}]The bridge word, contains decoding options \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{QSTD_8c_ff39ee22bce68e6fc9230c8762b4929b}{
\index{QSTD.c@{QSTD.c}!decode\_\-sampleV0\_\-0@{decode\_\-sampleV0\_\-0}}
\index{decode\_\-sampleV0\_\-0@{decode\_\-sampleV0\_\-0}!QSTD.c@{QSTD.c}}
\subsubsection[{decode\_\-sampleV0\_\-0}]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sampleV0\_\-0 ({\bf QSTD} $\ast$ {\em qstd}, \/  {\bf QSTD\_\-sampleV0} $\ast$ {\em sample}, \/  const unsigned int $\ast$ {\em dat}, \/  unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_ff39ee22bce68e6fc9230c8762b4929b}


Decodes a format 0 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word \end{description}
\end{Desc}


References \_\-QSTD::cumulative, decode\_\-statsV0\_\-norm(), \_\-QSTD::diff, QSSP\_\-spanV0DecodeTwo(), \_\-QSTD\_\-sampleV0::span, \_\-QSTD\_\-sampleV0::stats, and \_\-QSTD\_\-sample::v0.

Referenced by qstd\_\-sampleV0\_\-decode().\hypertarget{QSTD_8c_ed7f661571409259397ed1eb9e84417d}{
\index{QSTD.c@{QSTD.c}!decode\_\-sampleV0\_\-1@{decode\_\-sampleV0\_\-1}}
\index{decode\_\-sampleV0\_\-1@{decode\_\-sampleV0\_\-1}!QSTD.c@{QSTD.c}}
\subsubsection[{decode\_\-sampleV0\_\-1}]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sampleV0\_\-1 ({\bf QSTD} $\ast$ {\em qstd}, \/  {\bf QSTD\_\-sampleV0} $\ast$ {\em sample}, \/  const unsigned int $\ast$ {\em dat}, \/  unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_ed7f661571409259397ed1eb9e84417d}


Decodes a format 1 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word \end{description}
\end{Desc}


References \_\-QSTD::cumulative, decode\_\-statsV0\_\-norm(), \_\-QSTD::diff, QSSP\_\-spanV0DecodeOne(), \_\-QSTD\_\-sampleV0::span, \_\-QSTD\_\-sampleV0::stats, and \_\-QSTD\_\-sample::v0.

Referenced by qstd\_\-sampleV0\_\-decode().\hypertarget{QSTD_8c_c1125809133e622d2c14ace262814ebd}{
\index{QSTD.c@{QSTD.c}!decode\_\-sampleV0\_\-2@{decode\_\-sampleV0\_\-2}}
\index{decode\_\-sampleV0\_\-2@{decode\_\-sampleV0\_\-2}!QSTD.c@{QSTD.c}}
\subsubsection[{decode\_\-sampleV0\_\-2}]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-sampleV0\_\-2 ({\bf QSTD} $\ast$ {\em qstd}, \/  {\bf QSTD\_\-sampleV0} $\ast$ {\em sample}, \/  const unsigned int $\ast$ {\em dat}, \/  unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_c1125809133e622d2c14ace262814ebd}


Decodes a format 2 sample record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The decoding context \item[{\em sample}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word \end{description}
\end{Desc}


References \_\-QSTD::cumulative, decode\_\-statsV0\_\-diff(), \_\-QSTD::diff, QSSP\_\-spanV0DecodeDiff(), \_\-QSTD\_\-sampleV0::span, \_\-QSTD\_\-sampleV0::stats, and \_\-QSTD\_\-sample::v0.

Referenced by qstd\_\-sampleV0\_\-decode().\hypertarget{QSTD_8c_055411e1cbc5b014d21ee5ede0f62838}{
\index{QSTD.c@{QSTD.c}!decode\_\-statsV0\_\-diff@{decode\_\-statsV0\_\-diff}}
\index{decode\_\-statsV0\_\-diff@{decode\_\-statsV0\_\-diff}!QSTD.c@{QSTD.c}}
\subsubsection[{decode\_\-statsV0\_\-diff}]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-statsV0\_\-diff ({\bf QSTD} $\ast$ {\em qstd}, \/  {\bf QSTD\_\-statisticsV0} $\ast$ {\em stats}, \/  const unsigned int $\ast$ {\em dat}, \/  unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_055411e1cbc5b014d21ee5ede0f62838}


Decodes the statistics in difference format. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The decoding context \item[{\em stats}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word \end{description}
\end{Desc}


References \_\-QSTD\_\-statisticsV0::cnts, \_\-QSTD\_\-statisticsV0::nonzero, \_\-QSTD::sample, \_\-QSTD\_\-sampleV0::stats, and \_\-QSTD\_\-sample::v0.

Referenced by decode\_\-sampleV0\_\-2().\hypertarget{QSTD_8c_51607afe36bf2cea8aac96b8a6cde36f}{
\index{QSTD.c@{QSTD.c}!decode\_\-statsV0\_\-norm@{decode\_\-statsV0\_\-norm}}
\index{decode\_\-statsV0\_\-norm@{decode\_\-statsV0\_\-norm}!QSTD.c@{QSTD.c}}
\subsubsection[{decode\_\-statsV0\_\-norm}]{\setlength{\rightskip}{0pt plus 5cm}static const unsigned int $\ast$ decode\_\-statsV0\_\-norm ({\bf QSTD} $\ast$ {\em qstd}, \/  {\bf QSTD\_\-statisticsV0} $\ast$ {\em stats}, \/  const unsigned int $\ast$ {\em dat}, \/  unsigned char {\em bridge})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_51607afe36bf2cea8aac96b8a6cde36f}


Decodes a normal (not differenced) statistics record. 

\begin{Desc}
\item[Returns:]The next address to decode from\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The decoding context \item[{\em stats}]The data structure to receive the decoded statistics \item[{\em dat}]The statistics data \item[{\em bridge}]The record's bridge word \end{description}
\end{Desc}


References \_\-QSTD\_\-statisticsV0::cnts, and \_\-QSTD\_\-statisticsV0::nonzero.

Referenced by decode\_\-sampleV0\_\-0(), and decode\_\-sampleV0\_\-1().\hypertarget{QSTD_8c_17a3615377329bfd2340865737ada49c}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-alloc@{QSTD\_\-alloc}}
\index{QSTD\_\-alloc@{QSTD\_\-alloc}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-alloc}]{\setlength{\rightskip}{0pt plus 5cm}{\bf QSTD} $\ast$ QSTD\_\-alloc (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSTD_8c_17a3615377329bfd2340865737ada49c}


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_8c_39dd2f3e85be5c63b4aae363d54d024f}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-construct@{QSTD\_\-construct}}
\index{QSTD\_\-construct@{QSTD\_\-construct}!QSTD.c@{QSTD.c}}
\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_8c_39dd2f3e85be5c63b4aae363d54d024f}


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_8c_1337c0a6c12364bc692ff115649e24cb}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-ctxGet@{QSTD\_\-ctxGet}}
\index{QSTD\_\-ctxGet@{QSTD\_\-ctxGet}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-ctxGet}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf QSTD\_\-ctx} $\ast$ QSTD\_\-ctxGet (const {\bf QSTD} $\ast$ {\em qstd})}}
\label{QSTD_8c_1337c0a6c12364bc692ff115649e24cb}


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_8c_23ca6f78bfd6ebb27ee1b603e9279a7c}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-destruct@{QSTD\_\-destruct}}
\index{QSTD\_\-destruct@{QSTD\_\-destruct}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-destruct}]{\setlength{\rightskip}{0pt plus 5cm}void QSTD\_\-destruct ({\bf QSTD} $\ast$ {\em qstd})}}
\label{QSTD_8c_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_8c_cd79fa9bf4f5dd288001469afdc0e64f}{
\index{QSTD.c@{QSTD.c}!qstd\_\-file\_\-cache\_\-get@{qstd\_\-file\_\-cache\_\-get}}
\index{qstd\_\-file\_\-cache\_\-get@{qstd\_\-file\_\-cache\_\-get}!QSTD.c@{QSTD.c}}
\subsubsection[{qstd\_\-file\_\-cache\_\-get}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline QFCP\_\-cache $\ast$ qstd\_\-file\_\-cache\_\-get (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_cd79fa9bf4f5dd288001469afdc0e64f}


Returns a pointer to the file cache. 

\begin{Desc}
\item[Returns:]The file cache\end{Desc}
This routine return the handle, creating it if necessary. This not really the right architecture. This needs to be part of a QSS global environment. This can't be accomplished at this time because it would require a backwardly incompatiable change to QSSP\_\-construct. 

References RND\_\-8.

Referenced by QSTD\_\-construct().\hypertarget{QSTD_8c_984a0edf51bebd6197399553623de1a1}{
\index{QSTD.c@{QSTD.c}!qstd\_\-sampleV0\_\-add@{qstd\_\-sampleV0\_\-add}}
\index{qstd\_\-sampleV0\_\-add@{qstd\_\-sampleV0\_\-add}!QSTD.c@{QSTD.c}}
\subsubsection[{qstd\_\-sampleV0\_\-add}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void qstd\_\-sampleV0\_\-add ({\bf QSTD\_\-sampleV0} $\ast$ {\em dst}, \/  const {\bf QSTD\_\-sampleV0} $\ast$ {\em src})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_984a0edf51bebd6197399553623de1a1}


Adds the source sample to the destination sample. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]The destination sample \item[{\em src}]The source sample \end{description}
\end{Desc}


References \_\-QSTD\_\-statisticsV0::cnts, QSSP\_\-spanV0Complete(), QSTD\_\-TYPE\_\-K\_\-CUMULATIVE\_\-END, \_\-QSTD\_\-sampleV0::span, \_\-QSTD\_\-sampleV0::stats, and \_\-QSTD\_\-sampleV0::type.

Referenced by qstd\_\-sampleV0\_\-decode().\hypertarget{QSTD_8c_a402ddb1edde42b2fff986565b508978}{
\index{QSTD.c@{QSTD.c}!qstd\_\-sampleV0\_\-decode@{qstd\_\-sampleV0\_\-decode}}
\index{qstd\_\-sampleV0\_\-decode@{qstd\_\-sampleV0\_\-decode}!QSTD.c@{QSTD.c}}
\subsubsection[{qstd\_\-sampleV0\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline int qstd\_\-sampleV0\_\-decode ({\bf QSTD} $\ast$ {\em qstd}, \/  unsigned int {\em type\_\-id}, \/  unsigned char {\em bridge}, \/  const unsigned int $\ast$ {\em dat})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{QSTD_8c_a402ddb1edde42b2fff986565b508978}


Decodes the statistics data. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em If}]not negative, then the sample type (QSTD\_\-TYPE\_\-K) \item[{\em If}]negative\end{description}
\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qstd}]The QSTD context handle \item[{\em type\_\-id}]0 = just the set of values 1 = the difference between the current and last set \item[{\em bridge}]bit 0 0 = normal record; 1 = global record \item[{\em dat}]The statistics data \end{description}
\end{Desc}


References \_\-QSTD::ctx, \_\-QSTD::cumulative, \_\-QSTD\_\-ctx::current, decode\_\-sampleV0\_\-0(), decode\_\-sampleV0\_\-1(), decode\_\-sampleV0\_\-2(), QSSP\_\-spanV0Complete(), qstd\_\-sampleV0\_\-add(), QSTD\_\-TYPE\_\-K\_\-CUMULATIVE\_\-BEG, QSTD\_\-TYPE\_\-K\_\-INCREMENTAL, \_\-QSTD::sample, \_\-QSTD\_\-sampleV0::span, \_\-QSTD\_\-sampleV0::type, and \_\-QSTD\_\-sample::v0.

Referenced by QSTD\_\-updateAtRecord().\hypertarget{QSTD_8c_7cb7a5fbec0b287d215ea336b2bff698}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-sizeof@{QSTD\_\-sizeof}}
\index{QSTD\_\-sizeof@{QSTD\_\-sizeof}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-sizeof}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-sizeof (void $\ast$ {\em must\_\-be\_\-null})}}
\label{QSTD_8c_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_8c_b7335188cdd5c1cba797b3520bbc3ae4}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-updateAtContribution@{QSTD\_\-updateAtContribution}}
\index{QSTD\_\-updateAtContribution@{QSTD\_\-updateAtContribution}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-updateAtContribution}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-updateAtContribution ({\bf QSTD} $\ast$ {\em qstd}, \/  const LSF\_\-contribution $\ast$ {\em ctb})}}
\label{QSTD_8c_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_8c_2c36550c66e7a835a99cf4ab590b95bf}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-updateAtDatagram@{QSTD\_\-updateAtDatagram}}
\index{QSTD\_\-updateAtDatagram@{QSTD\_\-updateAtDatagram}!QSTD.c@{QSTD.c}}
\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_8c_2c36550c66e7a835a99cf4ab590b95bf}


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_8c_dd3390102cb4d8c800ce7de8dfca5438}{
\index{QSTD.c@{QSTD.c}!QSTD\_\-updateAtRecord@{QSTD\_\-updateAtRecord}}
\index{QSTD\_\-updateAtRecord@{QSTD\_\-updateAtRecord}!QSTD.c@{QSTD.c}}
\subsubsection[{QSTD\_\-updateAtRecord}]{\setlength{\rightskip}{0pt plus 5cm}int QSTD\_\-updateAtRecord ({\bf QSTD} $\ast$ {\em qstd}, \/  const LSF\_\-record $\ast$ {\em rec})}}
\label{QSTD_8c_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.