ROOT  6.06/09
Reference Guide
TRint.h
Go to the documentation of this file.
1 // @(#)root/rint:$Id$
2 // Author: Rene Brun 17/02/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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 
13 #ifndef ROOT_TRint
14 #define ROOT_TRint
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // Rint //
19 // //
20 // Rint is the ROOT Interactive Interface. It allows interactive access //
21 // to the ROOT system via a C++ interpreter. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #ifndef ROOT_TApplication
26 #include "TApplication.h"
27 #endif
28 #ifndef ROOT_TString
29 #include "TString.h"
30 #endif
31 
32 class TFileHandler;
33 
34 
35 class TRint : public TApplication {
36 
37 private:
38  Int_t fNcmd; // command history number
39  TString fDefaultPrompt; // default prompt: "root [%d] "
40  char fPrompt[64]; // interpreter prompt
41  Bool_t fInterrupt; // if true macro execution will be stopped
42  Bool_t fCaughtException; // TRint just caught an exception or signal
43  TFileHandler *fInputHandler; // terminal input handler
44 
45  TRint(const TRint&); // not implemented
46  TRint& operator=(const TRint&); // not implemented
47 
48  void ExecLogon();
49  Long_t ProcessRemote(const char *line, Int_t *error = 0);
50  Long_t ProcessLineNr(const char* filestem, const char *line, Int_t *error = 0);
51 
52 public:
53  TRint(const char *appClassName, int *argc, char **argv,
54  void *options = 0, int numOptions = 0, Bool_t noLogo = kFALSE);
55  virtual ~TRint();
56  virtual char *GetPrompt();
57  virtual const char *SetPrompt(const char *newPrompt);
58  virtual void SetEchoMode(Bool_t mode);
59  virtual void HandleException(Int_t sig);
60  virtual Bool_t HandleTermInput();
61  virtual void PrintLogo(Bool_t lite = kFALSE);
62  virtual void Run(Bool_t retrn = kFALSE);
63  virtual void Terminate(int status);
64  void Interrupt() { fInterrupt = kTRUE; }
65  virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream& out);
66 
68 
69  ClassDef(TRint,0); //ROOT Interactive Application Interface
70 };
71 
72 #endif
TFileHandler * GetInputHandler()
Definition: TRint.h:67
virtual void Terminate(int status)
Terminate the application.
Definition: TRint.cxx:659
TLine * line
TRint & operator=(const TRint &)
virtual Bool_t HandleTermInput()
Handle input coming from terminal.
Definition: TRint.cxx:563
Basic string class.
Definition: TString.h:137
Long_t ProcessLineNr(const char *filestem, const char *line, Int_t *error=0)
Calls ProcessLine() possibly prepending a line directive for better diagnostics.
Definition: TRint.cxx:727
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Bool_t fInterrupt
Definition: TRint.h:41
char fPrompt[64]
Definition: TRint.h:40
TRint(const TRint &)
void ExecLogon()
Execute logon macro's.
Definition: TRint.cxx:297
virtual void SetEchoMode(Bool_t mode)
Set console mode:
Definition: TRint.cxx:689
char * out
Definition: TBase64.cxx:29
virtual const char * SetPrompt(const char *newPrompt)
Set a new default prompt.
Definition: TRint.cxx:548
virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream &out)
Forward tab completion request to our TTabCom::Hook().
Definition: TRint.cxx:752
virtual void HandleException(Int_t sig)
Handle exceptions (kSigBus, kSigSegmentationViolation, kSigIllegalInstruction and kSigFloatingExcepti...
Definition: TRint.cxx:643
virtual void Run(Bool_t retrn=kFALSE)
Main application eventloop.
Definition: TRint.cxx:350
Definition: TRint.h:35
virtual void PrintLogo(Bool_t lite=kFALSE)
Print the ROOT logo on standard output.
Definition: TRint.cxx:467
TString fDefaultPrompt
Definition: TRint.h:39
long Long_t
Definition: RtypesCore.h:50
ClassDef(TRint, 0)
Long_t ProcessRemote(const char *line, Int_t *error=0)
Process the content of a line starting with ".R" (already stripped-off) The format is [user@]host[:di...
Definition: TRint.cxx:705
Bool_t fCaughtException
Definition: TRint.h:42
void Interrupt()
Definition: TRint.h:64
virtual char * GetPrompt()
Get prompt from interpreter. Either "root [n]" or "end with '}'".
Definition: TRint.cxx:528
virtual ~TRint()
Destructor.
Definition: TRint.cxx:272
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:45
Int_t fNcmd
Definition: TRint.h:38
const Bool_t kTRUE
Definition: Rtypes.h:91
TFileHandler * fInputHandler
Definition: TRint.h:43