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