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

#include <G4UIsession.hh>

+ Inheritance diagram for G4UIsession:

Public Member Functions

 G4UIsession ()
 
 G4UIsession (G4int iBatch)
 
 ~G4UIsession () override
 
virtual G4UIsessionSessionStart ()
 
virtual void PauseSessionStart (const G4String &Prompt)
 
G4int ReceiveG4debug (const G4String &debugString) override
 
G4int ReceiveG4cout (const G4String &coutString) override
 
G4int ReceiveG4cerr (const G4String &cerrString) override
 
G4int GetLastReturnCode () const
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()=default
 
virtual ~G4coutDestination ()=default
 
void AddDebugTransformer (const Transformer &t)
 
void AddDebugTransformer (Transformer &&t)
 
void AddCoutTransformer (const Transformer &t)
 
void AddCoutTransformer (Transformer &&t)
 
void AddCerrTransformer (const Transformer &t)
 
void AddCerrTransformer (Transformer &&t)
 
virtual void ResetTransformers ()
 
G4int ReceiveG4debug_ (const G4String &msg)
 
G4int ReceiveG4cout_ (const G4String &msg)
 
G4int ReceiveG4cerr_ (const G4String &msg)
 

Static Public Member Functions

static G4int InSession ()
 

Protected Attributes

G4int ifBatch = 0
 
G4int lastRC = 0
 
- Protected Attributes inherited from G4coutDestination
std::vector< TransformertransformersDebug
 
std::vector< TransformertransformersCout
 
std::vector< TransformertransformersCerr
 

Static Protected Attributes

static G4ICOMS_DLL G4int inSession = 0
 
- Static Protected Attributes inherited from G4coutDestination
static G4MTGLOB_DLL G4coutDestinationmasterG4coutDestination = nullptr
 

Additional Inherited Members

- Public Types inherited from G4coutDestination
using Transformer = std::function<G4bool(G4String&)>
 

Detailed Description

Definition at line 43 of file G4UIsession.hh.

Constructor & Destructor Documentation

◆ G4UIsession() [1/2]

G4UIsession::G4UIsession ( )

Definition at line 36 of file G4UIsession.cc.

37{
38 ++inSession;
39}
static G4ICOMS_DLL G4int inSession

◆ G4UIsession() [2/2]

G4UIsession::G4UIsession ( G4int iBatch)

Definition at line 42 of file G4UIsession.cc.

42: ifBatch(iBatch) {}

◆ ~G4UIsession()

G4UIsession::~G4UIsession ( )
override

Definition at line 45 of file G4UIsession.cc.

46{
47 if (ifBatch == 0) {
48 --inSession;
49 }
50}

Member Function Documentation

◆ GetLastReturnCode()

G4int G4UIsession::GetLastReturnCode ( ) const
inline

Definition at line 64 of file G4UIsession.hh.

64{ return lastRC; }

◆ InSession()

G4int G4UIsession::InSession ( )
static

Definition at line 62 of file G4UIsession.cc.

63{
64 return inSession;
65}

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ PauseSessionStart()

void G4UIsession::PauseSessionStart ( const G4String & Prompt)
virtual

Reimplemented in G4UIbatch, G4UIQt, G4UIterminal, G4UIWin32, G4UIXm, and G4VBasicShell.

Definition at line 59 of file G4UIsession.cc.

59{}

◆ ReceiveG4cerr()

G4int G4UIsession::ReceiveG4cerr ( const G4String & cerrString)
overridevirtual

Reimplemented from G4coutDestination.

Reimplemented in G4UIterminal, G4UIWin32, and G4UIXm.

Definition at line 82 of file G4UIsession.cc.

83{
84 std::cerr << cerrString << std::flush;
85 return 0;
86}

◆ ReceiveG4cout()

G4int G4UIsession::ReceiveG4cout ( const G4String & coutString)
overridevirtual

Reimplemented from G4coutDestination.

Reimplemented in G4UIterminal, G4UIWin32, and G4UIXm.

Definition at line 75 of file G4UIsession.cc.

76{
77 std::cout << coutString << std::flush;
78 return 0;
79}

◆ ReceiveG4debug()

G4int G4UIsession::ReceiveG4debug ( const G4String & debugString)
overridevirtual

Reimplemented from G4coutDestination.

Reimplemented in G4UIterminal, G4UIWin32, and G4UIXm.

Definition at line 68 of file G4UIsession.cc.

69{
70 std::cout << coutString << std::flush;
71 return 0;
72}

◆ SessionStart()

G4UIsession * G4UIsession::SessionStart ( )
virtual

Reimplemented in G4UIbatch, G4UIQt, G4UIterminal, G4UIWin32, G4UIXm, and G4VBasicShell.

Definition at line 53 of file G4UIsession.cc.

54{
55 return nullptr;
56}

Member Data Documentation

◆ ifBatch

G4int G4UIsession::ifBatch = 0
protected

Definition at line 68 of file G4UIsession.hh.

Referenced by ~G4UIsession().

◆ inSession

G4int G4UIsession::inSession = 0
staticprotected

Definition at line 67 of file G4UIsession.hh.

Referenced by G4UIsession(), InSession(), and ~G4UIsession().

◆ lastRC

G4int G4UIsession::lastRC = 0
protected

Definition at line 69 of file G4UIsession.hh.

Referenced by GetLastReturnCode(), and G4UIbatch::SessionStart().


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