]>
Commit | Line | Data |
---|---|---|
57459306 | 1 | #ifndef ALI_DCS_VALUE_H |
2 | #define ALI_DCS_VALUE_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | // | |
45a493ce | 10 | // This class represents the value(s) of a DCS data point at a given timestamp |
57459306 | 11 | // |
12 | ||
45a493ce | 13 | #include <TObject.h> |
57459306 | 14 | |
45a493ce | 15 | class AliDCSValue : public TObject { |
57459306 | 16 | public: |
45a493ce | 17 | enum Type { |
18 | kInvalid = 0, | |
57459306 | 19 | |
45a493ce | 20 | kBool = 1, |
21 | kChar = 2, | |
22 | kInt = 3, | |
23 | kUInt = 4, | |
60d864bd | 24 | kFloat = 5 |
45a493ce | 25 | }; |
57459306 | 26 | |
45a493ce | 27 | AliDCSValue(); |
28 | AliDCSValue(const AliDCSValue& c); | |
57459306 | 29 | |
06b09194 | 30 | virtual ~AliDCSValue(); |
57459306 | 31 | |
45a493ce | 32 | AliDCSValue& operator=(const AliDCSValue& c); |
33 | virtual void Copy(TObject& c) const; | |
57459306 | 34 | |
45a493ce | 35 | AliDCSValue(Bool_t value, UInt_t timeStamp); |
36 | AliDCSValue(Char_t value, UInt_t timeStamp); | |
37 | AliDCSValue(Int_t value, UInt_t timeStamp); | |
38 | AliDCSValue(UInt_t value, UInt_t timeStamp); | |
39 | AliDCSValue(Float_t value, UInt_t timeStamp); | |
57459306 | 40 | |
45a493ce | 41 | Bool_t GetBool() const { return fBool; } |
42 | Char_t GetChar() const { return fChar; } | |
43 | Int_t GetInt() const { return fInt; } | |
44 | UInt_t GetUInt() const { return fUInt; } | |
45 | Float_t GetFloat() const { return fFloat; } | |
57459306 | 46 | |
45a493ce | 47 | Type GetType() const { return fType; } |
45a493ce | 48 | |
49 | UInt_t GetTimeStamp() const { return fTimeStamp; } | |
50 | void SetTimeStamp(UInt_t timeStamp) { fTimeStamp = timeStamp; } | |
51 | ||
52 | Int_t GetSize() const; | |
45a493ce | 53 | |
54 | const Char_t* ToString() const; | |
5f370962 | 55 | void Print(Option_t* /*opt*/) const; |
56 | ||
57 | ||
58 | /**********************************************/ | |
59 | ||
60 | Int_t Compare(const TObject* obj) const | |
61 | { if( fTimeStamp < ((AliDCSValue *)obj )->fTimeStamp ) return -1; | |
62 | if( fTimeStamp == ((AliDCSValue *)obj )->fTimeStamp ) return 0; | |
63 | return 1; | |
64 | } | |
65 | ||
66 | Bool_t IsSortable() const { return kTRUE; } | |
67 | ||
68 | /*********************************************/ | |
69 | ||
45a493ce | 70 | |
71 | protected: | |
72 | void Init(); | |
73 | ||
74 | Type fType; // type of the value stored | |
75 | ||
76 | Bool_t fBool; // bool value | |
77 | Char_t fChar; // char value | |
78 | Int_t fInt; // int value | |
79 | UInt_t fUInt; // uint value | |
80 | Float_t fFloat; // float value | |
81 | ||
45a493ce | 82 | UInt_t fTimeStamp; // timestamp of this value |
83 | ||
84 | ClassDef(AliDCSValue, 2); | |
57459306 | 85 | }; |
86 | ||
87 | #endif |