15 #ifndef DD4HEP_PLUGINCREATORS_H
16 #define DD4HEP_PLUGINCREATORS_H 1
36 void*
createPlugin(
const std::string& factory, Detector& description,
void* (*cast)(
void*));
37 void*
createPlugin(
const std::string& factory, Detector& description,
const std::string& arg,
void* (*cast)(
void*));
38 void*
createPlugin(
const std::string& factory, Detector& description,
int argc,
char** argv,
void* (*cast)(
void*));
39 void*
createProcessor(Detector& description,
int argc,
char** argv,
void* (*cast)(
void*));
43 struct __cast{
static void* cast(
void* p) {
return &
dynamic_cast<T&
>(*(T*)p); } };
44 return (T*)
createPlugin(factory, description, __cast::cast);
47 template <
typename T> T*
createPlugin(
const std::string& factory,
Detector& description,
const std::string& arg) {
48 struct __cast{
static void* cast(
void* p) {
return &
dynamic_cast<T&
>(*(T*)p); } };
49 return (T*)
createPlugin(factory, description, arg, __cast::cast);
52 template <
typename T> T*
createPlugin(
const std::string& factory,
Detector& description,
int argc,
const void** argv) {
53 struct __cast{
static void* cast(
void* p) {
return &
dynamic_cast<T&
>(*(T*)p); } };
54 return (T*)
createPlugin(factory, description, argc, (
char**)argv, __cast::cast);
59 struct __cast{
static void* cast(
void* p) {
return &
dynamic_cast<T&
>(*(T*)p); } };
65 struct __cast{
static void* cast(
void* p) {
return &
dynamic_cast<T&
>(*(T*)p); } };
66 return (T*)
createProcessor(description, argc, (
char**)argv, __cast::cast);
71 #endif // DD4HEP_PLUGINCREATORS_H