17 map<string, VuoModuleCompiler::Factory> *VuoModuleCompiler::factories;
22 void __attribute__((constructor)) VuoModuleCompiler::init()
24 factories =
new map<string, VuoModuleCompiler::Factory>;
27 for (
auto module : modules)
28 dlopen(module->path().c_str(), RTLD_NOW);
38 auto existingFactory = factories->find(type);
39 if (existingFactory != factories->end())
41 VUserLog(
"Error: A VuoModuleCompiler for type '%s' is already registered. Ignoring the duplicate.", type.c_str());
45 (*factories)[type] = factory;
53 auto factory = factories->find(type);
54 if (factory == factories->end())
56 VUserLog(
"Error creating compiler for '%s': Couldn't find a VuoModuleCompiler for type '%s'.", moduleKey.c_str(), type.c_str());
60 return factory->second(moduleKey, sourceFile);
63 VuoModuleCompiler::~VuoModuleCompiler(
void)