31 except(
"createProcessor",
"++ DD4hep-plugins: No processor creator name given!");
33 for(
int i=0; i<argc; ++i) {
34 if ( 0 == ::strncmp(argv[i],
"-processor",4) ) {
35 std::vector<char*> args;
36 std::string fac = argv[++i];
37 for(
int j=++i; j<argc && argv[j] &&
38 0 != ::strncmp(argv[j],
"-processor",4) &&
39 0 != ::strncmp(argv[j],
"-end-processor",8); ++j)
40 args.push_back(argv[j]);
41 int num_arg = int(args.size());
43 processor = PluginService::Create<void*>(fac,&lcdd,num_arg,&args[0]);
46 processor = PluginService::Create<void*>(fac, &lcdd, argc, argv);
48 except(
"createProcessor",
"DD4hep-plugins: Failed to locate plugin %s. \n%s.",
53 void* obj = cast(processor);
54 if ( obj )
return obj;
62 "DD4hep-plugins: Found arguments in plugin call, but could not make any sense of them: %s",
69 void*
object = PluginService::Create<void*>(factory, &lcdd, argc, argv);
72 object = PluginService::Create<void*>(factory, &lcdd, argc, argv);
74 except(
"ConditionsManager",
"DD4hep-plugins: Failed to locate plugin %s. \n%s.",
79 void* obj = cast(
object);
80 if ( obj )
return obj;
96 const std::string& arg,
97 void* (*cast)(
void*)) {
98 char* argv[] = { (
char*)arg.c_str(), 0 };
std::string missingFactory(const std::string &name) const
Helper to check factory existence.
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
void invalidHandleAssignmentError(const std::type_info &from, const std::type_info &to)
Throw exception when handles are badly assigned.
Helper to debug plugin manager calls.
static ComponentCast * component(void *p)
void * createPlugin(const std::string &factory, Geometry::LCDD &lcdd, int argc, char **argv, void *(*cast)(void *))
Class to perform dynamic casts using unknown pointers.
void * createProcessor(Geometry::LCDD &lcdd, int argc, char **argv, void *(*cast)(void *))
The main interface to the DD4hep detector description package.
std::string arguments(int argc, char **argv)
Helper function to serialize argument list to a single string.