2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
18 //______________________________________________________________________________
19 // Short description of AliEveMacro
22 class AliEveMacro : public TObject
24 friend class AliEveMacroEditor;
27 enum DataSource_e { kNone = 0,
34 enum ExecStatus_e { kNotRun = -2,
40 AliEveMacro(Int_t src, const TString& tags, const TString& mac, const TString& foo,
41 const TString& args="", Bool_t act=kTRUE);
42 virtual ~AliEveMacro() {}
44 Int_t GetSources() const { return fSources; }
45 void SetSources(Int_t x) { fSources = x; }
46 const TString& GetTags() const { return fTags; }
47 void SetTags(const TString& x) { fTags = x; }
48 const TString& GetMacro() const { return fMacro; }
49 void SetMacro(const TString& x) { fMacro = x; }
50 const TString& GetFunc() const { return fFunc; }
51 void SetFunc(const TString& x) { fFunc = x; }
52 const TString& GetArgs() const { return fArgs; }
53 void SetArgs(const TString& x) { fArgs = x; }
54 Bool_t GetActive() const { return fActive; }
55 void SetActive(Bool_t x) { fActive = x; }
57 Bool_t RequiresRunLoader() const { return fSources & kRunLoader; }
58 Bool_t RequiresESD() const { return fSources & kESD; }
59 Bool_t RequiresESDfriend() const { return fSources & kESDfriend; }
60 Bool_t RequiresRawReader() const { return fSources & kRawReader; }
61 Bool_t RequiresAOD() const { return fSources & kAOD; }
63 void ResetExecState();
66 void SetExecOK(TEveElement* result);
67 void SetExecException(const TString& exception);
70 ExecStatus_e GetExecStatus() const { return fExecStatus; }
71 const TString& GetExecException() const { return fExecExcString; }
72 TEveElement* GetExecResult() const { return fExecResult; }
74 Bool_t WasExecTried() const { return fExecStatus >= kOK; }
75 Bool_t WasExecOK() const { return fExecStatus == kOK; }
77 TString FormForExec() const;
78 TString FormForDisplay() const;
81 Int_t fSources; // Source of data, bitwise or of DataSource_e entries.
82 TString fTags; // Tags describing the macro (for selection).
83 TString fMacro; // Macro where func is defined; if null, assume it is there.
84 TString fFunc; // Function to call.
85 TString fArgs; // Arguments for the function.
86 Bool_t fActive; // Flag if macro is active.
88 ExecStatus_e fExecStatus;
89 TString fExecExcString;
90 TEveElement *fExecResult;
93 AliEveMacro(const AliEveMacro&); // Not implemented
94 AliEveMacro& operator=(const AliEveMacro&); // Not implemented
96 ClassDef(AliEveMacro, 0); // Encapsulation of data reqired for execution of a CINT macro and the result of its last execution.