OMSim
Geant4 for IceCube optical module studies
OMSimUIinterface Class Reference

Singleton interface to Geant4's UI manager.

Public Member Functions

template<typename... Args>
void applyCommand (const std::string &p_command, const Args &...p_args)
 Apply a command to Geant4's UI manager and log it. It accept any number of arguments that are then appended; e.g. applyCommand("cmd", 1, 2, 3) will apply a UI command "cmd 1 2 3". More...
 
void setUI (G4UImanager *p_ui)
 Set the UI manager for the OMSimUIinterface class. More...
 
void runBeamOn (G4int p_numberOfEvents=-1)
 Executes a run with a given number of events. More...
 

Static Public Member Functions

static OMSimUIinterfacegetInstance ()
 
static void init ()
 Initializes the global instance of OMSimUIinterface This method is normally called in OMSim::initialiseSimulation.
 
static void shutdown ()
 Deletes the global instance of OMSimUIinterface This method is normally called in the destructor ~OMSim.
 

Private Member Functions

 OMSimUIinterface (const OMSimUIinterface &)=delete
 
OMSimUIinterfaceoperator= (const OMSimUIinterface &)=delete
 
void appendToStream (std::stringstream &p_stream)
 
template<typename T >
void appendToStream (std::stringstream &p_stream, const T &p_val)
 Append arguments to the command string p_stream. More...
 
template<typename T , typename... Args>
void appendToStream (std::stringstream &p_stream, const T &p_val, const Args &...p_args)
 Append multiple arguments to the command string p_stream. More...
 

Private Attributes

G4UImanager * m_uiManager
 

Member Function Documentation

◆ appendToStream() [1/2]

template<typename T >
void OMSimUIinterface::appendToStream ( std::stringstream &  p_stream,
const T &  p_val 
)
inlineprivate
Parameters
p_streamThe command string p_stream.
Template Parameters
TType of the argument to append.
Parameters
p_valThe value of the argument to append.

◆ appendToStream() [2/2]

template<typename T , typename... Args>
void OMSimUIinterface::appendToStream ( std::stringstream &  p_stream,
const T &  p_val,
const Args &...  p_args 
)
inlineprivate
Parameters
p_streamThe command string p_stream.
Template Parameters
TType of the first argument to append.
ArgsVariadic template for accepting multiple arguments.
Parameters
p_valThe value of the first argument to append.
p_argsThe values of the additional arguments to append.

◆ applyCommand()

template<typename... Args>
void OMSimUIinterface::applyCommand ( const std::string &  p_command,
const Args &...  p_args 
)
inline
Parameters
p_commandThe command string to execute.
p_args(Optional) additional arguments that will be appended to the command, one after the other.
Template Parameters
ArgsVariadic template for accepting multiple arguments.

◆ runBeamOn()

void OMSimUIinterface::runBeamOn ( G4int  p_numberOfEvents = -1)
Parameters
p_numberOfEventsAn optional parameter to specify the number of events to be run. If not provided or less than zero, the number of events is taken from the command arguments table.

◆ setUI()

void OMSimUIinterface::setUI ( G4UImanager *  p_ui)
Parameters
p_uiPointer to the G4UImanager.

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