|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
14 #ifndef DDG4_GEANT4UIMESSENGER_H
15 #define DDG4_GEANT4UIMESSENGER_H
20 #include <G4UImessenger.hh>
21 #include <G4UIdirectory.hh>
37 typedef std::map<G4UIcommand*, std::string>
Commands;
38 typedef std::map<G4UIcommand*, Callback>
Actions;
59 void addCall(
const std::string& name,
const std::string& description,
const Callback& cb,
size_t npar=0);
61 template <
typename Q,
typename R,
typename T>
62 void addCall(
const std::string& name,
const std::string& description, Q* p, R (T::*f)()) {
67 template <
typename Q,
typename R,
typename T,
typename A1>
68 void addCall(
const std::string& name,
const std::string& description, Q* p, R (T::*f)(A1)) {
75 void SetNewValue(G4UIcommand *c, G4String val)
override;
83 #endif // DDG4_GEANT4UIMESSENGER_H
Geant4UIMessenger(const std::string &name, const std::string &path)
Initializing constructor.
void exportProperties(PropertyManager &mgr)
Export all properties to the Geant4 UI.
virtual ~Geant4UIMessenger()
Default destructor.
static void checkTypes(const std::type_info &typ1, const std::type_info &typ2, void *test)
Check the compatibility of two typed objects. The test is the result of a dynamic_cast.
std::map< G4UIcommand *, Callback > Actions
void addCall(const std::string &name, const std::string &description, Q *p, R(T::*f)(A1))
Add any callback with ONE parameter to the messenger.
std::string m_path
Path in the UI hierarchy of this component.
Class of the Geant4 toolkit. See http://www-geant4.kek.jp/Reference.
Actions m_actionCmd
Action map.
Definition of the generic callback structure for member functions.
Commands m_propertyCmd
Property update command map.
std::map< G4UIcommand *, std::string > Commands
PropertyManager * m_properties
Reference to the property manager corresponding to the component.
void SetNewValue(G4UIcommand *c, G4String val) override
Accept ne property value from Geant4 UI.
Manager to ease the handling of groups of properties.
Namespace for the AIDA detector description toolkit.
void addCall(const std::string &name, const std::string &description, const Callback &cb, size_t npar=0)
Add a new callback structure.
void addCall(const std::string &name, const std::string &description, Q *p, R(T::*f)())
Add any callback without parameters to the messenger.
std::string m_name
Component name.
G4UIdirectory * m_directory
The UI directory of this component.
G4String GetCurrentValue(G4UIcommand *c) override
Pass current property value to Geant4 UI.
Generic implementation to export properties and actions to the Geant4 command prompt.