ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcbOBJ.hpp
Go to the documentation of this file.
1
7#ifndef ngcbOBJ_H
8#define ngcbOBJ_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <ngc/core/ngcb.h>
18
22#define ngcbMOD_ERR BailOut(NGCB_CODE_POS)
23
28extern char *ngcbOBJ_MAJOR;
29
33class ngcbOBJ {
34public:
36 FILE *watchdog;
37
40
43
46
49
51 int xterm;
52
55
58
60 int type;
61
63 ngcbOBJ();
64
66 virtual ~ngcbOBJ();
67
69 void Instance(int n);
70
72 int Instance();
73
75 const char *Major();
76
78 int BigEndian();
79
81 int LittleEndian();
82
84 virtual char *ErrMsg();
85
87 virtual int Success();
88
90 virtual int Failure();
91
93 void CfgPath(const char *path);
94
95protected:
97 virtual int BailOut(const char *pos);
98
100 virtual void Verbose(int level, const char *format, ...)
101 __attribute__ ((format(printf, 3, 4)));
102
104 virtual void Verbose(const char *format, ...)
105 __attribute__ ((format(printf, 2, 3)));
106
108 virtual void Log(int level, const char *format, ...)
109 __attribute__ ((format(printf, 3, 4)));
110
112 virtual void Log(const char *format, ...)
113 __attribute__ ((format(printf, 2, 3)));
114
116 virtual void ErrLog(int severity, const char *format, ...)
117 __attribute__ ((format(printf, 3, 4)));
118
120 void FeedBack(const char *format, ...)
121 __attribute__ ((format(printf, 2, 3)));
122
124 virtual void SendFeedBack(const char *msg);
125
127 const char *CfgPath();
128
130 int CfgPath(char *path, const char *cfgFile);
131
133 int KeyVal(const char *key, float *value);
134
136 int KeyVal(const char *key, double *value);
137
139 int KeyVal(const char *key, int *value);
140
142 int KeyVal(const char *key, unsigned int *value);
143
145 int KeyValHex(const char *key, int *value);
146
148 int KeyValHex(const char *key, unsigned int *value);
149
151 int KeyValFmt(const char *key, int *value);
152
154 int KeyValFmt(const char *key, unsigned int *value);
155
157 int KeyValFrac(const char *key, unsigned int n, uint64_t *v1, uint64_t *v2);
158
160 void CleanupCmd(char *cmdLine, int *cmdLen);
161
162private:
164 char erms_[256];
165
167 int instance_;
168
170 char major_[64];
171
173 int endian_;
174
176 char path_[256];
177};
178
179#endif
Definition ngcbALARM.hpp:60
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:145
virtual int Success()
Return success.
Definition ngcbOBJ.cpp:67
int KeyValFrac(const char *key, unsigned int n, uint64_t *v1, uint64_t *v2)
Fraction after n digits.
Definition ngcbOBJ.cpp:262
virtual void virtual void virtual void virtual void virtual void void virtual void SendFeedBack(const char *msg)
Feed-back sender implementation.
Definition ngcbOBJ.cpp:217
void CfgPath(const char *path)
Set external configuration path.
Definition ngcbOBJ.cpp:268
int verboseLevel
Verbose level.
Definition ngcbOBJ.hpp:45
ngcbALARM_SYS * alarmSystem
Alarm system.
Definition ngcbOBJ.hpp:39
virtual void virtual void virtual void virtual void virtual void void FeedBack(const char *format,...) __attribute__((format(printf
Feed-back function.
Definition ngcbOBJ.cpp:205
void CleanupCmd(char *cmdLine, int *cmdLen)
Clean command string (remove extra spaces etc.)
Definition ngcbOBJ.cpp:335
int KeyVal(const char *key, float *value)
Get single precision floating point value from keyword string.
Definition ngcbOBJ.cpp:222
int ignoreErr
Ignore next error (do not log)
Definition ngcbOBJ.hpp:57
virtual ~ngcbOBJ()
Destructor.
Definition ngcbOBJ.cpp:53
int BigEndian()
Big-endian architecture.
Definition ngcbOBJ.cpp:61
int LittleEndian()
Little-endian architecture.
Definition ngcbOBJ.cpp:63
FILE * watchdog
Watchdog stream.
Definition ngcbOBJ.hpp:36
int KeyValHex(const char *key, int *value)
Get 32-bit signed integer value from hexadecimal keyword string.
Definition ngcbOBJ.cpp:242
int logLevel
Logging level.
Definition ngcbOBJ.hpp:48
int type
Object type.
Definition ngcbOBJ.hpp:60
virtual int BailOut(const char *pos)
Log code position of the error and bail-out with failure.
Definition ngcbOBJ.cpp:71
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:34
int xterm
Xterm flag.
Definition ngcbOBJ.hpp:51
int Instance()
Get instance.
Definition ngcbOBJ.cpp:57
int KeyValFmt(const char *key, int *value)
Get 32-bit signed integer value from string.
Definition ngcbOBJ.cpp:252
virtual void Verbose(int level, const char *format,...) __attribute__((format(printf
Verbose message if verbose level exceeds level.
Definition ngcbOBJ.cpp:73
virtual int Failure()
Return failure.
Definition ngcbOBJ.cpp:69
virtual char * ErrMsg()
Error message.
Definition ngcbOBJ.cpp:65
const char * Major()
Instance major number.
Definition ngcbOBJ.cpp:59
int debugPort
Debug port.
Definition ngcbOBJ.hpp:54
ngcbSERVICE * services
System services.
Definition ngcbOBJ.hpp:42
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:186
const char * CfgPath()
Get external configuration path.
Definition ngcbOBJ.cpp:272
Definition ngcbSERVICE.hpp:35
char * ngcbOBJ_MAJOR
Definition ngcbOBJ.cpp:32