DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Attributes | List of all members
dd4hep::sim::Geant4UIMessenger Class Reference

Generic implementation to export properties and actions to the Geant4 command prompt. More...

#include <DDG4/Geant4UIMessenger.h>

Inheritance diagram for dd4hep::sim::Geant4UIMessenger:
G4UImessenger

Public Types

typedef std::map< G4UIcommand *, std::string > Commands
 
typedef std::map< G4UIcommand *, CallbackActions
 

Public Member Functions

 Geant4UIMessenger (const std::string &name, const std::string &path)
 Initializing constructor. More...
 
virtual ~Geant4UIMessenger ()
 Default destructor. More...
 
void addCall (const std::string &name, const std::string &description, const Callback &cb, size_t npar=0)
 Add a new callback structure. More...
 
template<typename Q , typename R , typename T >
void addCall (const std::string &name, const std::string &description, Q *p, R(T::*f)())
 Add any callback without parameters to the messenger. More...
 
template<typename Q , typename R , typename T , typename A1 >
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. More...
 
void exportProperties (PropertyManager &mgr)
 Export all properties to the Geant4 UI. More...
 
void SetNewValue (G4UIcommand *c, G4String val) override
 Accept ne property value from Geant4 UI. More...
 
G4String GetCurrentValue (G4UIcommand *c) override
 Pass current property value to Geant4 UI. More...
 

Protected Attributes

G4UIdirectory * m_directory
 The UI directory of this component. More...
 
PropertyManagerm_properties
 Reference to the property manager corresponding to the component. More...
 
std::string m_name
 Component name. More...
 
std::string m_path
 Path in the UI hierarchy of this component. More...
 
Commands m_propertyCmd
 Property update command map. More...
 
Actions m_actionCmd
 Action map. More...
 

Detailed Description

Generic implementation to export properties and actions to the Geant4 command prompt.

Author
M.Frank
Version
1.0

Definition at line 35 of file Geant4UIMessenger.h.

Member Typedef Documentation

◆ Actions

typedef std::map<G4UIcommand*, Callback> dd4hep::sim::Geant4UIMessenger::Actions

Definition at line 38 of file Geant4UIMessenger.h.

◆ Commands

typedef std::map<G4UIcommand*, std::string> dd4hep::sim::Geant4UIMessenger::Commands

Definition at line 37 of file Geant4UIMessenger.h.

Constructor & Destructor Documentation

◆ Geant4UIMessenger()

Geant4UIMessenger::Geant4UIMessenger ( const std::string &  name,
const std::string &  path 
)

Initializing constructor.

Definition at line 46 of file Geant4UIMessenger.cpp.

◆ ~Geant4UIMessenger()

Geant4UIMessenger::~Geant4UIMessenger ( )
virtual

Default destructor.

Definition at line 54 of file Geant4UIMessenger.cpp.

Member Function Documentation

◆ addCall() [1/3]

void Geant4UIMessenger::addCall ( const std::string &  name,
const std::string &  description,
const Callback cb,
size_t  npar = 0 
)

Add a new callback structure.

Definition at line 60 of file Geant4UIMessenger.cpp.

◆ addCall() [2/3]

template<typename Q , typename R , typename T >
void dd4hep::sim::Geant4UIMessenger::addCall ( const std::string &  name,
const std::string &  description,
Q *  p,
R(T::*)()  f 
)
inline

Add any callback without parameters to the messenger.

Definition at line 62 of file Geant4UIMessenger.h.

◆ addCall() [3/3]

template<typename Q , typename R , typename T , typename A1 >
void dd4hep::sim::Geant4UIMessenger::addCall ( const std::string &  name,
const std::string &  description,
Q *  p,
R(T::*)(A1)  f 
)
inline

Add any callback with ONE parameter to the messenger.

Definition at line 68 of file Geant4UIMessenger.h.

◆ exportProperties()

void Geant4UIMessenger::exportProperties ( PropertyManager mgr)

Export all properties to the Geant4 UI.

Definition at line 78 of file Geant4UIMessenger.cpp.

◆ GetCurrentValue()

G4String Geant4UIMessenger::GetCurrentValue ( G4UIcommand *  c)
override

Pass current property value to Geant4 UI.

Definition at line 87 of file Geant4UIMessenger.cpp.

◆ SetNewValue()

void Geant4UIMessenger::SetNewValue ( G4UIcommand *  c,
G4String  val 
)
override

Accept ne property value from Geant4 UI.

Definition at line 99 of file Geant4UIMessenger.cpp.

Member Data Documentation

◆ m_actionCmd

Actions dd4hep::sim::Geant4UIMessenger::m_actionCmd
protected

Action map.

Definition at line 51 of file Geant4UIMessenger.h.

◆ m_directory

G4UIdirectory* dd4hep::sim::Geant4UIMessenger::m_directory
protected

The UI directory of this component.

Definition at line 41 of file Geant4UIMessenger.h.

◆ m_name

std::string dd4hep::sim::Geant4UIMessenger::m_name
protected

Component name.

Definition at line 45 of file Geant4UIMessenger.h.

◆ m_path

std::string dd4hep::sim::Geant4UIMessenger::m_path
protected

Path in the UI hierarchy of this component.

Definition at line 47 of file Geant4UIMessenger.h.

◆ m_properties

PropertyManager* dd4hep::sim::Geant4UIMessenger::m_properties
protected

Reference to the property manager corresponding to the component.

Definition at line 43 of file Geant4UIMessenger.h.

◆ m_propertyCmd

Commands dd4hep::sim::Geant4UIMessenger::m_propertyCmd
protected

Property update command map.

Definition at line 49 of file Geant4UIMessenger.h.


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