Beispiel #1
0
 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());
     }
 }
Beispiel #2
0
 void init() {
     YarpPluginSelector selector;
     selector.scan();
     settings.setSelector(selector);
     if (plugin.open(settings)) {
         car.open(*plugin.getFactory());
         settings.setLibraryMethodName(plugin.getFactory()->getName(),
                                       settings.getMethodName());
     }
 }
Beispiel #3
0
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;
}
Beispiel #4
0
 StubCarrier(const char *dll_name, const char *fn_name) {
     settings.setLibraryMethodName(dll_name,fn_name);
     init();
 }
Beispiel #5
0
 StubDriver(const char *dll_name, const char *fn_name, bool verbose = true) {
     settings.setLibraryMethodName(dll_name,fn_name);
     settings.setVerboseMode(verbose);
     init();
 }