Geant4-11
Functions | Variables
G4UIterminal.cc File Reference
#include "G4Types.hh"
#include "G4StateManager.hh"
#include "G4UIcommandTree.hh"
#include "G4UIcommand.hh"
#include "G4UIcommandStatus.hh"
#include "G4UIterminal.hh"
#include "G4UIcsh.hh"
#include <sstream>
#include <signal.h>

Go to the source code of this file.

Functions

static void SignalHandler (G4int)
 

Variables

static G4ThreadLocal G4VUIshelltheshell = 0
 

Function Documentation

◆ SignalHandler()

static void SignalHandler ( G4int  )
static

Definition at line 56 of file G4UIterminal.cc.

58{
60 G4ApplicationState state= stateManager-> GetCurrentState();
61
62 if(state==G4State_GeomClosed || state==G4State_EventProc) {
63 G4cout << "aborting Run ...";
65 G4cout << G4endl;
66 } else {
67 G4cout << G4endl
68 << "Session terminated." << G4endl;
69 theshell-> ResetTerminal();
70 G4Exception("G4UIterminal::SignalHandler()",
71 "UI0001",
73 "KeyboardInterrput with Ctrl-C");
74 }
75
76 // for original Unix / System V
77 signal(SIGINT, SignalHandler);
78}
G4ApplicationState
@ G4State_EventProc
@ G4State_GeomClosed
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
static G4ThreadLocal G4VUIshell * theshell
Definition: G4UIterminal.cc:49
static void SignalHandler(G4int)
Definition: G4UIterminal.cc:56
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static G4StateManager * GetStateManager()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

References G4UImanager::ApplyCommand(), FatalException, G4cout, G4endl, G4Exception(), G4State_EventProc, G4State_GeomClosed, G4StateManager::GetStateManager(), G4UImanager::GetUIpointer(), SignalHandler(), and theshell.

Referenced by G4UIterminal::G4UIterminal(), and SignalHandler().

Variable Documentation

◆ theshell

G4ThreadLocal G4VUIshell* theshell = 0
static

Definition at line 49 of file G4UIterminal.cc.

Referenced by G4UIterminal::G4UIterminal(), and SignalHandler().