source: trunk/Mars/mreport/MReport.h@ 11942

Last change on this file since 11942 was 8955, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 1.5 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, Int_t ver);
22
23protected:
24 Bool_t CheckTag(TString &str, const char *tag) const;
25
26 void Copy(TObject &obj) const;
27
28public:
29 MReport(const char *id, Bool_t time=kTRUE) : fIdentifier(id), fHasReportTime(time), fState(0xff), fTime(0) { }
30
31 virtual Bool_t SetupReading(MParList &plist);
32 virtual Int_t InterpreteBody(TString &str, Int_t ver);
33
34 Int_t Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver);
35 Bool_t CheckIdentifier(TString &str) const
36 {
37 if (!str.BeginsWith(fIdentifier))
38 return kFALSE;
39
40 str.Remove(0, fIdentifier.Length());
41 str = str.Strip(TString::kBoth);
42
43 return kTRUE;
44 }
45
46 const TString &GetIdentifier() const { return fIdentifier; }
47
48 Byte_t GetState() const { return fState; }
49 Double_t GetMjd() const { return fTime ? fTime->GetMjd() : -1; }
50
51 ClassDef(MReport, 1) // Base class for control reports
52};
53
54#endif
Note: See TracBrowser for help on using the repository browser.