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)

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().

00093 {
00094   UI= G4UImanager::GetUIpointer();
00095   UI-> SetSession(this);
00096   UI-> SetCoutDestination(this);
00097 
00098   iExit= FALSE;
00099   iCont= FALSE;
00100 
00101   if(aShell) shell= aShell;
00102   else shell= new G4UIcsh;
00103   theshell= shell; // locally stored for the signal handler
00104 
00105   // add signal handler
00106   if(qsig) {
00107 #ifndef WIN32
00108   signal(SIGINT, SignalHandler);
00109 #endif
00110   }
00111 }

G4UIterminal::~G4UIterminal (  ) 

Definition at line 114 of file G4UIterminal.cc.

References G4UImanager::GetUIpointer().

00116 { 
00117   if(shell) delete shell;
00118 
00119   if(G4UImanager::GetUIpointer()) {
00120     UI-> SetSession(NULL);
00121     UI-> SetCoutDestination(NULL);
00122   }
00123 }


Member Function Documentation

void G4UIterminal::PauseSessionStart ( const G4String msg  )  [virtual]

Implements G4VBasicShell.

Definition at line 148 of file G4UIterminal.cc.

References TRUE.

00150 {
00151   iCont= TRUE;
00152 
00153   G4String newCommand= GetCommand(msg);
00154   while(iCont){
00155     ExecuteCommand(newCommand);
00156     newCommand= GetCommand(msg);
00157   }
00158 }

G4int G4UIterminal::ReceiveG4cerr ( const G4String cerrString  )  [virtual]

Reimplemented from G4UIsession.

Definition at line 315 of file G4UIterminal.cc.

00317 {
00318   std::cerr << cerrString << std::flush;
00319   return 0;
00320 }

G4int G4UIterminal::ReceiveG4cout ( const G4String coutString  )  [virtual]

Reimplemented from G4UIsession.

Definition at line 307 of file G4UIterminal.cc.

00309 {
00310   std::cout << coutString << std::flush;
00311   return 0;
00312 }

G4UIsession * G4UIterminal::SessionStart (  )  [virtual]

Implements G4VBasicShell.

Definition at line 134 of file G4UIterminal.cc.

References TRUE.

00136 {
00137   iExit= TRUE;
00138 
00139   G4String newCommand= GetCommand();
00140   while(iExit){
00141     ExecuteCommand(newCommand);
00142     newCommand= GetCommand();
00143   }
00144   return NULL;
00145 }

void G4UIterminal::SetPrompt ( const G4String prompt  ) 

Definition at line 127 of file G4UIterminal.cc.

00129 {
00130   shell-> SetPrompt(prompt);
00131 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:37 2013 for Geant4 by  doxygen 1.4.7