source: trunk/FACT++/src/DataProcessorImp.h@ 11834

Last change on this file since 11834 was 11726, checked in by tbretz, 13 years ago
File size: 1.3 KB
Line 
1#ifndef FACT_DataProcessorImp
2#define FACT_DataProcessorImp
3
4#include "MessageImp.h"
5
6struct _RUN_HEAD;
7struct _EVENT;
8struct _RUN_TAIL;
9
10typedef struct _RUN_HEAD RUN_HEAD;
11typedef struct _EVENT EVENT;
12typedef struct _RUN_TAIL RUN_TAIL;
13
14class 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
23protected:
24 MessageImp &fMsg;
25 std::string fFileName;
26
27public:
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
44class DataDump : public DataProcessorImp
45{
46 Time fTime;
47
48public:
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
56class DataDebug : public DataDump
57{
58public:
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.