source: trunk/MagicSoft/Mars/mreport/MReport.h@ 8038

Last change on this file since 8038 was 7208, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.4 KB
Line 
1#ifndef MARS_MReport
2#define MARS_MReport
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#include "MTime.h"
8class MTime;
9class MParList;
10
11class MReport : public MParContainer
12{
13private:
14 const TString fIdentifier; //! Identifier of the subsystem
15 const Bool_t fHasReportTime; //! Intermediate solution for DC currents
16
17 Byte_t fState; // Status of the subsystem
18 MTime *fTime; //! pointer to the corresponding time stamp
19
20 ULong_t Hash() const { return fIdentifier.Hash(); }
21 Bool_t InterpreteHeader(TString &str);
22
23public:
24 MReport(const char *id, Bool_t time=kTRUE) : fIdentifier(id), fHasReportTime(time), fState(0xff), fTime(0) { }
25
26 virtual Bool_t SetupReading(MParList &plist);
27 virtual Int_t InterpreteBody(TString &str, Int_t ver);
28
29 Int_t Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver);
30 Bool_t CheckIdentifier(TString &str) const
31 {
32 if (!str.BeginsWith(fIdentifier))
33 return kFALSE;
34
35 str.Remove(0, fIdentifier.Length());
36 str = str.Strip(TString::kBoth);
37
38 return kTRUE;
39 }
40
41 const TString &GetIdentifier() const { return fIdentifier; }
42
43 Byte_t GetState() const { return fState; }
44 Double_t GetMjd() const { return fTime ? fTime->GetMjd() : -1; }
45
46 ClassDef(MReport, 1) // Base class for control reports
47};
48
49#endif
Note: See TracBrowser for help on using the repository browser.