GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > QSSP / V1-0-0

Constituent: qssp     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

QSTD.c File Reference

Decodes the Science Statistics (Physics) for the handlers. More...

#include "QSSP/QSTD.h"
#include "QSSP/QSSP_span.h"
#include "QSSP/QSTD_labels.h"
#include "QSTD_pvtdefs.h"
#include "dprintf.h"
#include "QSP/QFCP_cache.h"
#include "QSD/QFR_file.h"
#include "QSD/QFC_member.h"
#include "EFC/EFS_ids.h"
#include "LSF/LSF.h"
#include "LSF/LSF_scan.h"
#include "LSF/LSF_reason.h"
#include "LDT/BFU.h"
#include <string.h>
#include <stdlib.h>

Include dependency graph for QSTD.c:


Defines

#define RND_8(_v)   ((_v + 7) & ~0x7)

Typedefs

typedef const unsigned int *(* DecodeSampleV0 )(QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge)
 Signature to decode a statistics sample from the input data.

Functions

static __inline QFCP_cache * qstd_file_cache_get (void)
 Returns a pointer to the file cache.
static const unsigned int * decode_statsV0_norm (QSTD *qstd, QSTD_statisticsV0 *stats, const unsigned int *dat, unsigned char bridge)
 Decodes a normal (not differenced) statistics record.
static const unsigned int * decode_statsV0_diff (QSTD *qstd, QSTD_statisticsV0 *stats, const unsigned int *dat, unsigned char bridge)
 Decodes the statistics in difference format.
static const unsigned int * decode_sampleV0_0 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge)
 Decodes a format 0 sample record.
static const unsigned int * decode_sampleV0_1 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge)
 Decodes a format 1 sample record.
static const unsigned int * decode_sampleV0_2 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge)
 Decodes a format 2 sample record.
QSTDQSTD_alloc (void *must_be_null)
 Allocates and constructs a QSTD handle.
QSTDQSTD_construct (QSTD *qstd, void *must_be_null)
 The constructor for a QSTD control structure.
void QSTD_destruct (QSTD *qstd)
 The destructor for a QSTD control structure.
const QSTD_ctxQSTD_ctxGet (const QSTD *qstd)
 Locates the statistics context (meta-data).
int QSTD_sizeof (void *must_be_null)
 Returns the size, in bytes, of a QSTD control structure.
const LSF_contribution * QSTD_updateAtDatagram (QSTD *qstd, const LSF_datagram *dgm)
 Updates the context at datagram time.
int QSTD_updateAtContribution (QSTD *qstd, const LSF_contribution *ctb)
 Updates the context at datagram time.
static __inline void qstd_sampleV0_add (QSTD_sampleV0 *dst, const QSTD_sampleV0 *src)
 Adds the source sample to the destination sample.
static __inline int qstd_sampleV0_decode (QSTD *qstd, unsigned int type_id, unsigned char bridge, const unsigned int *dat)
 Decodes the statistics data.
int QSTD_updateAtRecord (QSTD *qstd, const LSF_record *rec)
 Updates the context at record time.

Detailed Description

Decodes the Science Statistics (Physics) for the handlers.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: QSTD.c,v 1.1 2008/06/10 22:25:45 russell Exp $

Typedef Documentation

const unsigned int *(* DecodeSampleV0)(QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge)
 

Signature to decode a statistics sample from the input data.

Returns:
The next decode location
Parameters:
qstd The QSTD context handle
sample The structure to receive the decoded data from
dat The input data
bridge The bridge word, contains decoding options


Function Documentation

static const unsigned int * decode_sampleV0_0 QSTD qstd,
QSTD_sampleV0 sample,
const unsigned int *  dat,
unsigned char  bridge
[static]
 

Decodes a format 0 sample record.

Returns:
The next address to decode from
Parameters:
qstd The decoding context
sample The data structure to receive the decoded statistics
dat The statistics data
bridge The record's bridge word

static const unsigned int * decode_sampleV0_1 QSTD qstd,
QSTD_sampleV0 sample,
const unsigned int *  dat,
unsigned char  bridge
[static]
 

Decodes a format 1 sample record.

Returns:
The next address to decode from
Parameters:
qstd The decoding context
sample The data structure to receive the decoded statistics
dat The statistics data
bridge The record's bridge word

static const unsigned int * decode_sampleV0_2 QSTD qstd,
QSTD_sampleV0 sample,
const unsigned int *  dat,
unsigned char  bridge
[static]
 

Decodes a format 2 sample record.

Returns:
The next address to decode from
Parameters:
qstd The decoding context
sample The data structure to receive the decoded statistics
dat The statistics data
bridge The record's bridge word

static const unsigned int * decode_statsV0_diff QSTD qstd,
QSTD_statisticsV0 stats,
const unsigned int *  dat,
unsigned char  bridge
[static]
 

Decodes the statistics in difference format.

Returns:
The next address to decode from
Parameters:
qstd The decoding context
stats The data structure to receive the decoded statistics
dat The statistics data
bridge The record's bridge word

static const unsigned int * decode_statsV0_norm QSTD qstd,
QSTD_statisticsV0 stats,
const unsigned int *  dat,
unsigned char  bridge
[static]
 

Decodes a normal (not differenced) statistics record.

Returns:
The next address to decode from
Parameters:
qstd The decoding context
stats The data structure to receive the decoded statistics
dat The statistics data
bridge The record's bridge word

QSTD * QSTD_alloc void *  must_be_null  ) 
 

Allocates and constructs a QSTD handle.

Returns:
Pointer to the allocated handle
Parameters:
must_be_null Reserved for future use.

QSTD * QSTD_construct QSTD qstd,
void *  must_be_null
 

The constructor for a QSTD control structure.

Returns:
Pointer to the QSTD control structure
Parameters:
qstd The control structure to be constructed. If NULL, a control structure will be allocated
must_be_null Reserved for future use.

const QSTD_ctx * QSTD_ctxGet const QSTD qstd  ) 
 

Locates the statistics context (meta-data).

Parameters:
qstd The statistics context

void QSTD_destruct QSTD qstd  ) 
 

The destructor for a QSTD control structure.

Returns:
Pointer to the QSS control structure
Parameters:
qstd The control structure to be destructed.

static __inline QFCP_cache * qstd_file_cache_get void   )  [static]
 

Returns a pointer to the file cache.

Returns:
The file cache
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.

static __inline void qstd_sampleV0_add QSTD_sampleV0 dst,
const QSTD_sampleV0 src
[static]
 

Adds the source sample to the destination sample.

Parameters:
dst The destination sample
src The source sample

static __inline int qstd_sampleV0_decode QSTD qstd,
unsigned int  type_id,
unsigned char  bridge,
const unsigned int *  dat
[static]
 

Decodes the statistics data.

Return values:
If not negative, then the sample type (QSTD_TYPE_K)
If negative
Parameters:
qstd The QSTD context handle
type_id 0 = just the set of values 1 = the difference between the current and last set
bridge bit 0 0 = normal record; 1 = global record
dat The statistics data

int QSTD_sizeof void *  must_be_null  ) 
 

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

Returns:
The size, in bytes, of a QSTD control structure
Parameters:
must_be_null Parameter reserved for future use

int QSTD_updateAtContribution QSTD qstd,
const LSF_contribution *  ctb
 

Updates the context at datagram time.

Return values:
If have a statistics sample contribution, the number of records in the contribution.
>0,if have a record contributor
=0,if have the contribution context
-1,if unrecognized
Parameters:
qstd The statistics context to update.
ctb The statistics contribution

const LSF_contribution * QSTD_updateAtDatagram QSTD qstd,
const LSF_datagram *  dgm
 

Updates the context at datagram time.

Returns:
The contribution to resume processsing at
Parameters:
qstd The statistics context to update.
dgm The statistics datagram

int QSTD_updateAtRecord QSTD qstd,
const LSF_record *  rec
 

Updates the context at record time.

Return values:
Non-negative values indicate are one of the QSTD_type's
Negative values indicate an unsuccessful update
Parameters:
qstd The statistics context to update.
rec The statistics record


Generated on Thu Jun 12 02:29:00 2008 by  doxygen 1.4.4