Line | |
---|
1 | #ifndef EVIDENCE_H_SEEN |
---|
2 | #define EVIDENCE_H_SEEN |
---|
3 | |
---|
4 | #include <stdio.h> |
---|
5 | #include <stdarg.h> |
---|
6 | #include <string> |
---|
7 | #include <errno.h> |
---|
8 | #include <exception> |
---|
9 | |
---|
10 | #include "dis.hxx" |
---|
11 | #include "dic.hxx" |
---|
12 | |
---|
13 | #define NO_LINK (char *) "__&DIM&NOLINK&__" // Data if no link available |
---|
14 | #define STATUS_SIZE 1000 // Bytes for status service string |
---|
15 | |
---|
16 | using namespace std; |
---|
17 | |
---|
18 | // Declaration of item for history buffer (see DColl.cc) |
---|
19 | struct EvidenceHistoryItem { |
---|
20 | int Seconds; |
---|
21 | double Value; |
---|
22 | } __attribute__((__packed__)); |
---|
23 | |
---|
24 | // Class declation of Evidence server |
---|
25 | class EvidenceServer: public DimServer { |
---|
26 | |
---|
27 | private: |
---|
28 | struct ConfigItem { |
---|
29 | char *Name; |
---|
30 | char *Value; |
---|
31 | int Time; |
---|
32 | } *ConfigList; |
---|
33 | unsigned int ConfigNum; |
---|
34 | |
---|
35 | DimService *Status; |
---|
36 | |
---|
37 | static void SignalHandler(int); // static for signal() |
---|
38 | static void Terminate(); // static for set_terminate() |
---|
39 | void errorHandler(int, int, char *); |
---|
40 | void exitHandler(int); |
---|
41 | |
---|
42 | public: |
---|
43 | EvidenceServer(const char *); |
---|
44 | ~EvidenceServer(); |
---|
45 | |
---|
46 | enum StateType {INFO=0, WARN=1, ERROR=2, FATAL=3}; |
---|
47 | |
---|
48 | void State(StateType, const char *, ...); |
---|
49 | char* GetConfig(const char *, const char * = NULL); |
---|
50 | static char* ToString(DimInfo *); |
---|
51 | |
---|
52 | static bool ExitRequest; |
---|
53 | }; |
---|
54 | |
---|
55 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.