当前位置: 首页>>代码示例>>C++>>正文


C++ YarpPluginSettings::open方法代码示例

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


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

示例1: 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

示例2: 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


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