]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/EveBase/AliEveMacro.h
new years resolution
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveMacro.h
CommitLineData
f6afd0e1 1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 2007
3
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 **************************************************************************/
9
10#ifndef AliEveMacro_H
11#define AliEveMacro_H
12
13#include <TObject.h>
14#include <TString.h>
15
68ca2fe7 16class TEveElement;
17
f6afd0e1 18//______________________________________________________________________________
19// Short description of AliEveMacro
20//
21
22class AliEveMacro : public TObject
23{
24 friend class AliEveMacroEditor;
25
26public:
68ca2fe7 27 enum DataSource_e { kNone = 0,
28 kRunLoader = 1,
29 kESD = 2,
30 kESDfriend = 4,
31 kRawReader = 8 };
32
33 enum ExecStatus_e { kNotRun = -2,
34 kNoData = -1,
35 kOK = 0,
36 kException = 1,
37 kError = 2 };
f6afd0e1 38
7b2d546e 39 AliEveMacro(Int_t src, const TString& tags, const TString& mac, const TString& foo,
f6afd0e1 40 const TString& args="", Bool_t act=kTRUE);
41 virtual ~AliEveMacro() {}
42
43 Int_t GetSources() const { return fSources; }
44 void SetSources(Int_t x) { fSources = x; }
7b2d546e 45 const TString& GetTags() const { return fTags; }
46 void SetTags(const TString& x) { fTags = x; }
f6afd0e1 47 const TString& GetMacro() const { return fMacro; }
48 void SetMacro(const TString& x) { fMacro = x; }
49 const TString& GetFunc() const { return fFunc; }
50 void SetFunc(const TString& x) { fFunc = x; }
51 const TString& GetArgs() const { return fArgs; }
52 void SetArgs(const TString& x) { fArgs = x; }
53 Bool_t GetActive() const { return fActive; }
54 void SetActive(Bool_t x) { fActive = x; }
55
68ca2fe7 56 Bool_t RequiresRunLoader() const { return fSources & kRunLoader; }
57 Bool_t RequiresESD() const { return fSources & kESD; }
58 Bool_t RequiresESDfriend() const { return fSources & kESDfriend; }
59 Bool_t RequiresRawReader() const { return fSources & kRawReader; }
60
61 void ResetExecState();
62
63 void SetExecNoData();
64 void SetExecOK(TEveElement* result);
65 void SetExecException(const TString& exception);
66 void SetExecError();
67
68 ExecStatus_e GetExecStatus() const { return fExecStatus; }
69 const TString& GetExecException() const { return fExecExcString; }
70 TEveElement* GetExecResult() const { return fExecResult; }
71
72 Bool_t WasExecTried() const { return fExecStatus >= kOK; }
73 Bool_t WasExecOK() const { return fExecStatus == kOK; }
74
f6afd0e1 75 TString FormForExec() const;
76 TString FormForDisplay() const;
77
78protected:
68ca2fe7 79 Int_t fSources; // Source of data, bitwise or of DataSource_e entries.
7b2d546e 80 TString fTags; // Tags describing the macro (for selection).
81 TString fMacro; // Macro where func is defined; if null, assume it is there.
82 TString fFunc; // Function to call.
83 TString fArgs; // Arguments for the function.
84 Bool_t fActive; // Flag if macro is active.
f6afd0e1 85
68ca2fe7 86 ExecStatus_e fExecStatus;
87 TString fExecExcString;
88 TEveElement *fExecResult;
89
f6afd0e1 90private:
68ca2fe7 91 AliEveMacro(const AliEveMacro&); // Not implemented
92 AliEveMacro& operator=(const AliEveMacro&); // Not implemented
f6afd0e1 93
68ca2fe7 94 ClassDef(AliEveMacro, 0); // Encapsulation of data reqired for execution of a CINT macro and the result of its last execution.
f6afd0e1 95};
96
97#endif