Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UIterminal Class Reference

#include <G4UIterminal.hh>

+ Inheritance 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 ()
 
virtual G4UIsessionSessionStart ()=0
 
virtual void PauseSessionStart (const G4String &Prompt)=0
 
- Public Member Functions inherited from G4UIsession
 G4UIsession ()
 
virtual ~G4UIsession ()
 
virtual G4UIsessionSessionStart ()
 
virtual void PauseSessionStart (const G4String &Prompt)
 
virtual G4int ReceiveG4cout (const G4String &coutString)
 
virtual G4int ReceiveG4cerr (const G4String &cerrString)
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()
 
virtual ~G4coutDestination ()
 
virtual G4int ReceiveG4cout (const G4String &)
 
virtual G4int ReceiveG4cerr (const G4String &)
 

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 &)
 
virtual void ExecuteCommand (const G4String &)
 
virtual G4bool GetHelpChoice (G4int &)=0
 
virtual void ExitHelp () const =0
 
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::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 G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51
#define FALSE
Definition: globals.hh:52

◆ ~G4UIterminal()

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}

Member Function Documentation

◆ PauseSessionStart()

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

◆ ReceiveG4cerr()

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}

◆ ReceiveG4cout()

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}

◆ SessionStart()

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}

◆ SetPrompt()

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)

Referenced by SetPrompt().


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