GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSE / V2-0-3 > lseprint / linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

LSE_ids.h File Reference

LAT Science Data Standard Identifiers. More...

#include "LSF/LSF_ids.h"

Defines

#define LSE_ID(_base_id)   (LSF_ID_K_LSE | (_base_id))
 Creates a LSE id.
#define LSE_ID_CHECK(_field, _value)
#define LSE_ID_CHECK_CNT(_field, _value)

Typedefs

typedef enum _LSE_ID_K LSE_ID_K
 Typedef of enum _LSE_ID_K.
typedef enum
_LSE_ID_EVT_VERSION_K 
LSE_ID_EVT_VERSION_K
 Typedef for enum _LSE_ID_EVT_VERSION_K.

Enumerations

enum  _LSE_ID_K {
  LSE_ID_K_ETX_FULL = LSE_ID(0x0),
  LSE_ID_K_ETX_ABBREVIATED = LSE_ID(0x1),
  LSE_ID_K_TIM_FULL = LSE_ID(0x2),
  LSE_ID_K_TIM_ABBREVIATED = LSE_ID(0x3),
  LSE_ID_K_EVT = LSE_ID(0x4),
  LSE_ID_K_ACTIVE = LSE_ID(0x4),
  LSE_ID_K_ACTIVE_CNT = 0x5,
  LSE_ID_K_RSVD_6 = LSE_ID(0x6),
  LSE_ID_K_RSVD_7 = LSE_ID(0x7),
  LSE_ID_K_RSVD_8 = LSE_ID(0x8),
  LSE_ID_K_RSVD_9 = LSE_ID(0x9),
  LSE_ID_K_RSVD_A = LSE_ID(0xA),
  LSE_ID_K_RSVD_B = LSE_ID(0xB),
  LSE_ID_K_RSVD_C = LSE_ID(0xC),
  LSE_ID_K_RSVD_D = LSE_ID(0xD),
  LSE_ID_K_RSVD_E = LSE_ID(0xE),
  LSE_ID_K_RSVD_F = LSE_ID(0xF),
  LSE_ID_K_CNT = 0x10,
  LSE_ID_K_BASE = LSE_ID(0)
}
 Enumerates the offsets for the standard event contributioins. More...
enum  _LSE_ID_EVT_VERSION_K {
  LSE_ID_EVT_VERSION_K_0 = 0,
  LSE_ID_EVT_VERSION_K_1 = 1,
  LSE_ID_EVT_VERSION_K_2 = 2
}
 Enumerates the event contribution version numbers. More...


Detailed Description

LAT Science Data Standard Identifiers.

Author:
JJRussell - russell@slac.stanford.edu
   CVS $Id: LSE_ids.h,v 1.4 2010/07/26 23:48:36 russell Exp $

All event-oriented datagrams contain a number of standard contributions. To facilitate the writing of routines that consume these standard contributions, a standard numbering scheme of these standard records has been chosen. For example, each event-oriented datagram contains
In order to not violate the spirit of LSF, which states that contribution and record identifiers are scoped local to a datagram or contribution, but to allow standard processing of standard records, it was been decided that each event-oriented datagram reserved a block of 0x10 numbers that are assigned to these standard contributions. The designed is free to base this block anywhere he wishes. This base vaule is communicated to LSEW_dgm during the construction of its handle.
The careful reader may question whether the event ID belongs in this list, since there is certainly no generic software that can process the many forms that an event may be presented in. However, the generic processing routines can at least classify a contribution as being

This tactic, at least, centralizes some of the dispatching
LSE_ID_CHECK
This macro generates a compiler time error if the value of the specified enumeration is not as anticipated. At first glance, this macro would seem to be totally useless. But, in certain cases it is extremely useful. Consider the case where the user wishes to construct a lookup table based on these value. Here one wishes to use the enumerated value as an index into the table. The problem is how does one initialize the table in a robust fashion. While the GCC compilers provide a method of initializing an array by index. This is the correct way to do this. However, this is not standard. All that can be done is to initialize the array in the standard C fashion, listing the elements in order. This macro at least checks that the order coincidences with the current values of the identifiers.

Define Documentation

#define LSE_ID ( _base_id   )     (LSF_ID_K_LSE | (_base_id))

Creates a LSE id.

Returns:
The created ID
Parameters:
_base_id The base id

#define LSE_ID_CHECK ( _field,
_value   ) 

Value:

struct _LSE_ID_CHECK ## _field                                            \
   { char x[1/((LSE_ID_K_ ## _field - LSF_ID_K_LSE) == _value)];}
Parameters:
_field The name of the field value to check, e.g.ETX_FULL, TIM_ABBREVIATED
_value The value the user believes it is
The LSE_ID field is sometimes used to as an index in a lookup table. While GCC provides a method to initialize an array elements by using a specified index, this is not portable, so is not an option.
Example
To check that LSE_ID_K_TIM_FULL has the value 2,
   LSE_ID_CHECK (TIM_FULL, 2)

Due to the fact that there is no official way to generate a user specified compile time error, the macro is constructed such that if the check fails, a structure with a zero length array is generated. The only side effect is to introduce an named but unused structure into the name space.

#define LSE_ID_CHECK_CNT ( _field,
_value   ) 

Value:

struct _LSE_ID_CHECK ## _field                                            \
   { char x[1/(LSE_ID_K_ ## _field == _value)];}
Parameters:
_field The name of the field value to check, e.g ACTIVE_CNT,
_value The value the user believes it is
These are count fields that may be used to index or determine limits.
Example
To check that LSE_ID_K_ACTIVE_CNT has the value 5,
   LSE_ID_CHECK_CNT(ACTIVE_CNT, 5)

Due to the fact that there is no official way to generate a user specified compile time error, the macro is constructed such that if the check fails, a structure with a zero length array is generated. The only side effect is to introduce an named but unused structure into the name space.


Typedef Documentation

LSE_ID_EVT_VERSION_K

Typedef for enum _LSE_ID_EVT_VERSION_K.

There is not much coding value in this enumeration. Its main function is to act as a place to document the event contribution versions.


Enumeration Type Documentation

enum _LSE_ID_EVT_VERSION_K

Enumerates the event contribution version numbers.

Enumerator:
LSE_ID_EVT_VERSION_K_0  This was the original version, but due to a code bug, the number of events contained in the bridge word could overflow the allotted 8-bit bridge word field
LSE_ID_EVT_VERSION_K_1  This version of the event contributor is assured not to overflow the 8-bit event bridge word field
LSE_ID_EVT_VERSION_K_2  This version indicates that the cal prediction model was fixed to avoid < 0 predictions. This is relevant for 4-range 0-suppressee events, such as CNO events

enum _LSE_ID_K

Enumerates the offsets for the standard event contributioins.

Enumerator:
LSE_ID_K_ETX_FULL  ID for LSEP full event context contribution, ie a LSE_etxFull
LSE_ID_K_ETX_ABBREVIATED  ID for LSEP abbreviated event context contribution, ie a LSF_etxAbbreviated
LSE_ID_K_TIM_FULL  ID for LSEP full time contribution, ie a LSE_timFull
LSE_ID_K_TIM_ABBREVIATED  ID for LSEP abbreviated time contribution, ie a LSE_timAbbreviated
LSE_ID_K_EVT  ID for Event contributions
LSE_ID_K_ACTIVE  Last active ID
LSE_ID_K_ACTIVE_CNT  Count of active IDs
LSE_ID_K_RSVD_6  Reserved for future use
LSE_ID_K_RSVD_7  Reserved for future use
LSE_ID_K_RSVD_8  Reserved for future use
LSE_ID_K_RSVD_9  Reserved for future use
LSE_ID_K_RSVD_A  Reserved for future use
LSE_ID_K_RSVD_B  Reserved for future use
LSE_ID_K_RSVD_C  Reserved for future use
LSE_ID_K_RSVD_D  Reserved for future use
LSE_ID_K_RSVD_E  Reserved for future use
LSE_ID_K_RSVD_F  Reserved for future use
LSE_ID_K_CNT  Count of number of such IDs
LSE_ID_K_BASE  The base identifier


Generated on Tue Aug 31 13:13:09 2010 by  doxygen 1.5.3