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

#include <G4UIbridge.hh>

Public Member Functions

 G4UIbridge (G4UImanager *localUI, G4String dir)
 
 ~G4UIbridge ()=default
 
G4int ApplyCommand (const G4String &aCmd)
 
G4UImanagerLocalUI () const
 
const G4StringDirName () const
 
G4int DirLength () const
 

Detailed Description

Definition at line 46 of file G4UIbridge.hh.

Constructor & Destructor Documentation

◆ G4UIbridge()

G4UIbridge::G4UIbridge ( G4UImanager localUI,
G4String  dir 
)

Definition at line 34 of file G4UIbridge.cc.

35 : localUImanager(localUI)
36{
37 // make sure dirName starts and ends with '/'
38 if(dir[0] == '/')
39 {
40 dirName = dir;
41 }
42 else
43 {
44 dirName = "/" + dir;
45 }
46 if(dirName.back() != '/')
47 {
48 dirName += "/";
49 }
50
51 // register to the master G4UImanager
53 if(masterUI != nullptr)
54 {
55 masterUI->RegisterBridge(this);
56 }
57 else
58 {
59 G4Exception("G4UIbridge::G4UIbridge()", "UI7001", FatalException,
60 "G4UImanager for the master thread is not yet instantiated. "
61 "Instantiate G4MTRunManager first.");
62 }
63}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
static G4UImanager * GetMasterUIpointer()
Definition: G4UImanager.cc:91
void RegisterBridge(G4UIbridge *brg)
Definition: G4UImanager.cc:870

◆ ~G4UIbridge()

G4UIbridge::~G4UIbridge ( )
default

Member Function Documentation

◆ ApplyCommand()

G4int G4UIbridge::ApplyCommand ( const G4String aCmd)

Definition at line 66 of file G4UIbridge.cc.

67{
68 return localUImanager->ApplyCommand(aCmd);
69}
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:495

◆ DirLength()

G4int G4UIbridge::DirLength ( ) const
inline

Definition at line 57 of file G4UIbridge.hh.

57{ return (G4int)dirName.length(); }
int G4int
Definition: G4Types.hh:85

◆ DirName()

const G4String & G4UIbridge::DirName ( ) const
inline

Definition at line 56 of file G4UIbridge.hh.

56{ return dirName; }

◆ LocalUI()

G4UImanager * G4UIbridge::LocalUI ( ) const
inline

Definition at line 55 of file G4UIbridge.hh.

55{ return localUImanager; }

Referenced by G4UImanager::RegisterBridge().


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