ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbOBJ.hpp
Go to the documentation of this file.
1
8#ifndef ngcbOBJ_H
9#define ngcbOBJ_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <ngc/core/ngcb.h>
19
23#define ngcbMOD_ERR BailOut(NGCB_CODE_POS)
24
29extern char *ngcbOBJ_MAJOR;
30
34class ngcbOBJ {
35public:
37 FILE *watchdog;
38
41
44
47
50
52 int xterm;
53
56
59
61 int type;
62
64 ngcbOBJ();
65
67 virtual ~ngcbOBJ();
68
70 void Instance(int n);
71
73 int Instance();
74
76 const char *Major();
77
79 int BigEndian();
80
82 int LittleEndian();
83
85 virtual char *ErrMsg();
86
88 virtual int Success();
89
91 virtual int Failure();
92
94 void CfgPath(const char *path);
95
96protected:
98 virtual int BailOut(const char *pos);
99
101 virtual void Verbose(int level, const char *format, ...)
102 __attribute__ ((format(printf, 3, 4)));
103
105 virtual void Verbose(const char *format, ...)
106 __attribute__ ((format(printf, 2, 3)));
107
109 virtual void Log(int level, const char *format, ...)
110 __attribute__ ((format(printf, 3, 4)));
111
113 virtual void Log(const char *format, ...)
114 __attribute__ ((format(printf, 2, 3)));
115
117 virtual void ErrLog(int severity, const char *format, ...)
118 __attribute__ ((format(printf, 3, 4)));
119
121 void FeedBack(const char *format, ...)
122 __attribute__ ((format(printf, 2, 3)));
123
125 virtual void SendFeedBack(const char *msg);
126
128 const char *CfgPath();
129
131 int CfgPath(char *path, const char *cfgFile);
132
134 int KeyVal(const char *key, float *value);
135
137 int KeyVal(const char *key, double *value);
138
140 int KeyVal(const char *key, int *value);
141
143 int KeyVal(const char *key, unsigned int *value);
144
146 int KeyValHex(const char *key, int *value);
147
149 int KeyValHex(const char *key, unsigned int *value);
150
152 int KeyValFmt(const char *key, int *value);
153
155 int KeyValFmt(const char *key, unsigned int *value);
156
158 int KeyValFrac(const char *key, unsigned int n, uint64_t *v1, uint64_t *v2);
159
161 void CleanupCmd(char *cmdLine, int *cmdLen);
162
164 int ReplaceParam(char *string);
165
166private:
168 char erms_[256];
169
171 int instance_;
172
174 char major_[64];
175
177 int endian_;
178
180 char path_[256];
181};
182
183#endif
Definition ngcbALARM.hpp:61
virtual void virtual void virtual void Log(int level, const char *format,...) __attribute__((format(printf
Log message if logging level exceeds level.
Definition ngcbOBJ.cpp:146
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:68
int KeyValFrac(const char *key, unsigned int n, uint64_t *v1, uint64_t *v2)
Fraction after n digits.
Definition ngcbOBJ.cpp:263
virtual void virtual void virtual void virtual void virtual void void virtual void SendFeedBack(const char *msg)
Feed-back sender implementation.
Definition ngcbOBJ.cpp:218
void CfgPath(const char *path)
Set external configuration path.
Definition ngcbOBJ.cpp:269
int verboseLevel
Verbose level.
Definition ngcbOBJ.hpp:46
ngcbALARM_SYS * alarmSystem
Alarm system.
Definition ngcbOBJ.hpp:40
virtual void virtual void virtual void virtual void virtual void void FeedBack(const char *format,...) __attribute__((format(printf
Feed-back function.
Definition ngcbOBJ.cpp:206
void CleanupCmd(char *cmdLine, int *cmdLen)
Clean command string (remove extra spaces etc.)
Definition ngcbOBJ.cpp:336
int KeyVal(const char *key, float *value)
Get single precision floating point value from keyword string.
Definition ngcbOBJ.cpp:223
int ignoreErr
Ignore next error (do not log)
Definition ngcbOBJ.hpp:58
virtual ~ngcbOBJ()
Destructor.
Definition ngcbOBJ.cpp:54
int BigEndian()
Big-endian architecture.
Definition ngcbOBJ.cpp:62
int LittleEndian()
Little-endian architecture.
Definition ngcbOBJ.cpp:64
FILE * watchdog
Watchdog stream.
Definition ngcbOBJ.hpp:37
int KeyValHex(const char *key, int *value)
Get 32-bit signed integer value from hexadecimal keyword string.
Definition ngcbOBJ.cpp:243
int logLevel
Logging level.
Definition ngcbOBJ.hpp:49
int type
Object type.
Definition ngcbOBJ.hpp:61
virtual int BailOut(const char *pos)
Log code position of the error and bail-out with failure.
Definition ngcbOBJ.cpp:72
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:35
int xterm
Xterm flag.
Definition ngcbOBJ.hpp:52
int Instance()
Get instance.
Definition ngcbOBJ.cpp:58
int ReplaceParam(char *string)
Replace parameter in string.
Definition ngcbOBJ.cpp:379
int KeyValFmt(const char *key, int *value)
Get 32-bit signed integer value from string.
Definition ngcbOBJ.cpp:253
virtual void Verbose(int level, const char *format,...) __attribute__((format(printf
Verbose message if verbose level exceeds level.
Definition ngcbOBJ.cpp:74
virtual int Failure()
Return failure.
Definition ngcbOBJ.cpp:70
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:66
const char * Major()
Instance major number.
Definition ngcbOBJ.cpp:60
int debugPort
Debug port.
Definition ngcbOBJ.hpp:55
ngcbSERVICE * services
System services.
Definition ngcbOBJ.hpp:43
virtual void virtual void virtual void virtual void virtual void ErrLog(int severity, const char *format,...) __attribute__((format(printf
Error log, severity is one of ngcbWARNING, ngcbFAILURE and ngcbERR_SEVERE.
Definition ngcbOBJ.cpp:187
const char * CfgPath()
Get external configuration path.
Definition ngcbOBJ.cpp:273
Definition ngcbSERVICE.hpp:36
char * ngcbOBJ_MAJOR
Definition ngcbOBJ.cpp:33