| library: libCore #include "TMacro.h"
 | 
TMacro
class description - source file - inheritance tree (.pdf)
    public:
                          TMacro()
                          TMacro(const TMacro&)
                          TMacro(const char* name, const char* title = "")
                  virtual ~TMacro()
      virtual TObjString* AddLine(const char* text)
             virtual void Browse(TBrowser* b)
            virtual TMD5* Checksum()
           static TClass* Class()
             virtual void Exec(const char* params = "0")
      virtual TObjString* GetLineWith(const char* text) const
                   TList* GetListOfLines() const
          virtual TClass* IsA() const
                  TMacro& operator=(const TMacro&)
             virtual void Paint(Option_t* option = "")
             virtual void Print(Option_t* option = "") const
            virtual Int_t ReadFile(const char* filename)
             virtual void SavePrimitive(ofstream& out, Option_t* option)
             virtual void SaveSource(const char* filename)
             virtual void SetParams(const char* params = "0")
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
    protected:
       TList* fLines   collection of lines
      TString fParams  default string of macro parameters
                                                                      
 TMacro                                                               
                                                                      
 Class supporting a collection of lines with C++ code.                
 A TMacro can be executed, saved to a ROOT file, edited, etc.         
                                                                      
 A macro can be built line by line by calling the AddLine function.   
 or it can be created directly from a file via the special constructor
 when the first argument is a file name.                              
                                                                      
 A macro can be executed via the Exec function.                       
 Arguments can be specified when calling Exec.                        
                                                                      
 A macro can be drawn in a pad. When the pad is updated, the macro is 
 automatically executed.                                              
                                                                      
 The code in the macro can be saved via the SaveSource function.      
 If the macro is in the list of primitives of a pad/canvas, the macro 
 will be saved in the script generated by TCanvas::SaveSource.        
                                                                      
 A macro can be written to a ROOT file via TObject::Write.            
                                                                      
 Examples:                                                            
   TMacro m("Peaks.C");  //macro m with name "Peaks" is created       
                         //from file  Peaks.C                         
   m.Exec();             //macro executed with default arguments      
   m.Exec("4");          //macro executed with argument               
   m.SaveSource("newPeaks.C");                                        
   TFile f("mymacros.root","recreate");                               
   m.Write();   //macro saved to file with name "Peaks"               
                                                                      
 TMacro(): TNamed()
 Create an empty macro, use AddLine() or ReadFile() to fill this macro.
 TMacro(const char *name, const char *title)
       :TNamed(name,title)
 Create a macro with a name and a title.
 If name is the name of a file, the macro is automatically filled
 by reading all the lines in the file. In this case, if the title
 is empty, it will be the name of the file.
 TMacro(const TMacro ¯o): TNamed(macro)
 Copy constructor.
 ~TMacro()
 Delete this macro.
TObjString* AddLine(const char *text)
 Add line with text in the list of lines of this macro.
void Browse(TBrowser * /*b*/)
 When clicking in the browser, the macro will be executed.
TMD5* Checksum()
 Returns checksum of the current content. The returned TMD5 object must
 be deleted by the user. Returns 0 in case of error.
void Exec(const char *params)
 Execute this macro with params, if params is 0, default parameters
 (set via SetParams) are used.
TObjString* GetLineWith(const char *text) const
 Search the first line containing text.
void Paint(Option_t *option)
 Execute this macro (called by TPad::Paint).
void Print(Option_t * /*option*/) const
 Print contents of this macro.
Int_t ReadFile(const char *filename)
 Read lines in filename in this macro.
void SaveSource(const char *filename)
 Save macro source in filename.
void SavePrimitive(ofstream &out, Option_t *option)
 Save macro source on stream out.
void SetParams(const char *params)
 Set default parameters to execute this macro.
Inline Functions
             TList* GetListOfLines() const
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)
            TMacro& operator=(const TMacro&)
Author: Rene Brun 16/08/2005
Last update: root/base:$Name:  $:$Id: TMacro.cxx,v 1.6 2005/11/16 20:04:11 pcanal Exp $
Copyright  (C) 1995-2005, Rene Brun and Fons Rademakers.               *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.