Logo ROOT   6.08/07
Reference Guide
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 16/08/2005
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
12 #ifndef ROOT_TMacro
13 #define ROOT_TMacro
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TMacro //
18 // //
19 // Class supporting a collection of lines with C++ code. //
20 // A TMacro can be executed, saved to a ROOT file, edited, etc. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
24 #ifndef ROOT_TNamed
25 #include "TNamed.h"
26 #endif
28 class TList;
29 class TObjString;
30 class TMD5;
33 class TMacro : public TNamed {
35 protected:
36  TList *fLines; //collection of lines
37  TString fParams; //default string of macro parameters
39  void SaveSource(FILE *fp);
41 public:
42  TMacro();
43  TMacro(const TMacro&);
44  TMacro(const char *name, const char *title="");
45  virtual ~TMacro();
46  TMacro& operator=(const TMacro&);
47  virtual TObjString *AddLine(const char *text);
48  virtual void Browse(TBrowser *b);
49  virtual TMD5 *Checksum();
50  virtual TObjString *GetLineWith(const char *text) const;
51  virtual Bool_t Load() const; //*MENU*
52  virtual Long_t Exec(const char *params = 0, Int_t* error = 0); //*MENU*
53  TList *GetListOfLines() const {return fLines;}
54  virtual void Paint(Option_t *option="");
55  virtual void Print(Option_t *option="") const; //*MENU*
56  virtual Int_t ReadFile(const char *filename);
57  virtual void SaveSource(const char *filename); //*MENU*
58  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
59  virtual void SetParams(const char *params=0); //*MENU*
61  ClassDef(TMacro,1) // Class supporting a collection of lines with C++ code.
62 };
64 #endif
TList * GetListOfLines() const
Definition: TMacro.h:53
Collectable string class.
Definition: TObjString.h:32
const char Option_t
Definition: RtypesCore.h:62
virtual void Paint(Option_t *option="")
Execute this macro (called by TPad::Paint).
Definition: TMacro.cxx:314
virtual Long_t Exec(const char *params=0, Int_t *error=0)
Execute this macro with params, if params is 0, default parameters (set via SetParams) are used...
Definition: TMacro.cxx:265
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:33
Basic string class.
Definition: TString.h:137
TList * fLines
Definition: TMacro.h:36
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual TObjString * GetLineWith(const char *text) const
Search the first line containing text.
Definition: TMacro.cxx:300
This code implements the MD5 message-digest algorithm.
Definition: TMD5.h:46
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual void Print(Option_t *option="") const
Print contents of this macro.
Definition: TMacro.cxx:322
virtual Bool_t Load() const
Load the macro into the interpreter.
Definition: TMacro.cxx:246
A doubly linked list.
Definition: TList.h:47
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
TMacro & operator=(const TMacro &)
Copy constructor.
Definition: TMacro.cxx:118
void SaveSource(FILE *fp)
Save macro source in file pointer fp.
Definition: TMacro.cxx:380
virtual Int_t ReadFile(const char *filename)
Read lines in filename in this macro.
Definition: TMacro.cxx:335
long Long_t
Definition: RtypesCore.h:50
TText * text
virtual TMD5 * Checksum()
Returns checksum of the current content.
Definition: TMacro.cxx:193
Create an empty macro, use AddLine() or ReadFile() to fill this macro.
Definition: TMacro.cxx:61
virtual void Browse(TBrowser *b)
When clicking in the browser, the following action is performed on this macro, depending the content ...
Definition: TMacro.cxx:171
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
TString fParams
Definition: TMacro.h:37
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save macro source on stream out.
Definition: TMacro.cxx:394
virtual void SetParams(const char *params=0)
Set default parameters to execute this macro.
Definition: TMacro.cxx:418
char name[80]
Definition: TGX11.cxx:109
virtual TObjString * AddLine(const char *text)
Add line with text in the list of lines of this macro.
Definition: TMacro.cxx:138
virtual ~TMacro()
Delete this macro.
Definition: TMacro.cxx:109