Logo ROOT  
Reference Guide
TMacro.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Rene Brun 16/08/2005
3 
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  *************************************************************************/
11 
12 #ifndef ROOT_TMacro
13 #define ROOT_TMacro
14 
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 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 
26 class TList;
27 class TObjString;
28 class TMD5;
29 
30 
31 class TMacro : public TNamed {
32 
33 protected:
34  TList *fLines; //collection of lines
35  TString fParams; //default string of macro parameters
36 
37  void SaveSource(FILE *fp);
38 
39 public:
40  TMacro();
41  TMacro(const TMacro&);
42  TMacro(const char *name, const char *title="");
43  virtual ~TMacro();
44  TMacro& operator=(const TMacro&);
45  virtual TObjString *AddLine(const char *text);
46  virtual void Browse(TBrowser *b);
47  virtual TMD5 *Checksum();
48  virtual TObjString *GetLineWith(const char *text) const;
49  virtual Bool_t Load() const; //*MENU*
50  virtual Long_t Exec(const char *params = 0, Int_t* error = 0); //*MENU*
51  TList *GetListOfLines() const {return fLines;}
52  virtual void Paint(Option_t *option="");
53  virtual void Print(Option_t *option="") const; //*MENU*
54  virtual Int_t ReadFile(const char *filename);
55  virtual void SaveSource(const char *filename); //*MENU*
56  virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
57  virtual void SetParams(const char *params=0); //*MENU*
58 
59  ClassDef(TMacro,1) // Class supporting a collection of lines with C++ code.
60 };
61 
62 #endif
TBrowser
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
TMacro::Print
virtual void Print(Option_t *option="") const
Print contents of this macro.
Definition: TMacro.cxx:325
Option_t
const char Option_t
Definition: RtypesCore.h:66
TMacro::SaveSource
void SaveSource(FILE *fp)
Save macro source in file pointer fp.
Definition: TMacro.cxx:383
TMacro::GetLineWith
virtual TObjString * GetLineWith(const char *text) const
Search the first line containing text.
Definition: TMacro.cxx:303
TMacro::Load
virtual Bool_t Load() const
Load the macro into the interpreter.
Definition: TMacro.cxx:249
TNamed.h
TMacro::ReadFile
virtual Int_t ReadFile(const char *filename)
Read lines in filename in this macro.
Definition: TMacro.cxx:338
Int_t
int Int_t
Definition: RtypesCore.h:45
TMacro::Checksum
virtual TMD5 * Checksum()
Returns checksum of the current content.
Definition: TMacro.cxx:196
TString
Basic string class.
Definition: TString.h:136
text
TText * text
Definition: entrylist_figure1.C:10
b
#define b(i)
Definition: RSha256.hxx:100
TMacro::SetParams
virtual void SetParams(const char *params=0)
Set default parameters to execute this macro.
Definition: TMacro.cxx:421
bool
TObjString
Collectable string class.
Definition: TObjString.h:28
TMacro::operator=
TMacro & operator=(const TMacro &)
Copy constructor.
Definition: TMacro.cxx:121
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TMacro::~TMacro
virtual ~TMacro()
Delete this macro.
Definition: TMacro.cxx:112
Long_t
long Long_t
Definition: RtypesCore.h:54
TMacro::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save macro source on stream out.
Definition: TMacro.cxx:397
TMacro::Browse
virtual void Browse(TBrowser *b)
When clicking in the browser, the following action is performed on this macro, depending the content ...
Definition: TMacro.cxx:174
TMacro::Exec
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:268
TMD5
This code implements the MD5 message-digest algorithm.
Definition: TMD5.h:44
TMacro
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
TMacro::fLines
TList * fLines
Definition: TMacro.h:34
TMacro::TMacro
TMacro()
Create an empty macro, use AddLine() or ReadFile() to fill this macro.
Definition: TMacro.cxx:64
TMacro::fParams
TString fParams
Definition: TMacro.h:35
TMacro::GetListOfLines
TList * GetListOfLines() const
Definition: TMacro.h:51
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TMacro::Paint
virtual void Paint(Option_t *option="")
Execute this macro (called by TPad::Paint).
Definition: TMacro.cxx:317
TMacro::AddLine
virtual TObjString * AddLine(const char *text)
Add line with text in the list of lines of this macro.
Definition: TMacro.cxx:141
TList
A doubly linked list.
Definition: TList.h:44
int