예제 #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());
     }
 }
예제 #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());
     }
 }
예제 #3
0
파일: test_hoopy.cpp 프로젝트: BRKMYR/yarp
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;
}
예제 #4
0
 StubCarrier(const char *dll_name, const char *fn_name) {
     settings.setLibraryMethodName(dll_name,fn_name);
     init();
 }
예제 #5
0
 StubDriver(const char *dll_name, const char *fn_name, bool verbose = true) {
     settings.setLibraryMethodName(dll_name,fn_name);
     settings.setVerboseMode(verbose);
     init();
 }