GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MDB / V0-0-0

Constituent: mdb     Tag: rad750


Interface   Data Structures   File List   Data Fields   Globals  

MDB_pubdefs.h File Reference

If you wandered in here by accident, you should probably leave now... More...

#include "stdarg.h"
#include "PBS/WCT.h"
#include "MDB/MDB_macdefs.h"

Include dependency graph for MDB_pubdefs.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  _MSG_MsgList
 List of messages used at run time. More...
struct  _MSG_FacList
 List of facilities used at run time. More...

Typedefs

typedef unsigned int MSG_cb_ReportRtn (unsigned int code, WCT_time hack, const char *rtn, unsigned int nprm, va_list list)
 Signature for the MSG reporting routine.
typedef _MSG_MsgList MSG_MsgList
 Typedef for struct _MSG_MsgList.
typedef _MSG_FacList MSG_FacList
 Typedef for struct _MSG_FacList.

Functions

unsigned int MSG_find (unsigned int code, const MSG_FacList **fdb, const MSG_MsgList **mdb)
 Return facility and message database entries corresponding to code.
void MSG_insertFacility (const MSG_FacList *fac)
 Insert a new facility into the store.
void MSG_removeFacility (const MSG_FacList *fac)
 Remove an existing facility from the store.
unsigned int MSG_report (unsigned int code, WCT_time hack, const char *rtn, unsigned int nprm,...)
 Process a message reporting request.
void MSG_setReportRtn (MSG_cb_ReportRtn *rtn)
 Set a new MSG_report() callback routine.

Detailed Description

If you wandered in here by accident, you should probably leave now...

Warning:
MDB_pubdefs.h should NEVER be included by user code
CVS $Id: MDB_pubdefs.h,v 1.1.1.1 2005/07/14 22:44:28 apw Exp $
Author:
A.P.Waite
MDB_pubdefs.h provides the structure definitions and function prototypes for inserting and removing contributions to the message database. If it were possible to make these definitions/entry points completely private to MDB I would do so. Unfortunately, they must be made visible. No user code should ever have occasion to include this file.

Function Documentation

unsigned int MSG_find unsigned int  code,
const MSG_FacList **  fdb,
const MSG_MsgList **  mdb
 

Return facility and message database entries corresponding to code.

Parameters:
code (in ) Message code
fdb (out) Facility descriptor
mdb (out) Message descriptor
Return values:
0 Database entry found
1 Database entry not found
MSG_find() searches for the facility descriptor and message descriptor corresponding to the message code provided as the first argument. If the code cannot be found, both descriptors are returned as NULL pointers (in addition to the return code indicating failure).

void MSG_insertFacility const MSG_FacList fac  ) 
 

Insert a new facility into the store.

Parameters:
fac (in) Pointer to the facility.
Warning:
This routine appears in the constituent interface only to support other packages that wish to automatically insert a message facility into the message facility list. This routine should never be called by application code.
MSG_insertFacility() inserts a facility into the facility search list. This is all very "clever". Message facilities take advantage of the fact that a routine can be declared __attribute__((constructor)) which results in it being run either before the main routine starts up (typical for single-threaded host applications) or immediately after a module is loaded (typical for the multi-threaded VxWorks environment). This technique is really provided for C++ static constructors, but there's no reason not to take advantage of it.

Thus every message facility source file contains a little stub routine declared constructor whose sole function is to call this routine with the address of the facility block.

void MSG_removeFacility const MSG_FacList fac  ) 
 

Remove an existing facility from the store.

Parameters:
fac (in) Pointer to the facility.
Warning:
This routine appears in the constituent interface only to support other packages that wish to automatically remove a message facility from the message facility list. This routine should never be called by application code.
MSG_removeFacility() removes a facility from the facility search list. This is all very "clever". Message facilities take advantage of the fact that a routine can be declared __attribute__((destructor)) which results in it being run either after the main routine completes (typical for single-threaded host applications) or a immediately before a module is unloaded (typical for the multi-threaded VxWorks environment). This technique is really provided for C++ static destructors, but there's no reason not to take advantage of it.

Thus every message facility source file contains a little stub routine declared destructor whose sole function is to call this routine with the address of the facility block.

unsigned int MSG_report unsigned int  code,
WCT_time  hack,
const char *  rtn,
unsigned int  nprm,
  ...
 

Process a message reporting request.

Parameters:
code (in) Message code to be reported
hack (in) Wall clock time to be recorded with the meessage (note 1)
rtn (in) Name of calling routine (note 2)
nprm (in) Number of parameters that follow
Note:
  1. If hack is zero, MSG_report() will supply the current wall clock time.
  2. String must be persistent. Recommended method for the caller to provide this argument: don't call MSG_report() directly, but use the _msg_report() macro, which will provide this argument automatically. If there is some necessity to call MSG_report() directly, please use the compiler provided __func__ macro to fill in the routine name.
Warning:
Under normal circumstances, no-one should be calling this routine directly. It's far more convenient (and usually more accurate) to use the _msg_report() macro provided by the MSG package. See note 2 above for the reason.
Return values:
code Reflection of the first input argument, probably with "reported" bit set
MSG_report() reports a message. This routine allocates a message packet and populates it with a block of standard information (timestamp, CPU, task name, etc.) and the variable information in the variadic arguments following nprm.

The packet is sent to an message task (in the multi-threaded case) where the message is formatted using the formatting string associated with the message code. The message task then calls all output processors in turn to do whatever it is they want to do with the information.

In the single-threaded case, the message processing occurs inline with the MSG_report() call.

void MSG_setReportRtn MSG_cb_ReportRtn rtn  ) 
 

Set a new MSG_report() callback routine.

Parameters:
rtn (in) Pointer to the message reporting routine


Generated on Tue Mar 7 20:58:18 2006 by  doxygen 1.4.4