Fix enums as reported by coverity
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveMacro.cxx
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#include "AliEveMacro.h"
11
12//______________________________________________________________________________
f6afd0e1 13//
68ca2fe7 14// Member fSources is a bitfield, but we do not have a widget
15// that can show/edit this (a combo-box with a check-box for each
16// entry). So ... use a single value for now,
f6afd0e1 17
18ClassImp(AliEveMacro)
19
20//______________________________________________________________________________
7b2d546e 21AliEveMacro::AliEveMacro(Int_t src, const TString& tags, const TString& mac,
22 const TString& foo, const TString& args, Bool_t act) :
f6afd0e1 23 TObject(),
7b2d546e 24 fSources(src), fTags(tags), fMacro (mac),
68ca2fe7 25 fFunc (foo), fArgs(args), fActive(act),
26 fExecStatus(kNotRun), fExecExcString(), fExecResult(0)
f6afd0e1 27{
28 // Constructor.
29}
30
31/******************************************************************************/
32
68ca2fe7 33void AliEveMacro::ResetExecState()
34{
35 // Reset exec variables into state as if the macro has not been run.
36
37 fExecStatus = kNotRun;
38 fExecExcString = "";
39 fExecResult = 0;
40}
41
42void AliEveMacro::SetExecNoData()
43{
44 // Set last execution state to 'NoData'.
45
46 fExecStatus = kNoData;
47}
48
49
50void AliEveMacro::SetExecOK(TEveElement* result)
51{
52 // Set last execution state to 'OK' and register result.
53
54 fExecStatus = kOK;
55 fExecResult = result;
56}
57
58
59void AliEveMacro::SetExecException(const TString& exception)
60{
61 // Set last execution state to 'Exception' and store the exception string.
62
63 fExecStatus = kException;
64 fExecExcString = exception;
65}
66
67void AliEveMacro::SetExecError()
68{
69 // Set last execution state to 'Error'.
70
71 fExecStatus = kError;
72}
73
74/******************************************************************************/
75
f6afd0e1 76TString AliEveMacro::FormForExec() const
77{
78 // Return string suitable for execution.
79
80 return fFunc + "(" + fArgs + ");";
81}
82
83TString AliEveMacro::FormForDisplay() const
84{
85 // Return string suitable for display.
86
4578afcb 87 return TString::Format
ad5abc55 88 (" %c %-22s %-30s %-30s %-s", fActive ? 'x' : ' ',
4578afcb 89 fMacro.Data(), fFunc.Data(), fArgs.Data(), fTags.Data());
f6afd0e1 90}