6 pluginManager_(thePluginManager) {
8 pluginDir_ =
new G4UIdirectory(
"/slic/plugins/");
9 pluginDir_->SetGuidance(
"Commands for controlling LDMX sim plugins");
11 loadCmd_ =
new G4UIcommand(
"/slic/plugins/load",
this);
12 loadCmd_->AvailableForStates(G4ApplicationState::G4State_PreInit, G4ApplicationState::G4State_Idle);
13 loadCmd_->SetGuidance(
"Load a sim plugin from a shared library. A plugin of a specific type may only be loaded once.");
14 G4UIparameter* pluginName =
new G4UIparameter(
"pluginName",
's',
false);
15 pluginName->SetGuidance(
"Name of plugin to load.");
17 G4UIparameter* libName =
new G4UIparameter(
"libName",
's',
true);
18 libName->SetGuidance(
"Name of plugin library; if omitted will use the 'libSimPlugins.so' library.");
21 destroyCmd_ =
new G4UIcommand(
"/slic/plugins/destroy",
this);
22 destroyCmd_->SetGuidance(
"Destroy a loaded plugin by name.");
23 destroyCmd_->AvailableForStates(G4ApplicationState::G4State_Idle);
24 pluginName =
new G4UIparameter(
"pluginName",
's',
false);
25 pluginName->SetGuidance(
"Name of plugin to destroy.");
28 listCmd_ =
new G4UIcommand(
"/slic/plugins/list",
this);
29 listCmd_->SetGuidance(
"List currently loaded plugins.");
30 listCmd_->AvailableForStates(G4ApplicationState::G4State_Idle, G4ApplicationState::G4State_PreInit);
42 std::istringstream is((
const char*) newValues);
43 std::string pluginName, libName;
45 is >> pluginName >> libName;
47 if (libName.size() == 0 || libName ==
"") {
48 libName =
"libslicPlugins.so";
Manages user sim plugins.
std::ostream & print(std::ostream &os)
void destroy(const std::string &pluginName)
void create(const std::string &pluginName, const std::string &libName)
virtual ~PluginMessenger()
PluginMessenger(PluginManager *mgr)
G4UIdirectory * pluginDir_
void SetNewValue(G4UIcommand *command, G4String newValues)
PluginManager * pluginManager_
G4UIcommand * destroyCmd_