42 virtual const char*
what()
const throw() {
43 return "G4InvalidUICommand: command does not exists or is of invalid type";
51 size_t pos = dir.find_last_of(
'/', dir.size()-2);
52 while(pos != 0 && pos != std::string::npos) {
55 guidance += dir.substr(1,pos-1);
57 pos = dir.find_last_of(
'/', pos-1);
65 for (std::map<G4String, Property>::iterator i =
properties.begin(); i !=
properties.end(); i++)
delete i->second.command;
66 for (std::map<G4String, Method>::iterator i =
methods.begin(); i !=
methods.end(); i++)
delete i->second.command;
77 var.
TypeInfo() ==
typeid(
unsigned int) || var.
TypeInfo() ==
typeid(
unsigned long)) ptype =
'i';
78 else if(var.
TypeInfo() ==
typeid(float) || var.
TypeInfo() ==
typeid(double)) ptype =
'd';
79 else if(var.
TypeInfo() ==
typeid(bool)) ptype =
'b';
90 {
return DeclareProperty(name,var,doc); }
116 for (
size_t i = 0; i < fun.
NArg(); i++) {
127 ed<<
"G4GenericMessenger::DeclareMethodWithUnit() does not support a method that has more than\n"
128 <<
"one arguments (or no argument). Please use G4GenericMessenger::DeclareMethod method for\n"
129 <<
"your command <"<<fullpath<<
">.";
136 return methods[
name] =
Method(fun,
object, cmd);
146 G4cout<<
" GetCurrentValue() is not available for a command defined by G4GenericMessenger::DeclareMethod()."<<
G4endl;
192 ed<<
"G4GenericMessenger::Command::SetUnit() is thread-unsafe and should not be used\n"
193 <<
"in multi-threaded mode. For your command <"<<cmdpath<<
">, use\n"
194 <<
" DeclarePropertyWithUnit(const G4String& name, const G4String& defaultUnit,\n"
195 <<
" const G4AnyType& variable, const G4String& doc)\n"
197 <<
" DeclareMethodWithUnit(const G4String& name, const G4String& defaultUnit,\n"
198 <<
" const G4AnyType& variable, const G4String& doc)\n"
199 <<
"to define a command with a unit <"<<unit<<
">.";
200 if(spec!=
UnitDefault) { ed<<
"\nPlease use a default unit instead of unit category."; }
208 std::vector<G4String> guidance;
216 if (*
type ==
typeid(
float) || *
type ==
typeid(
double) ) {
230 G4cerr <<
"Only parameters of type <double> or <float> can be associated with units" <<
G4endl;