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

#include <G4ExceptionHandlerMessenger.hh>

Inheritance diagram for G4ExceptionHandlerMessenger:

Public Member Functions

 G4ExceptionHandlerMessenger (G4ExceptionHandler *expH)
 ~G4ExceptionHandlerMessenger () override
void SetNewValue (G4UIcommand *command, G4String newValues) override
G4String GetCurrentValue (G4UIcommand *command) override
Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
virtual ~G4UImessenger ()
G4bool CommandsShouldBeInMaster () const

Additional Inherited Members

Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
G4String LtoS (G4long l)
G4String DtoS (G4double a)
G4String BtoS (G4bool b)
G4int StoI (const G4String &s)
G4long StoL (const G4String &s)
G4double StoD (const G4String &s)
G4bool StoB (const G4String &s)
void AddUIcommand (G4UIcommand *newCommand)
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
template<typename T>
T * CreateCommand (const G4String &cname, const G4String &dsc)
Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
G4String baseDirName = ""
G4bool commandsShouldBeInMaster = false

Detailed Description

Definition at line 45 of file G4ExceptionHandlerMessenger.hh.

Constructor & Destructor Documentation

◆ G4ExceptionHandlerMessenger()

G4ExceptionHandlerMessenger::G4ExceptionHandlerMessenger ( G4ExceptionHandler * expH)

Definition at line 41 of file G4ExceptionHandlerMessenger.cc.

42: expHandler(expH)
43{
44 EHDirectory = new G4UIdirectory("/control/exception/");
45 EHDirectory->SetGuidance("Managing number of G4Exception warning messages");
46
47 nwCmd = new G4UIcommand("/control/exception/maxExceptionWarning",this);
48 nwCmd->SetGuidance("Set maximum number of G4Exception warning messages to be displayed");
49 nwCmd->SetGuidance("for the specified error code.");
50 nwCmd->SetGuidance("Number of warnings is counted for each thread individually.");
51 nwCmd->SetGuidance("Once the number reaches to the maximum, the warning message of specified");
52 nwCmd->SetGuidance("error code won't be printed out any more.");
53 nwCmd->SetGuidance("Number is counted through the program execution if more than one run");
54 nwCmd->SetGuidance("are executed. Count can be reset with the same command.");
55 nwCmd->SetGuidance("If number is set to zero, warning message of the specified error code");
56 nwCmd->SetGuidance("won't be displayed at all.");
57 nwCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
58 auto p1 = new G4UIparameter("errorCode",'s',false);
59 nwCmd->SetParameter(p1);
60 auto p2 = new G4UIparameter("maxNumber",'i',false);
61 p2->SetParameterRange("maxNumber >= 0");
62 nwCmd->SetParameter(p2);
63
64 tnwCmd = new G4UIcmdWithAnInteger("/control/exception/maxTotalExceptionWarning",this);
65 tnwCmd->SetGuidance("Set total maximum number of G4Exception warning messages to be displayed.");
66 tnwCmd->SetGuidance("Number of warnings is counted for each thread individually.");
67 tnwCmd->SetGuidance("Once the number reaches to the maximum, warning messages won't be");
68 tnwCmd->SetGuidance("printed out any more.");
69 tnwCmd->SetGuidance("Number is counted through the program execution if more than one run");
70 tnwCmd->SetGuidance("are executed. Count can be reset with the same command.");
71 tnwCmd->SetGuidance("If number is set to zero, warning message won't be displayed at all.");
72 tnwCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
73 tnwCmd->SetParameterName("maxNumber",false);
74 tnwCmd->SetRange("maxNumber >= 0");
75
76}
@ G4State_Idle
@ G4State_PreInit

◆ ~G4ExceptionHandlerMessenger()

G4ExceptionHandlerMessenger::~G4ExceptionHandlerMessenger ( )
override

Definition at line 79 of file G4ExceptionHandlerMessenger.cc.

80{
81 delete nwCmd;
82 delete tnwCmd;
83 delete EHDirectory;
84}

Member Function Documentation

◆ GetCurrentValue()

G4String G4ExceptionHandlerMessenger::GetCurrentValue ( G4UIcommand * command)
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 101 of file G4ExceptionHandlerMessenger.cc.

102{
103 G4String cv;
104 return cv;
105}

◆ SetNewValue()

void G4ExceptionHandlerMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 87 of file G4ExceptionHandlerMessenger.cc.

88{
89 if (command == nwCmd) {
90 G4Tokenizer next(newValue);
91 G4String ec = next();
92 G4int mc = StoI(next());
93 expHandler->SetMaxWarning(ec,mc);
94 }
95 else if (command == tnwCmd) {
96 expHandler->SetMaxTotalWarning(tnwCmd->GetNewIntValue(newValue));
97 }
98}
int G4int
Definition G4Types.hh:85
G4int StoI(const G4String &s)

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