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

Last change on this file since 19600 was 14935, checked in by tbretz, 12 years ago
Add changes necessary to remove fits completely from namespace std in MARS.
File size: 1.7 KB
Line 
1#ifndef MARS_MReport
2#define MARS_MReport
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7#ifndef MARS_MTime
8#include "MTime.h"
9#endif
10
11class fits;
12
13class MTime;
14class MParList;
15
16class MReport : public MParContainer
17{
18private:
19 const TString fIdentifier; //! Identifier of the subsystem
20 const Bool_t fHasReportTime; //! Intermediate solution for DC currents
21
22 Byte_t fState; // Status of the subsystem
23 MTime *fTime; //! pointer to the corresponding time stamp
24
25 ULong_t Hash() const { return fIdentifier.Hash(); }
26 Bool_t InterpreteHeader(TString &str, Int_t ver);
27
28protected:
29 Bool_t CheckTag(TString &str, const char *tag) const;
30
31 void Copy(TObject &obj) const;
32
33public:
34 MReport(const char *id, Bool_t time=kTRUE) : fIdentifier(id), fHasReportTime(time), fState(0xff), fTime(0) { }
35
36 virtual Bool_t SetupReading(MParList &plist);
37 virtual Bool_t SetupReadingFits(fits &) { return kTRUE; }
38 virtual Int_t InterpreteBody(TString &str, Int_t ver);
39
40 Int_t Interprete(TString &str, const MTime &start, const MTime &stop, const Int_t ver);
41 virtual Int_t InterpreteFits(const fits &) { return kTRUE; }
42 Bool_t CheckIdentifier(TString &str) const
43 {
44 if (!str.BeginsWith(fIdentifier))
45 return kFALSE;
46
47 str.Remove(0, fIdentifier.Length());
48 str = str.Strip(TString::kBoth);
49
50 return kTRUE;
51 }
52
53 const TString &GetIdentifier() const { return fIdentifier; }
54
55 Byte_t GetState() const { return fState; }
56 Double_t GetMjd() const { return fTime ? fTime->GetMjd() : -1; }
57
58 MTime *GetTime() { return fTime; }
59
60 ClassDef(MReport, 1) // Base class for control reports
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.