Logo ROOT  
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 #include "TApplication.h"
26 #include "TString.h"
27 
28 class TFileHandler;
29 
30 
31 class TRint : public TApplication {
32 
33 private:
34  Int_t fNcmd; // command history number
35  TString fDefaultPrompt; // default prompt: "root [%d] "
36  TString fNonContinuePrompt; // default prompt before continue prompt was set
37  char fPrompt[64]; // interpreter prompt
38  Bool_t fInterrupt; // if true macro execution will be stopped
39  Int_t fCaughtSignal; // TRint just caught a signal
40  TFileHandler *fInputHandler; // terminal input handler
41 
42  TRint(const TRint&) = delete;
43  TRint& operator=(const TRint&) = delete;
44 
45  void ExecLogon();
46  Longptr_t ProcessRemote(const char *line, Int_t *error = nullptr);
47  Longptr_t ProcessLineNr(const char* filestem, const char *line, Int_t *error = nullptr);
48 
49 public:
50  TRint(const char *appClassName, int *argc, char **argv,
51  void *options = 0, int numOptions = 0, Bool_t noLogo = kFALSE);
52  virtual ~TRint();
53  virtual char *GetPrompt();
54  virtual const char *SetPrompt(const char *newPrompt);
55  virtual void SetEchoMode(Bool_t mode);
56  virtual void HandleException(Int_t sig);
57  virtual Bool_t HandleTermInput();
58  virtual void PrintLogo(Bool_t lite = kFALSE);
59  virtual void Run(Bool_t retrn = kFALSE);
60  virtual void Terminate(int status);
61  void Interrupt() { fInterrupt = kTRUE; }
62  virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream& out);
63 
65 
66  ClassDef(TRint,0); //ROOT Interactive Application Interface
67 };
68 
69 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TRint::GetInputHandler
TFileHandler * GetInputHandler()
Definition: TRint.h:64
TRint::fInputHandler
TFileHandler * fInputHandler
Definition: TRint.h:40
TRint::fInterrupt
Bool_t fInterrupt
Definition: TRint.h:38
Int_t
int Int_t
Definition: RtypesCore.h:45
TRint::fPrompt
char fPrompt[64]
Definition: TRint.h:37
TRint::operator=
TRint & operator=(const TRint &)=delete
TRint::SetPrompt
virtual const char * SetPrompt(const char *newPrompt)
Set a new default prompt.
Definition: TRint.cxx:557
TRint::SetEchoMode
virtual void SetEchoMode(Bool_t mode)
Set console mode:
Definition: TRint.cxx:706
TString
Basic string class.
Definition: TString.h:136
TString.h
TRint::TabCompletionHook
virtual Int_t TabCompletionHook(char *buf, int *pLoc, std::ostream &out)
Forward tab completion request to our TTabCom::Hook().
Definition: TRint.cxx:773
bool
TRint::ExecLogon
void ExecLogon()
Execute logon macro's.
Definition: TRint.cxx:303
TRint::fCaughtSignal
Int_t fCaughtSignal
Definition: TRint.h:39
TApplication.h
TRint::HandleException
virtual void HandleException(Int_t sig)
Handle signals (kSigBus, kSigSegmentationViolation, kSigIllegalInstruction and kSigFloatingException)...
Definition: TRint.cxx:660
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TRint::ProcessRemote
Longptr_t ProcessRemote(const char *line, Int_t *error=nullptr)
Process the content of a line starting with ".R" (already stripped-off) The format is [user@]host[:di...
Definition: TRint.cxx:722
line
TLine * line
Definition: entrylistblock_figure1.C:235
TRint::Run
virtual void Run(Bool_t retrn=kFALSE)
Main application eventloop.
Definition: TRint.cxx:346
Longptr_t
long Longptr_t
Definition: RtypesCore.h:82
TRint::PrintLogo
virtual void PrintLogo(Bool_t lite=kFALSE)
Print the ROOT logo on standard output.
Definition: TRint.cxx:474
TRint::fNonContinuePrompt
TString fNonContinuePrompt
Definition: TRint.h:36
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TRint::fDefaultPrompt
TString fDefaultPrompt
Definition: TRint.h:35
TFileHandler
Definition: TSysEvtHandler.h:65
TRint::fNcmd
Int_t fNcmd
Definition: TRint.h:34
TRint::GetPrompt
virtual char * GetPrompt()
Get prompt from interpreter. Either "root [n]" or "end with '}'".
Definition: TRint.cxx:537
TRint::ProcessLineNr
Longptr_t ProcessLineNr(const char *filestem, const char *line, Int_t *error=nullptr)
Calls ProcessLine() possibly prepending a line directive for better diagnostics.
Definition: TRint.cxx:744
TApplication
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:39
TRint::~TRint
virtual ~TRint()
Destructor.
Definition: TRint.cxx:278
TRint::Terminate
virtual void Terminate(int status)
Terminate the application.
Definition: TRint.cxx:676
TRint::TRint
TRint(const TRint &)=delete
TRint
Definition: TRint.h:31
TRint::Interrupt
void Interrupt()
Definition: TRint.h:61
int
TRint::HandleTermInput
virtual Bool_t HandleTermInput()
Handle input coming from terminal.
Definition: TRint.cxx:573