Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UIterminal Class Reference

#include <G4UIterminal.hh>

Inheritance diagram for G4UIterminal:
Collaboration diagram for G4UIterminal:

Public Member Functions

 G4UIterminal (G4VUIshell *aShell=0, G4bool qsig=true)
 
 ~G4UIterminal ()
 
void SetPrompt (const G4String &prompt)
 
virtual G4UIsessionSessionStart ()
 
virtual void PauseSessionStart (const G4String &msg)
 
virtual G4int ReceiveG4cout (const G4String &coutString)
 
virtual G4int ReceiveG4cerr (const G4String &cerrString)
 
- Public Member Functions inherited from G4VBasicShell
 G4VBasicShell ()
 
virtual ~G4VBasicShell ()
 
- Public Member Functions inherited from G4UIsession
 G4UIsession ()
 
 G4UIsession (G4int iBatch)
 
virtual ~G4UIsession ()
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()
 
virtual ~G4coutDestination ()
 

Additional Inherited Members

- Static Public Member Functions inherited from G4UIsession
static G4int InSession ()
 
- Protected Member Functions inherited from G4VBasicShell
G4String ModifyToFullPathCommand (const char *aCommandLine) const
 
G4String GetCurrentWorkingDirectory () const
 
G4bool ChangeDirectory (const char *newDir)
 
G4UIcommandTreeFindDirectory (const char *dirName) const
 
G4UIcommandFindCommand (const char *commandName) const
 
G4String Complete (const G4String &)
 
G4String FindMatchingPath (G4UIcommandTree *, const G4String &)
 
void ApplyShellCommand (const G4String &, G4bool &, G4bool &)
 
void ShowCurrent (const G4String &) const
 
void ChangeDirectoryCommand (const G4String &)
 
void ListDirectory (const G4String &) const
 
void TerminalHelp (const G4String &)
 
- Protected Attributes inherited from G4UIsession
G4int ifBatch
 
- Static Protected Attributes inherited from G4UIsession
static G4int inSession = 0
 
- Static Protected Attributes inherited from G4coutDestination
static G4coutDestinationmasterG4coutDestination = 0
 

Detailed Description

Definition at line 71 of file G4UIterminal.hh.

Constructor & Destructor Documentation

G4UIterminal::G4UIterminal ( G4VUIshell aShell = 0,
G4bool  qsig = true 
)

Definition at line 91 of file G4UIterminal.cc.

93 {
95  UI-> SetSession(this);
96  UI-> SetCoutDestination(this);
97 
98  iExit= FALSE;
99  iCont= FALSE;
100 
101  if(aShell) shell= aShell;
102  else shell= new G4UIcsh;
103  theshell= shell; // locally stored for the signal handler
104 
105  // add signal handler
106  if(qsig) {
107 #ifndef WIN32
108  signal(SIGINT, SignalHandler);
109 #endif
110  }
111 }
static G4ThreadLocal G4VUIshell * theshell
Definition: G4UIterminal.cc:50
static void SignalHandler(G4int)
Definition: G4UIterminal.cc:57
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
#define FALSE
Definition: globals.hh:52

Here is the call graph for this function:

G4UIterminal::~G4UIterminal ( )

Definition at line 114 of file G4UIterminal.cc.

116 {
117  if(shell) delete shell;
118 
120  UI-> SetSession(NULL);
121  UI-> SetCoutDestination(NULL);
122  }
123 }
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59

Here is the call graph for this function:

Member Function Documentation

void G4UIterminal::PauseSessionStart ( const G4String msg)
virtual

Implements G4VBasicShell.

Definition at line 148 of file G4UIterminal.cc.

150 {
151  iCont= TRUE;
152 
153  G4String newCommand= GetCommand(msg);
154  while(iCont){
155  ExecuteCommand(newCommand);
156  newCommand= GetCommand(msg);
157  }
158 }
#define TRUE
Definition: globals.hh:55
G4int G4UIterminal::ReceiveG4cerr ( const G4String cerrString)
virtual

Reimplemented from G4UIsession.

Definition at line 315 of file G4UIterminal.cc.

317 {
318  std::cerr << cerrString << std::flush;
319  return 0;
320 }
G4int G4UIterminal::ReceiveG4cout ( const G4String coutString)
virtual

Reimplemented from G4UIsession.

Definition at line 307 of file G4UIterminal.cc.

309 {
310  std::cout << coutString << std::flush;
311  return 0;
312 }
G4UIsession * G4UIterminal::SessionStart ( )
virtual

Implements G4VBasicShell.

Definition at line 134 of file G4UIterminal.cc.

136 {
137  iExit= TRUE;
138 
139  G4String newCommand= GetCommand();
140  while(iExit){
141  ExecuteCommand(newCommand);
142  newCommand= GetCommand();
143  }
144  return NULL;
145 }
#define TRUE
Definition: globals.hh:55
void G4UIterminal::SetPrompt ( const G4String prompt)

Definition at line 127 of file G4UIterminal.cc.

129 {
130  shell-> SetPrompt(prompt);
131 }
void SetPrompt(const G4String &prompt)

The documentation for this class was generated from the following files: