Line | |
---|
1 | #ifndef FACT_DataProcessorImp
|
---|
2 | #define FACT_DataProcessorImp
|
---|
3 |
|
---|
4 | #include "MessageImp.h"
|
---|
5 |
|
---|
6 | struct _RUN_HEAD;
|
---|
7 | struct _EVENT;
|
---|
8 | struct _RUN_TAIL;
|
---|
9 |
|
---|
10 | typedef struct _RUN_HEAD RUN_HEAD;
|
---|
11 | typedef struct _EVENT EVENT;
|
---|
12 | typedef struct _RUN_TAIL RUN_TAIL;
|
---|
13 |
|
---|
14 | class DataProcessorImp : public MessageImp
|
---|
15 | {
|
---|
16 | uint32_t fRunId;
|
---|
17 |
|
---|
18 | int Write(const Time &time, const std::string &txt, int qos)
|
---|
19 | {
|
---|
20 | return fMsg.Write(time, txt, qos);
|
---|
21 | }
|
---|
22 |
|
---|
23 | protected:
|
---|
24 | MessageImp &fMsg;
|
---|
25 | std::string fFileName;
|
---|
26 |
|
---|
27 | public:
|
---|
28 | DataProcessorImp(uint32_t id, MessageImp &imp) : fRunId(id), fMsg(imp) { }
|
---|
29 | virtual ~DataProcessorImp() { }
|
---|
30 |
|
---|
31 | virtual bool Open(RUN_HEAD* h) = 0;
|
---|
32 | virtual bool WriteEvt(EVENT *) = 0;
|
---|
33 | virtual bool Close(RUN_TAIL * = 0) = 0;
|
---|
34 |
|
---|
35 | const std::string &GetFileName() const { return fFileName; }
|
---|
36 |
|
---|
37 | uint32_t GetRunId() const { return fRunId; }
|
---|
38 |
|
---|
39 | static std::string FormFileName(uint32_t runid, const std::string &extension);
|
---|
40 | };
|
---|
41 |
|
---|
42 | #include "Time.h"
|
---|
43 |
|
---|
44 | class DataDump : public DataProcessorImp
|
---|
45 | {
|
---|
46 | Time fTime;
|
---|
47 |
|
---|
48 | public:
|
---|
49 | DataDump(uint32_t id, MessageImp &imp) : DataProcessorImp(id, imp) { }
|
---|
50 |
|
---|
51 | bool Open(RUN_HEAD* h);
|
---|
52 | bool WriteEvt(EVENT *e);
|
---|
53 | bool Close(RUN_TAIL * = 0);
|
---|
54 | };
|
---|
55 |
|
---|
56 | class DataDebug : public DataDump
|
---|
57 | {
|
---|
58 | public:
|
---|
59 | DataDebug(uint32_t id, MessageImp &imp) : DataDump(id, imp) { }
|
---|
60 |
|
---|
61 | bool WriteEvt(EVENT *e);
|
---|
62 | };
|
---|
63 |
|
---|
64 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.