GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / V4-5-0 > iefc / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

EFR_key.c File Reference

Indirect file reference key utilities. More...

#include <EFC/EFR_key.h>
#include <PBI/Endianness.h>
#include <CAB/CAB_asBuiltPub.h>
#include <CDM/CDM_pubdefs.h>

Classes

struct  _EFR_keyGeneric
 The structure of key of a generic key. More...
struct  _EFR_keyFmx
 The structure of key of an FMX key. More...
struct  _EFR_keyCmx
 The structure of key of type EFR_KEYTYPE_K_CMX. More...
struct  _EFR_key
 Union of all key types. More...

Typedefs

typedef enum _EFR_KEYVAL_K EFR_KEYVAL_K
 Typedef for enum EFR_KEYVAL_K.
typedef struct _EFR_keyGeneric EFR_keyGeneric
 Typedef for struct _EFR_keyGeneric.
typedef struct _EFR_keyFmx EFR_keyFmx
 Typedef for struct _EFR_keyFmx.
typedef struct _EFR_keyCmx EFR_keyCmx
 Typedef for struct _EFR_keyCmx.
typedef union _EFR_key EFR_key
 Typedef for union _EFR_key.

Enumerations

enum  _EFR_KEYVAL_K {
  EFR_KEYVAL_K_UNDEFINED = 0x00ffffff,
  EFR_KEYVAL_K_FMX_UNDEFINED = EFR_KEYVAL_K_UNDEFINED,
  EFR_KEYVAL_K_CMX_UNDEFINED = EFR_KEYVAL_K_UNDEFINED,
  EFR_KEYVAL_K_CMX_UNKNOWN = 0x00fffffe,
  EFR_KEYVAL_K_CMX_DEV = 0x00fffffd,
  EFR_KEYVAL_K_CMX_TEST = 0x00fffffc
}
 Enumerates special key values. More...

Functions

static __inline unsigned int fmxKeyGet (struct _CDM_Database *cdb, unsigned char user)
 Returns the FMX key associated with the file.
static __inline unsigned int cmxKeyGet (struct _CDM_Database *cdb, unsigned char user)
 Returns the CMX key associated with the file.
unsigned int EFR_keyGet (struct _CDM_Database *cdb, unsigned char user)
 Returns the key associated with the file. This may be either an FMX or CMX style key, with the FMX key, if it exists, given the perference.
EFR_KEYTYPE_K EFR_keyTypeGet (unsigned int key)
 Query function to return the encoded key type.
unsigned int EFR_keyUserGet (unsigned int key)
 Query function to return the encoded user field.
EFR_KEYCMX_BRANCH_K EFR_keyCmxBranchGet (unsigned int key)
 Query function to return the branch type.
unsigned int EFR_keyCmxVersionGet (unsigned int key)
 Query function to return the version.
unsigned int EFR_keyFmxKeyGet (unsigned int key)
 Query function to return FMX key value.


Detailed Description

Indirect file reference key utilities.

Author:
JJRussell - russell@slac.stanford.edu

   CVS $Id: EFR_key.c,v 1.3 2011/04/06 00:32:37 russell Exp $

Typedef Documentation

Typedef for struct _EFR_keyFmx.

Note:
Technically an FMX key can only be 22-bits. I have defined the value as 24-bits, not sure if it which is better the 22 or 24 bit definition.


Enumeration Type Documentation

Enumerates special key values.

Enumerator:
EFR_KEYVAL_K_UNDEFINED  Key is undefined
EFR_KEYVAL_K_FMX_UNDEFINED  FMX key is undefined
EFR_KEYVAL_K_CMX_UNDEFINED  CMX tag is undefined
EFR_KEYVAL_K_CMX_UNKNOWN  CMX tag is not from any known branch
EFR_KEYVAL_K_CMX_DEV  CMX tag is from the development branch
EFR_KEYVAL_K_CMX_TEST  CMX tag is from a user test branch, translation in this case may be a bit dicey, since the user test branch stem is not captured


Function Documentation

static __inline unsigned int cmxKeyGet ( struct _CDM_Database *  cdb,
unsigned char  user 
) [static]

Returns the CMX key associated with the file.

Returns:
The CMX key. The value field of the key should be check to see if the key was resolved.
Parameters:
cdb The CMX database to query for the key
user A small integer (typically less than 31, that will be associated with the key. This is meant to help resolves files of similar types that may reside in different directories

References _EFR_key::cmx, EFR_KEYTYPE_K_CMX, EFR_KEYVAL_K_CMX_DEV, EFR_KEYVAL_K_CMX_TEST, EFR_KEYVAL_K_CMX_UNDEFINED, EFR_KEYVAL_K_CMX_UNKNOWN, _EFR_key::gen, and _EFR_key::ui.

Referenced by EFR_keyGet().

EFR_KEYCMX_BRANCH_K EFR_keyCmxBranchGet ( unsigned int  key  ) 

unsigned int EFR_keyCmxVersionGet ( unsigned int  key  ) 

Query function to return the version.

Returns:
The packed version number
Parameters:
key The key to query
Warning:
This function is valid if and only this is a CMX key from the production branch. It is the user responsibility to verify this before calling this function.

References _EFR_key::gen, and _EFR_key::ui.

unsigned int EFR_keyFmxKeyGet ( unsigned int  key  ) 

Query function to return FMX key value.

Returns:
The FMX key value
Parameters:
key The key to query
Warning:
This function is valid if and only this is a FMX key. It is the user responsibility to verify this before calling this function.

References _EFR_key::fmx, and _EFR_key::ui.

unsigned int EFR_keyGet ( struct _CDM_Database *  cdb,
unsigned char  user 
)

Returns the key associated with the file. This may be either an FMX or CMX style key, with the FMX key, if it exists, given the perference.

Returns:
The key
Parameters:
cdb The CMX database to query for the key
user A small integer (typically less than 31, that will be associated with the key. This is meant to help resolves files of similar types that may reside in different directories

References cmxKeyGet(), EFR_KEYVAL_K_UNDEFINED, fmxKeyGet(), _EFR_key::gen, and _EFR_key::ui.

Referenced by construct_efc().

EFR_KEYTYPE_K EFR_keyTypeGet ( unsigned int  key  ) 

Query function to return the encoded key type.

Return values:
EFR_KEYTYPE_K_FMX 
EFR_KEYTYPE_K_CMX 
Parameters:
key The key to query

References EFR_KEYTYPE_K_NONE, _EFR_key::gen, and _EFR_key::ui.

unsigned int EFR_keyUserGet ( unsigned int  key  ) 

Query function to return the encoded user field.

Returns:
The user user field
Parameters:
key The key to query
Warning:
This function assumes the user has checked the check type for being valid, i.e. not EFR_KEYTYPE_K_NONE.

References _EFR_key::gen, and _EFR_key::ui.

static __inline unsigned int fmxKeyGet ( struct _CDM_Database *  cdb,
unsigned char  user 
) [static]

Returns the FMX key associated with the file.

Returns:
The FMX key or EFR_KEYVLA_K_UNDEFINED if there is no FMX key
Parameters:
cdb The CMX database to query for the key
user A small integer (typically less than 31, that will be associated with the key. This is meant to help resolves files of similar types that may reside in different directories

References EFR_KEYTYPE_K_FMX, _EFR_key::fmx, and _EFR_key::ui.

Referenced by EFR_keyGet().


Generated on Wed Jan 4 14:13:23 2012 by  doxygen 1.5.8