GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSE / V2-2-0
Constituent: qsedgm     Tag: sun-gcc
Typedefs | |
typedef struct _LSF_datagram | LSF_datagram |
Functions | |
int | QSE_dgmEventSkip (const LSF_datagram *dgm, int nskip, int *nctb, int *nrec) |
Counts the skip count down by the number of events in this datagram, but stops if the number of events is greater than nskip. |
CVS $Id: QSE_dgmEventSkip.h,v 1.1 2008/09/19 22:00:50 russell Exp $
int QSE_dgmEventSkip | ( | const LSF_datagram * | dgm, | |
int | nskip, | |||
int * | nctb, | |||
int * | nrec | |||
) |
Counts the skip count down by the number of events in this datagram, but stops if the number of events is greater than nskip.
dgm | The datagram to examine | |
nskip | The number of events to skip. | |
nctb | A returned value (may be NULL)
| |
nrec | A returned value (may be NULL)
|
int nskip = ctl->nskip; / * Check if there are events to skip * / if (nskip > 0) { / * | If there are no events left to skip, nskip will be | returned as 0 and ctl->nctb and ctl->nevent will be | set to the the number of event contributors and the | number of events to skip within that contributor | before the target event is reached. / nskip = QSE_eventsSkip (dgm, nskip, &ctl->nctb, &ctl->nevent); / * If have not reached the skip count yet...* / if (nskip) { / * Skip count not reached yet, update the skip count * / ctl->nskip = nskip; / * | No need to process the contributors in this datagram | continue processing the next datagram / ctb.rtn = NULL; ctb.ctx = (unsigned int)0; return ctb; } } / / Start processing datagrams, one may have page to the / / correct event using the nctb and nrec return values
For example, this might be the first few lines of code in an event record processing routine might look like this...
/ * Always update the context * / status = QSEP_updateAtRecord (qsep, rec); / * Do we need to skip * / nskip = ctl->nleft; if (nskip) { / * Yes, reduce the skip count and continue to the next event * / ctl->nleft = nskip - 1; return 0; } / * The right numbers of events have been skipped, start processing * / ...