\hypertarget{QPIG_8h}{
\section{QPIG.h File Reference}
\label{QPIG_8h}\index{QPIG.h@{QPIG.h}}
}
Interface to power state updating routines. 

{\tt \#include \char`\"{}QPIG/state.h\char`\"{}}\par


Include dependency graph for QPIG.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=145pt]{QPIG_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=137pt]{QPIG_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
QPIG $\ast$ \hyperlink{QPIG_8h_a0}{QPIG\_\-alloc} (void)
\begin{CompactList}\small\item\em Allocates and constructs the QPIG handle. \item\end{CompactList}\item 
void \hyperlink{QPIG_8h_a1}{QPIG\_\-update\-At\-Datagram} (QPIG $\ast$qpig, const LSF\_\-datagram $\ast$dgm)
\begin{CompactList}\small\item\em Updates the run oriented information in the event context using the information from the event datagram. \item\end{CompactList}\item 
void \hyperlink{QPIG_8h_a2}{QPIG\_\-update\-At\-Contribution} (QPIG $\ast$qpig, const LSF\_\-contribution $\ast$ctb)
\begin{CompactList}\small\item\em Updates the context based on the contribution. \item\end{CompactList}\item 
void \hyperlink{QPIG_8h_a3}{QPIG\_\-destruct} (QPIG $\ast$qpig)
\begin{CompactList}\small\item\em Destroy the QPIG handle. \item\end{CompactList}\item 
const \hyperlink{structQPIG__state}{QPIG\_\-state} $\ast$ \hyperlink{QPIG_8h_a4}{QPIG\_\-app\-State\-Get} (const QPIG $\ast$qpig)
\begin{CompactList}\small\item\em Return a pointer to the public QPIG application specific context block. \item\end{CompactList}\item 
unsigned int \hyperlink{QPIG_8h_a5}{QPIG\_\-sizeof} (void $\ast$prm)
\begin{CompactList}\small\item\em Returns the size, in bytes, of the handle for updating the standard event meta-information. \item\end{CompactList}\item 
QPIG $\ast$ \hyperlink{QPIG_8h_a6}{QPIG\_\-construct} (QPIG $\ast$qpig, void $\ast$prm)
\begin{CompactList}\small\item\em Construct (initializes) the handle for updating the standard event meta-information. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to power state updating routines. 

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


\footnotesize\begin{verbatim}   CVS $Id: QPIG.h,v 1.1.1.1 2005/12/06 23:37:35 jswain Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{QPIG_8h_a0}{
\index{QPIG.h@{QPIG.h}!QPIG_alloc@{QPIG\_\-alloc}}
\index{QPIG_alloc@{QPIG\_\-alloc}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-alloc]{\setlength{\rightskip}{0pt plus 5cm}QPIG$\ast$ QPIG\_\-alloc (void)}}
\label{QPIG_8h_a0}


Allocates and constructs the QPIG handle. 

\begin{Desc}
\item[Returns:]A pointer to the allocated and constructed QPIG handle\end{Desc}
\hypertarget{QPIG_8h_a4}{
\index{QPIG.h@{QPIG.h}!QPIG_appStateGet@{QPIG\_\-appStateGet}}
\index{QPIG_appStateGet@{QPIG\_\-appStateGet}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-appStateGet]{\setlength{\rightskip}{0pt plus 5cm}const \hyperlink{structQPIG__state}{QPIG\_\-state}$\ast$ QPIG\_\-app\-State\-Get (const QPIG $\ast$ {\em qpig})}}
\label{QPIG_8h_a4}


Return a pointer to the public QPIG application specific context block. 

\begin{Desc}
\item[Returns:]A pointer to the QPIG application specific context block\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qpig}]The calibration event handle\end{description}
\end{Desc}
\begin{Desc}
\item[]This routine is just an accessor to keep the structure of QPIG private.\end{Desc}
\hypertarget{QPIG_8h_a6}{
\index{QPIG.h@{QPIG.h}!QPIG_construct@{QPIG\_\-construct}}
\index{QPIG_construct@{QPIG\_\-construct}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-construct]{\setlength{\rightskip}{0pt plus 5cm}QPIG$\ast$ QPIG\_\-construct (QPIG $\ast$ {\em qpig}, void $\ast$ {\em prm})}}
\label{QPIG_8h_a6}


Construct (initializes) the handle for updating the standard event meta-information. 

\begin{Desc}
\item[Returns:]The QSEP context structure\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qpig}]The handle to initialize, if specified as NULL, one will be allocated \item[{\em prm}]A run-time set parameter used to stylize the configuration\end{description}
\end{Desc}
\hypertarget{QPIG_8h_a3}{
\index{QPIG.h@{QPIG.h}!QPIG_destruct@{QPIG\_\-destruct}}
\index{QPIG_destruct@{QPIG\_\-destruct}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-destruct]{\setlength{\rightskip}{0pt plus 5cm}void QPIG\_\-destruct (QPIG $\ast$ {\em qpig})}}
\label{QPIG_8h_a3}


Destroy the QPIG handle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qpig}]Pointer to the QPIG handle to delete.\end{description}
\end{Desc}
\hypertarget{QPIG_8h_a5}{
\index{QPIG.h@{QPIG.h}!QPIG_sizeof@{QPIG\_\-sizeof}}
\index{QPIG_sizeof@{QPIG\_\-sizeof}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}unsigned int QPIG\_\-sizeof (void $\ast$ {\em prm})}}
\label{QPIG_8h_a5}


Returns the size, in bytes, of the handle for updating the standard event meta-information. 

\begin{Desc}
\item[Returns:]The size, in bytes, of the handle for updating the standard event meta-information\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em prm}]A run-time set parameter used to stylize the configuration\end{description}
\end{Desc}
\hypertarget{QPIG_8h_a2}{
\index{QPIG.h@{QPIG.h}!QPIG_updateAtContribution@{QPIG\_\-updateAtContribution}}
\index{QPIG_updateAtContribution@{QPIG\_\-updateAtContribution}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-updateAtContribution]{\setlength{\rightskip}{0pt plus 5cm}void QPIG\_\-update\-At\-Contribution (QPIG $\ast$ {\em qpig}, const LSF\_\-contribution $\ast$ {\em ctb})}}
\label{QPIG_8h_a2}


Updates the context based on the contribution. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qpig}]The calibration event handle to update \item[{\em ctb}]The contribution\end{description}
\end{Desc}
\hypertarget{QPIG_8h_a1}{
\index{QPIG.h@{QPIG.h}!QPIG_updateAtDatagram@{QPIG\_\-updateAtDatagram}}
\index{QPIG_updateAtDatagram@{QPIG\_\-updateAtDatagram}!QPIG.h@{QPIG.h}}
\subsubsection[QPIG\_\-updateAtDatagram]{\setlength{\rightskip}{0pt plus 5cm}void QPIG\_\-update\-At\-Datagram (QPIG $\ast$ {\em qpig}, const LSF\_\-datagram $\ast$ {\em dgm})}}
\label{QPIG_8h_a1}


Updates the run oriented information in the event context using the information from the event datagram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em qpig}]The calibration event handle \item[{\em dgm}]The event datagram\end{description}
\end{Desc}
\begin{Desc}
\item[Note:]The root contribution is opaque to the caller, so QPIG must handle the contributions within the root. There are two strategies one could use\begin{enumerate}
\item Call LSF\_\-scan\-Contribtions and let it parse through them and invoke a user call back routine\item Do the scan by hand.\end{enumerate}
\end{Desc}
Initially I have opted for strategy \#1, but the second strategy makes detailed error checking easier. For example, if the sequence of the contributions is fixed, it is likely easier to do this when doing the scan by hand.