Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4UIterminal Class Reference

#include <G4UIterminal.hh>

Inheritance diagram for G4UIterminal:
G4VBasicShell G4UIsession G4coutDestination

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 ()
 
virtual ~G4UIsession ()
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()
 
virtual ~G4coutDestination ()
 

Additional Inherited Members

- 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 &)
 

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.

References FALSE, and G4UImanager::GetUIpointer().

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 G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
#define FALSE
Definition: globals.hh:52
G4UIterminal::~G4UIterminal ( )

Definition at line 114 of file G4UIterminal.cc.

References G4UImanager::GetUIpointer().

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

Member Function Documentation

void G4UIterminal::PauseSessionStart ( const G4String msg)
virtual

Implements G4VBasicShell.

Definition at line 148 of file G4UIterminal.cc.

References TRUE.

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.

References TRUE.

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: