void init() { if (plugin.open(settings)) { dev.open(*plugin.getFactory()); settings.setLibraryMethodName(plugin.getFactory()->getName(), settings.getMethodName()); settings.setClassInfo(plugin.getFactory()->getClassName(), plugin.getFactory()->getBaseClassName()); } }
void init() { YarpPluginSelector selector; selector.scan(); settings.setSelector(selector); if (plugin.open(settings)) { car.open(*plugin.getFactory()); settings.setLibraryMethodName(plugin.getFactory()->getName(), settings.getMethodName()); } }
int main() { YarpPluginSettings settings; settings.setLibraryMethodName("hoopy","hoopy"); YarpPlugin<Handler> handler; if (!handler.open(settings)) { settings.reportFailure(); printf("Maybe set LD_LIBRARY_PATH or equivalent.\n"); return 1; } printf("Found handler!\n"); Handler *hoopy = handler.create(); if (!hoopy) { printf("Failed to create handler\n"); return 1; } int result = hoopy->hello(); printf("Result is %d\n", result); handler.destroy(hoopy); return 0; }
StubCarrier(const char *dll_name, const char *fn_name) { settings.setLibraryMethodName(dll_name,fn_name); init(); }
StubDriver(const char *dll_name, const char *fn_name, bool verbose = true) { settings.setLibraryMethodName(dll_name,fn_name); settings.setVerboseMode(verbose); init(); }