• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ YarpPluginSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中YarpPluginSettings的典型用法代码示例。如果您正苦于以下问题:C++ YarpPluginSettings类的具体用法?C++ YarpPluginSettings怎么用?C++ YarpPluginSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了YarpPluginSettings类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

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;
}
开发者ID:BRKMYR,项目名称:yarp,代码行数:20,代码来源:test_hoopy.cpp


示例2: toString

    std::string toString() {
        std::string s;
        Property done;
        for (unsigned int i=0; i<delegates.size(); i++) {
            if (delegates[i]==nullptr) continue;
            std::string name = delegates[i]->getName();
            done.put(name,1);
            std::string wrapper = delegates[i]->getWrapper();
            s += "Device \"";
            s += delegates[i]->getName();
            s += "\"";
            s += ",";
            s += " C++ class ";
            s += delegates[i]->getCode();
            s += ", ";
            if (wrapper=="") {
                s += "has no network wrapper";
            } else if (wrapper!=name) {
                s += "wrapped by \"";
                s += delegates[i]->getWrapper();
                s += "\"";
            } else {
                s += "is a network wrapper.";
            }
            s += "\n";
        }

        scan();
        Bottle lst = getSelectedPlugins();
        for (size_t i=0; i<lst.size(); i++) {
            Value& prop = lst.get(i);
            std::string name = prop.check("name",Value("untitled")).asString();
            if (done.check(name)) continue;

            SharedLibraryFactory lib;
            YarpPluginSettings settings;
            settings.setSelector(*this);
            settings.readFromSearchable(prop,name);
            settings.open(lib);
            std::string location = lib.getName().c_str();
            if (location=="") {
              // A wrong library name ends up with empty location
              yWarning("Wrong library name for plugin %s", name.c_str());
              continue;
            }

            std::string cxx = prop.check("cxx",Value("unknown")).asString();
            std::string wrapper = prop.check("wrapper",Value("unknown")).asString();
            s += "Device \"";
            s += name;
            s += "\"";
            s += ",";
            s += " available on request (found in ";
            s += location;
            s += " library)";
            if (cxx!="unknown") {
                s += ", C++ class ";
                s += cxx;
                s += "  ";
            }

            if (wrapper=="") {
                s += "no network wrapper known";  // will never come here since the prop.check fallback is set to unknown few lines above!!!
            } else if (wrapper=="unknown") {
                //s += "network wrapper unknown";
            } else if (wrapper!=name) {
                s += ", wrapped by \"";
                s += wrapper.c_str();
                s += "\"";
            } else {
                s += ", is a network wrapper";
            }
            s += ".\n";
        }

        return s;
    }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:77,代码来源:Drivers.cpp


示例3: toString

    ConstString toString() {
        ConstString s;
        Property done;
        for (unsigned int i=0; i<delegates.size(); i++) {
            if (delegates[i]==NULL) continue;
            ConstString name = delegates[i]->getName();
            done.put(name,1);
            ConstString wrapper = delegates[i]->getWrapper();
            s += "Device \"";
            s += delegates[i]->getName();
            s += "\"";
            s += ",";
            s += " C++ class ";
            s += delegates[i]->getCode();
            s += ", ";
            if (wrapper=="") {
                s += "has no network wrapper";
            } else if (wrapper!=name) {
                s += "wrapped by \"";
                s += delegates[i]->getWrapper();
                s += "\"";
            } else {
                s += "is a network wrapper.";
            }
            s += "\n";
        }

        scan();
        Bottle lst = getSelectedPlugins();
        for (int i=0; i<lst.size(); i++) {
            Value& prop = lst.get(i);
            ConstString name = prop.check("name",Value("untitled")).asString();
            if (done.check(name)) continue;

            SharedLibraryFactory lib;
            YarpPluginSettings settings;
            settings.setSelector(*this);
            settings.readFromSearchable(prop,name);
            settings.open(lib);
            ConstString location = lib.getName().c_str();
            if (location=="") continue;

            ConstString cxx = prop.check("cxx",Value("unknown")).asString();
            ConstString wrapper = prop.check("wrapper",Value("unknown")).asString();
            s += "Device \"";
            s += name;
            s += "\"";
            s += ",";
            s += " available on request (found in ";
            s += location;
            s += " library)";
            if (cxx!="unknown") {
                s += ", C++ class ";
                s += cxx;
                s += "  ";
            }
            if (wrapper=="") {
                s += "no network wrapper known";
            } else if (wrapper=="unknown") {
                //s += "network wrapper unknown";
            } else if (wrapper!=name) {
                s += "wrapped by \"";
                s += delegates[i]->getWrapper();
                s += "\"";
            } else {
                s += "is a network wrapper.";
            }
            s += "\n";            
        }

        return s;
    }
开发者ID:MovementAndMeaning,项目名称:yarp_MPlusM,代码行数:72,代码来源:Drivers.cpp


示例4: StubDriver

 StubDriver(const char *name, bool verbose = true) {
     settings.setPluginName(name);
     settings.setVerboseMode(verbose);
     YarpPluginSelector selector;
     selector.scan();
     if (!settings.setSelector(selector)) return;
     init();
 }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:8,代码来源:Drivers.cpp


示例5: init

 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());
     }
 }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:9,代码来源:Drivers.cpp


示例6: init

 void init() {
     YarpPluginSelector selector;
     selector.scan();
     settings.setSelector(selector);
     if (plugin.open(settings)) {
         car.open(*plugin.getFactory());
         settings.setLibraryMethodName(plugin.getFactory()->getName(),
                                       settings.getMethodName());
     }
 }
开发者ID:giuliavezzani,项目名称:yarp,代码行数:10,代码来源:Network.cpp


示例7: getFnName

 ConstString getFnName() const {
     return settings.getMethodName();
 }
开发者ID:giuliavezzani,项目名称:yarp,代码行数:3,代码来源:Network.cpp


示例8: getDllName

 ConstString getDllName() const {
    return settings.getLibraryName();
 }
开发者ID:giuliavezzani,项目名称:yarp,代码行数:3,代码来源:Network.cpp


示例9: StubCarrier

 StubCarrier(const char *name) {
     settings.setPluginName(name);
     init();
 }
开发者ID:giuliavezzani,项目名称:yarp,代码行数:4,代码来源:Network.cpp


示例10: getBaseClassName

 std::string getBaseClassName() const {
     return settings.getBaseClassName();
 }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:3,代码来源:Drivers.cpp


示例11: getPluginName

 std::string getPluginName() const {
     return settings.getPluginName();
 }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:3,代码来源:Drivers.cpp


示例12: getwrapName

 std::string getwrapName() const {
     return settings.getWrapperName();
 }
开发者ID:claudiofantacci,项目名称:yarp,代码行数:3,代码来源:Drivers.cpp


示例13: StubDriver

 StubDriver(const char *name, bool verbose = true) {
     settings.setPluginName(name);
     settings.setVerboseMode(verbose);
     init();
 }
开发者ID:MovementAndMeaning,项目名称:yarp_MPlusM,代码行数:5,代码来源:Drivers.cpp



注:本文中的YarpPluginSettings类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ YsArray类代码示例发布时间:2022-05-31
下一篇:
C++ YamlNode类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap