GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> TCC_DB / V0-0-3 > tcc_db_test / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

TCC_DB_schema.h File Reference

Lays out the common portion of all Tracker Configuration databases. More...


Classes

struct  _TCC_DB_schema
 The Tracker Configuration Schema databases. More...

Typedefs

typedef struct _TCC_DB_schema TCC_DB_schema
 Typedef of struct _TCC_DB_schema.
typedef enum _TCC_DB_K TCC_DB_K
 Typedef for enum _TCC_DB_K.
typedef enum _TCC_DB_TYPE_K TCC_DB_TYPE_K
 Typedef for enum _TCC_DB_TYPE_K.
typedef enum _TCC_DB_TARGET_K TCC_DB_TARGET_K
 Typedef for enum _TCC_DB_TARGET_K.
typedef enum _TCC_DB_SUBSYSTEM_K TCC_DB_SUBSYSTEM_K
 Typedef for enum _TCC_DB_SUBSYSTEM_K.
typedef int(* TCC_DB_fill_splits_cb )(void *prm, int twr, int lyr, int lo, int hi)
typedef int(* TCC_DB_fill_dead_data_cb )(void *prm, int twr, int lyr, int strip, int cnt)
typedef int(* TCC_DB_fill_dead_trigger_cb )(void *prm, int twr, int lyr, int strip, int cnt)
typedef int(* TCC_DB_fill_generic_cb )(void *prm,...)
 Generic fill callback routine. The user should never reference this object. It is here for internal use only.
typedef int(* TCC_DB_construct_rtn )(const TCC_DB_schema *schema, void *prm)
 One time construction/initialization routine,.
typedef unsigned int(* TCC_DB_checksum_rtn )(const TCC_DB_schema *schema)
 Retrieves the checksum. This routine should not be called until after TCC_DB_construct has been called.
typedef int(* TCC_DB_fill_rtn )(const TCC_DB_schema *schema, TCC_DB_TYPE_K type, TCC_DB_fill_generic_cb fill_rtn, void *fill_prm)
 Template of the function used to call the user's fill callback routine.

Enumerations

enum  _TCC_DB_K {
  TCC_DB_K_SCHEMA = 0xaf,
  TCC_DB_K_VERSION = 0
}
 The CDM schema and version number for TCC_DB databases. More...
enum  _TCC_DB_TYPE_K {
  TCC_DB_TYPE_K_SPLITS = 0,
  TCC_DB_TYPE_K_DEAD_DATA = 1,
  TCC_DB_TYPE_K_DEAD_TRIGGER = 2
}
 Enumerates the data types. More...
enum  _TCC_DB_TARGET_K {
  TCC_DB_TARGET_K_ON_ORBIT = 0,
  TCC_DB_TARGET_K_GLEAM = 1,
  TCC_DB_TARGET_K_PRELAUNCH = 2
}
 Enumerates the target system. More...
enum  _TCC_DB_SUBSYSTEM_K {
  TCC_DB_SUBSYSTEM_K_UNDEFINED = 0,
  TCC_DB_SUBSYSTEM_K_ACD = 1,
  TCC_DB_SUBSYSTEM_K_CAL = 2,
  TCC_DB_SUBSYSTEM_K_TKR = 3
}
 Enumerates the subsystem of database (i.e. ACD, CAL, TKR). More...

Functions

static __inline int TCC_DB_construct (const TCC_DB_schema *schema, void *prm)
 One time construction/initialization routine.
static __inline unsigned int TCC_DB_checksum (const TCC_DB_schema *schema)
 Returns the TCC_DB checksum value. This is not valid until TCC_DB_construct has been called.
static __inline TCC_DB_SUBSYSTEM_K TCC_DB_subsystem (const TCC_DB_schema *schema)
 Returns the subsystem. For TCC_DB's this is always TCC_DB_SUBSYSTEM_K_TKR.
static __inline TCC_DB_TARGET_K TCC_DB_target (const TCC_DB_schema *schema)
 Returns the instrument target type. This is one of the enums TCC_DB_TARGET.
static __inline int TCC_DB_fill_splits (const TCC_DB_schema *schema, TCC_DB_fill_splits_cb fill_rtn, void *fill_prm)
 Routine to drive the user fill splits call back routine.
static __inline int TCC_DB_fill_dead_data (const TCC_DB_schema *schema, TCC_DB_fill_dead_data_cb fill_rtn, void *fill_prm)
 Routine to drive the user fill dead data channel callback routine.
static __inline int TCC_DB_fill_dead_trigger (const TCC_DB_schema *schema, TCC_DB_fill_dead_trigger_cb fill_rtn, void *fill_prm)
 Routine to drive the user fill dead trigger channel callback routine.


Detailed Description

Lays out the common portion of all Tracker Configuration databases.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: TCC_DB_schema.h,v 1.1.1.1 2007/02/13 20:53:39 russell Exp $

This package does not in of itself produce any binary code. It is simply a place where definitions common to each instance of tracker configuration database live.

The information contained in here must mirror that of the LATC tracker configuration. If, in the future, it is possible to extract this information directly from the LATC files, then part of the reason for the existence of this package and its children will go away. The reason for the hedge-word part is because the information in this file also supports GLEAM configurations. It is very unlikely that there will every be the equivalent of LATC files for GLEAM, so while the need for this package may diminish, it may be that it never disappears entirely.

Access to the schema should be done solely through the list of the functions provided. The user is discouraged from directly accessing field members. Compliance will at least ensure compile-time compatibility and, in many cases, run-time compatibilty as the database evolves in time. See the Prototypes section for a list of the interface functions.


Typedef Documentation

unsigned int(* TCC_DB_checksum_rtn)(const TCC_DB_schema *schema)

Retrieves the checksum. This routine should not be called until after TCC_DB_construct has been called.

See also:
TCC_DB_checksum.
Returns:
The checksum value
Parameters:
schema The TCC_DB schema.

int(* TCC_DB_construct_rtn)(const TCC_DB_schema *schema, void *prm)

One time construction/initialization routine,.

See also:
TCC_DB_construct.
Return values:
==0,if successful
!=0,if failed
Parameters:
schema The TCC_DB schema
prm This is currently unused and should be specified as NULL It is meant to be a placeholder if, in the future, a need for some sort of construction option should be necessary.

typedef int(* TCC_DB_fill_dead_data_cb)(void *prm, int twr, int lyr, int strip, int cnt)

Return values:
==0,continue calling the user back
!=0,stop calling the user back.
Parameters:
prm User provide context structure. Most likely this is the structure used to receive the dead channel information from the database.
twr The tower number (0-15) of the dead data channel
lyr The layer number (0-35) of the dead data channel
strip The beginning dead strip number.
cnt The number of dead strips beginning at strip.
This routine is calls back the user once for every cluster of dead data channel strips.

typedef int(* TCC_DB_fill_dead_trigger_cb)(void *prm, int twr, int lyr, int strip, int cnt)

Return values:
==0,continue calling the user back
!=0,stop calling the user back.
Parameters:
prm User provide context structure. Most likely this is the structure used to receive the dead channel information from the database.
twr The tower number (0-15) of the dead trigger channel
lyr The layer number (0-35) of the dead trigger channel
strip The beginning dead strip number.
cnt The number of dead strips beginning at strip.
This routine is calls back the user once for every cluster of dead trigger channel strips.

int(* TCC_DB_fill_generic_cb)(void *prm,...)

Generic fill callback routine. The user should never reference this object. It is here for internal use only.

Return values:
==0,continue calling the user back
!=0,stop calling the user back.
Parameters:
prm Arbitrary user parameter followed by fill specific arguments

typedef int(* TCC_DB_fill_rtn)(TCC_DB_schema *schema, TCC_DB_OBJ_TYPE_K type, TCC_DB_fill fill_rtn, void *fill_prm)

Template of the function used to call the user's fill callback routine.

Returns:
The status code returned by the user's callback routine.
Parameters:
schema The TCC_DB schema
type The type of fill routine to callback
user_fill The user's fill callback routine
user_prm The user's fill callback routine's parameter
The interface to TCC DB schema is extremely abstract. The data is accessed only by self-extraction routine. The address of this self-extraction is essentially the only public information exported by the TCC_DB schema. This completely hides the organization of the information contained in the database, allowing it to be optimized for transport rather than ease of user access. This is the template of the self-extracting routine.

typedef int(* TCC_DB_fill_splits_cb)(void *prm, int twr, int lyr, int lo, int hi)

Return values:
==0,continue calling the user back
!=0,stop calling the user back.
Parameters:
prm User provide context structure. Most likely this is the structure used to receive the split point information from the database.
twr The tower number (0-15) of the split point
lyr The layer number (0-35) of the split point
lo The number of GTFEs readout by the low-side controller
hi The number of GTFEs readout by the high-side controller
This routine may call the user back more than once for each layer of each tower. In this case, the rule is last call wins. This allows the specification to include a default setting followed by a list of exceptions.

Typedef for enum _TCC_DB_K.

Note:
This is schema is used by the various types of Track Configuration databases, for example the Tracker Configuration database for the actual LAT (TCP_DB) and the Tracker Configuration database for GLEAM (TCG_DB).

Typedef of struct _TCC_DB_schema.

The information exposed here is kept to the bare minimum. In order to maintain flexibility on how the data is organized and stored, access to the information is only via the fill callback routine. The user's interface for any given type of data is fixed. It is the responsibility of this database schema to implement this routine so obey that interface, independent of how the data is internally organized.

This is not meant to be a particularly efficient interface, but it should provide good insulation against change.

In order to shield the user from the small remaining details, access routines are provided these are

  • TCC_DB_fill_splits
  • TCC_DB_fill_dead_data
  • TCC_DB_fill_dead_trigger

These routines are exported as inlines, keeping in the philosophy that TCC_DB exports no compiled object code. The routines themselves are quite simple, but insulate the user from directly accessing field members of the schema and containing various ugly casts in this code rather than in user code.

Typedef for enum _TCC_DB_SUBSYSTEM_K.

Note:
This is seemingly a bizarre enumeration, since this only has to do with the TKR. However, there is a concept of a universal subsystem number, unfortunately there was never a happy home for it. This is here to remind one that the TKR subsystem number is fixed at 3.

Typedef for enum _TCC_DB_TARGET_K.

In general, different Track Configuration data bases should be kept in different packages. The reasoning is, simple, the configuration is unique to that target.

Typedef for enum _TCC_DB_TYPE_K.

Currently there are three types of data blocks.

  • List of layer split points
  • List of dead data channels
  • List of dead trigger channels


Enumeration Type Documentation

enum _TCC_DB_K

The CDM schema and version number for TCC_DB databases.

Enumerator:
TCC_DB_K_SCHEMA  Schema number
TCC_DB_K_VERSION  Version number

Enumerates the subsystem of database (i.e. ACD, CAL, TKR).

Enumerator:
TCC_DB_SUBSYSTEM_K_UNDEFINED  Subsystem is undefined
TCC_DB_SUBSYSTEM_K_ACD  Subsystem is the ACD
TCC_DB_SUBSYSTEM_K_CAL  Subsystem is the CAL
TCC_DB_SUBSYSTEM_K_TKR  Subsystem is the TKR

Enumerates the target system.

Enumerator:
TCC_DB_TARGET_K_ON_ORBIT  Target is ON ORBIT calibrations
TCC_DB_TARGET_K_GLEAM  Target is GLEAM Monte Carlo
TCC_DB_TARGET_K_PRELAUNCH  Target is PRELAUNCH calibrations

Enumerates the data types.

Enumerator:
TCC_DB_TYPE_K_SPLITS  Layer split points
TCC_DB_TYPE_K_DEAD_DATA  Dead data channels
TCC_DB_TYPE_K_DEAD_TRIGGER  Dead trigger channels


Function Documentation

static __inline unsigned int TCC_DB_checksum ( const TCC_DB_schema schema  )  [static]

Returns the TCC_DB checksum value. This is not valid until TCC_DB_construct has been called.

Returns:
The checksum
Parameters:
schema The TCC_DB schema

References _TCC_DB_schema::checksum.

static __inline int TCC_DB_construct ( const TCC_DB_schema schema,
void *  prm 
) [static]

One time construction/initialization routine.

Return values:
==0,if successful
!=0,if failed
Parameters:
schema The TCC_DB schema
prm This is currently unused and should be specified as NULL It is meant to be a placeholder if, in the future, a need for some sort of construction option should be necessary.

References _TCC_DB_schema::construct.

static __inline int TCC_DB_fill_dead_data ( const TCC_DB_schema schema,
TCC_DB_fill_dead_data_cb  fill_rtn,
void *  fill_prm 
) [static]

Routine to drive the user fill dead data channel callback routine.

Returns:
Whatever the user callback function returned
Parameters:
schema The database schema
fill_rtn The user provided dead data channel fill callback routine
fill_prm Arbitrary parameter passed to the fill_rtn

References _TCC_DB_schema::fill, and TCC_DB_TYPE_K_DEAD_DATA.

static __inline int TCC_DB_fill_dead_trigger ( const TCC_DB_schema schema,
TCC_DB_fill_dead_trigger_cb  fill_rtn,
void *  fill_prm 
) [static]

Routine to drive the user fill dead trigger channel callback routine.

Returns:
Whatever the user callback function returned
Parameters:
schema The database schema
fill_rtn The user provided dead trigger channel fill callback routine
fill_prm Arbitrary parameter passed to the fill_rtn

References _TCC_DB_schema::fill, and TCC_DB_TYPE_K_DEAD_TRIGGER.

static __inline int TCC_DB_fill_splits ( const TCC_DB_schema schema,
TCC_DB_fill_splits_cb  fill_rtn,
void *  fill_prm 
) [static]

Routine to drive the user fill splits call back routine.

Returns:
Whatever the user callback function returned
Parameters:
schema The database schema
fill_rtn The user provided split fill callback routine
fill_prm Arbitrary parameter passed to the fill_rtn

References _TCC_DB_schema::fill, and TCC_DB_TYPE_K_SPLITS.

static __inline TCC_DB_SUBSYSTEM_K TCC_DB_subsystem ( const TCC_DB_schema schema  )  [static]

Returns the subsystem. For TCC_DB's this is always TCC_DB_SUBSYSTEM_K_TKR.

Returns:
The subsystem, TCC_DB_SUBSYSTEM_K_TKR
Parameters:
schema The TCC_DB schema
At first glance this function seems useless, but, if I ever get around to formalizing the interface to a class of databases, this will be one of the standard query functions.

The user is encourage to use this function rather than directly accessing the database.

References _TCC_DB_schema::subsystem.

static __inline TCC_DB_TARGET_K TCC_DB_target ( const TCC_DB_schema schema  )  [static]

Returns the instrument target type. This is one of the enums TCC_DB_TARGET.

Returns:
The instrument target type
Parameters:
schema The TCC_DB schema
The user is encourage to use this function rather than directly accessing the database.

References _TCC_DB_schema::target.


Generated on Tue Nov 29 16:58:24 2011 by  doxygen 1.5.8