source: trunk/MagicSoft/Mars/mdata/MDataChain.h@ 6435

Last change on this file since 6435 was 5956, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 2.2 KB
Line 
1#ifndef MARS_MDataChain
2#define MARS_MDataChain
3
4/////////////////////////////////////////////////////////////////////////////
5// //
6// MDataList //
7// //
8// List of several filters //
9// //
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef MARS_MData
13#include "MData.h"
14#endif
15
16class MDataChain : public MData
17{
18private:
19 MData *fMember; // Filter
20
21 // PLEASE, always add new enums to the end of the enumeration,
22 // otherwise you would break loading old data chains...
23 typedef enum {
24 kENoop,
25 kELog, kELog2, kELog10,
26 kEAbs,
27 kESin, kECos, kETan, kESinH, kECosH, kETanH,
28 kEASin, kEACos, kEATan, kEASinH, kEACosH, kEATanH,
29 kESqrt, kESqr, kEPow10, kEExp,
30 kESgn,
31 kEPositive,
32 kENegative,
33 kEFloor, kECeil, kERound,
34 kERad2Deg, kEDeg2Rad, kERandom,
35 kERandomP, kERandomE, kERandomI, kERandomG, kERandomL,
36 kEIsNaN, kEFinite
37 } OperatorType_t;
38
39 OperatorType_t fOperatorType;
40
41 OperatorType_t ParseOperator(TString txt) const;
42
43 Int_t IsAlNum(TString txt);
44 Int_t GetBracket(TString txt, char open, char close);
45
46 void SimplifyString(TString &txt) const;
47 MData *ParseString(TString txt, Int_t level);
48 MData *ParseDataMember(TString txt);
49
50 MDataChain(const char *rule, OperatorType_t op);
51
52public:
53 MDataChain(const char *rule=NULL, const char *name=NULL, const char *title=NULL);
54 ~MDataChain();
55
56 // MData
57 Double_t GetValue() const;
58
59 Bool_t IsValid() const { return fMember ? kTRUE : kFALSE; }
60 Bool_t PreProcess(const MParList *plist);
61
62 TString GetRule() const;
63 TString GetDataMember() const;
64
65 // MParContainer
66 Bool_t IsReadyToSave() const;
67 void SetVariables(const TArrayD &arr);
68 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
69
70 ClassDef(MDataChain, 1) // A chain/concatenation of MData objects
71};
72
73#endif
Note: See TracBrowser for help on using the repository browser.