Geant4 10.7.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 ()
 
 G4UIsession (G4int iBatch)
 
virtual ~G4UIsession ()
 
virtual G4UIsessionSessionStart ()
 
virtual void PauseSessionStart (const G4String &Prompt)
 
virtual G4int ReceiveG4cout (const G4String &coutString)
 
virtual G4int ReceiveG4cerr (const G4String &cerrString)
 
G4int GetLastReturnCode () const
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()=default
 
virtual ~G4coutDestination ()
 
void AddCoutTransformer (const Transformer &t)
 
void AddCoutTransformer (Transformer &&t)
 
void AddCerrTransformer (const Transformer &t)
 
void AddCerrTransformer (Transformer &&t)
 
virtual void ResetTransformers ()
 
virtual G4int ReceiveG4cout (const G4String &msg)
 
virtual G4int ReceiveG4cerr (const G4String &msg)
 
G4int ReceiveG4cout_ (const G4String &msg)
 
G4int ReceiveG4cerr_ (const G4String &msg)
 

Additional Inherited Members

- Public Types inherited from G4coutDestination
using Transformer = std::function< G4bool(G4String &)>
 
- 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 &)
 
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 &)
 
- Protected Attributes inherited from G4UIsession
G4int ifBatch = 0
 
G4int lastRC = 0
 
- Protected Attributes inherited from G4coutDestination
std::vector< TransformertransformersCout
 
std::vector< TransformertransformersCerr
 
- Static Protected Attributes inherited from G4UIsession
static G4ICOMS_DLL G4int inSession = 0
 
- Static Protected Attributes inherited from G4coutDestination
static G4MTGLOB_DLL G4coutDestinationmasterG4coutDestination = nullptr
 

Detailed Description

Definition at line 70 of file G4UIterminal.hh.

Constructor & Destructor Documentation

◆ G4UIterminal()

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

Definition at line 90 of file G4UIterminal.cc.

92{
94 UI-> SetSession(this);
95 UI-> SetCoutDestination(this);
96
97 iExit= FALSE;
98 iCont= FALSE;
99
100 if(aShell) shell= aShell;
101 else shell= new G4UIcsh;
102 theshell= shell; // locally stored for the signal handler
103
104 // add signal handler
105 if(qsig) {
106#ifndef WIN32
107 signal(SIGINT, SignalHandler);
108#endif
109 }
110}
#define FALSE
Definition: Globals.hh:23
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

◆ ~G4UIterminal()

G4UIterminal::~G4UIterminal ( )

Definition at line 113 of file G4UIterminal.cc.

115{
116 if(shell) delete shell;
117
119 UI-> SetSession(NULL);
120 UI-> SetCoutDestination(NULL);
121 }
122}

Member Function Documentation

◆ PauseSessionStart()

void G4UIterminal::PauseSessionStart ( const G4String msg)
virtual

Implements G4VBasicShell.

Definition at line 147 of file G4UIterminal.cc.

149{
150 iCont= TRUE;
151
152 G4String newCommand= GetCommand(msg);
153 while(iCont){
154 ExecuteCommand(newCommand);
155 newCommand= GetCommand(msg);
156 }
157}
#define TRUE
Definition: Globals.hh:27

◆ ReceiveG4cerr()

G4int G4UIterminal::ReceiveG4cerr ( const G4String cerrString)
virtual

Reimplemented from G4UIsession.

Definition at line 314 of file G4UIterminal.cc.

316{
317 std::cerr << cerrString << std::flush;
318 return 0;
319}

◆ ReceiveG4cout()

G4int G4UIterminal::ReceiveG4cout ( const G4String coutString)
virtual

Reimplemented from G4UIsession.

Definition at line 306 of file G4UIterminal.cc.

308{
309 std::cout << coutString << std::flush;
310 return 0;
311}

◆ SessionStart()

G4UIsession * G4UIterminal::SessionStart ( )
virtual

Implements G4VBasicShell.

Definition at line 133 of file G4UIterminal.cc.

135{
136 iExit= TRUE;
137
138 G4String newCommand= GetCommand();
139 while(iExit){
140 ExecuteCommand(newCommand);
141 newCommand= GetCommand();
142 }
143 return NULL;
144}

◆ SetPrompt()

void G4UIterminal::SetPrompt ( const G4String prompt)

Definition at line 126 of file G4UIterminal.cc.

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

Referenced by SetPrompt().


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