Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

tcsmon.h

Go to the documentation of this file.
00001 #ifndef TCSMON_H
00002 #define TCSMON_H
00003 /****************************************************************************
00004 * E.S.O. - VLT project
00005 *
00006 * "@(#) $Id: tcsmon.h,v 2.38 2003/07/12 21:26:14 vltsccm Exp $"
00007 *
00008 * who       when      what
00009 * --------  --------  -----------------------------------------------------
00010 * rkarban   14/05/97  created
00011 */
00012 
00013 /****************************************************************************
00014  * Common service routines.
00015  *---------------------------------------------------------------------------
00016  */
00017 
00018 #ifndef __cplusplus
00019 #error This is a C++ include file and cannot be used from plain C
00020 #endif
00021 
00022 #include <ECCS.h>
00023 #include <eccsTestTools.h>
00024 #include <fndOBJECT.h>
00025 #include <fndSTRING.h>
00026 #include <evhCALLBACK.h>
00027 #include <evhTASK.h>
00028 #include <eccsDB_ATTR.h>
00029 
00030 #include "tcsmonDefines.h"
00031 #include "tcsmonErrors.h"
00032 
00033 /*
00034  * Macros to read from and write to the database
00035  */
00036 #define DB_READ(var,type,attrName)                                   \
00037   {                                                            \
00038         eccsDB_##type attrName##Attr(dbPoint, attrName);             \
00039   var = attrName##Attr;                                        \
00040   if (attrName##Attr.ErrStatus() == FAILURE)                   \
00041             {                                                        \
00042             ErrAdd(tcsmonMOD, tcsmonERR_DB_READ, __FILE_LINE__,        \
00043                    "configuration parameter", dbPoint, attrName);    \
00044             return FAILURE;                                          \
00045             }                                                        \
00046       }
00047 
00048 #define DB_READ_STRING(var,attrName)                                 \
00049   {                                                            \
00050         eccsDB_STRING attrName##Attr(dbPoint, attrName);             \
00051   strcpy(var, (const char *)attrName##Attr);                   \
00052   if (attrName##Attr.ErrStatus() == FAILURE)                   \
00053             {                                                        \
00054             ErrAdd(tcsmonMOD, tcsmonERR_DB_READ, __FILE_LINE__,        \
00055                    "configuration parameter", dbPoint, attrName);    \
00056             return FAILURE;                                          \
00057             }                                                        \
00058       }
00059 
00060 #define DB_WRITE(value,type,attrName)                                \
00061   {                                                            \
00062         eccsDB_##type attrName##Attr(dbPoint, attrName);             \
00063   attrName##Attr = value;                                      \
00064   if (attrName##Attr.ErrStatus() == FAILURE)                   \
00065             {                                                        \
00066             ErrAdd(tcsmonMOD, tcsmonERR_DB_WRITE, __FILE_LINE__,       \
00067                    "status parameter", dbPoint, attrName);           \
00068             return FAILURE;                                          \
00069             }                                                        \
00070       }
00071 
00072 
00073 /* 
00074  * Prototypes
00075  */
00076 vltLOGICAL tcsmonObjectOk(eccsERROR_CLASS *object, const char *name);
00077 
00078 #endif // !TCSMON_H

Generated on Wed Dec 3 14:52:21 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001