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


C++ Property::put方法代码示例

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


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

示例1: catch

void
WhereRequestHandler::fillInDescription(const YarpString &   request,
                                       yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, WHERE_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Return the remembered IP address and port\n"
                                                  "Input: nothing\n"
                                                  "Output: the remembered IP address and port"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // WhereRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:27,代码来源:m+mWhereRequestHandler.cpp

示例2: catch

void
StartSumRequestHandler::fillInDescription(const YarpString &   request,
                                          yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, STARTSUM_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Start the running sum\n"
                                                  "Input: nothing\n"
                                                  "Output: nothing"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // StartSumRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:27,代码来源:m+mStartSumRequestHandler.cpp

示例3: catch

void
MetricsRequestHandler::fillInDescription(const YarpString &   request,
                                         yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_LIST_START_ MpM_REQREP_DICT_START_
                 MpM_REQREP_DICT_END_ MpM_REQREP_1_OR_MORE_ MpM_REQREP_LIST_END_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, METRICS_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Return the measurements for the channels of the "
                                                  "service\n"
                                                  "Input: nothing\n"
                                                  "Output: a list of dictionaries containing "
                                                  "measurements for the service channels"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // MetricsRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:31,代码来源:m+mMetricsRequestHandler.cpp

示例4: scan_xml

void Prop::scan_xml(const std::string& txt, yarp::os::Property& data) {
  data.clear();
  string line;
  for (int i=0; i<(int)txt.size(); i++) {
    char ch = txt[i];
    if (ch=='\"') {
      line += " ";
      continue;
    }
    if (ch!='\r'&&ch!='\n') {
      line += ch;
      continue;
    } 

    Bottle b(line.c_str());
    
    string var = "dud";
    for (int j=1; j<b.size(); j++) {
      if (b.get(j-1).asString()=="id=") {
	var = b.get(j).asString();
	continue;
      }
      if (b.get(j-1).asString()=="import=") {
	data.put(var.c_str(),b.get(j));
      }
    }
  }
}
开发者ID:paulfitz,项目名称:makesweet,代码行数:28,代码来源:Prop.cpp

示例5: scan_hx

void Prop::scan_hx(const std::string& txt, yarp::os::Property& data) {
  data.clear();
  string line;
  for (int i=0; i<(int)txt.size(); i++) {
    char ch = txt[i];
    if (ch=='\r'||ch=='\n') {
      line = "";
      continue;
    }
    if (ch=='[') {
      line += '(';
      continue;
    }
    if (ch==']') {
      line += ')';
      continue;
    }
    if (ch==',') {
      line += ' ';
      continue;
    }
    if (ch!=';') {
      line += ch;
      continue;
    }
    Bottle b(line.c_str());
    
    string var = "dud";
    for (int j=1; j<b.size(); j++) {
      if (b.get(j-1).asString()=="var") {
	var = b.get(j).asString();
	continue;
      }
      if (b.get(j-1).asString()=="=") {
	Value v = b.get(j);
	ConstString s = v.asString();
	if (s=="true") {
	  data.put(var.c_str(),1);
	} else if (s=="false") {
	  data.put(var.c_str(),0);
	} else {
	  data.put(var.c_str(),v);
	}
      }
    }
  }
}
开发者ID:paulfitz,项目名称:makesweet,代码行数:47,代码来源:Prop.cpp

示例6: integer

void
MatchRequestHandler::fillInDescription(const YarpString &   request,
                                       yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_INPUT_KEY_, MpM_REQREP_INT_ MpM_REQREP_STRING_);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_LIST_START_ MpM_REQREP_STRING_
                 MpM_REQREP_0_OR_MORE_ MpM_REQREP_LIST_END_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, MATCH_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Find a matching service\n"
                                                  "Input: an integer (1=return names, 0=return "
                                                  "ports) and an expression describing the service "
                                                  "to be found\n"
                                                  "Output: OK and a list of matching service "
                                                  "names/ports or FAILED, with a description of "
                                                  "the problem encountered"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        asList->addString("find");
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // MatchRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:35,代码来源:m+mMatchRequestHandler.cpp

示例7: catch

void
Test16EchoRequestHandler::fillInDescription(const YarpString &   request,
                                            yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_INPUT_KEY_, MpM_REQREP_ANYTHING_ MpM_REQREP_0_OR_MORE_);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_ANYTHING_ MpM_REQREP_0_OR_MORE_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, ECHO_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, "Echo back any input");
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        asList->addString("blorg");
        asList->addString("blirg");
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // Test16EchoRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:29,代码来源:m+mTest16EchoRequestHandler.cpp

示例8: catch

void
PingRequestHandler::fillInDescription(const YarpString &   request,
                                      yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_INPUT_KEY_, MpM_REQREP_STRING_);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_STRING_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, PING_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Update the last-pinged time for a service or "
                                                  "re-register it\n"
                                                  "Input: the channel used by the service\n"
                                                  "Output: OK or FAILED, with a description of the "
                                                  "problem encountered"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // PingRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:31,代码来源:m+mPingRequestHandler.cpp

示例9: catch

void
RandomRequestHandler::fillInDescription(const YarpString &   request,
                                        yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_INPUT_KEY_, MpM_REQREP_INT_ MpM_REQREP_0_OR_1_);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_DOUBLE_ MpM_REQREP_1_OR_MORE_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, RANDOM_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Generate one or more random numbers\n"
                                                  "Input: the number of random values to generate\n"
                                                  "Output one or more random numbers per request"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // RandomRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:29,代码来源:m+mRandomRequestHandler.cpp

示例10: B

void
RGBLEDRequestHandler::fillInDescription(const YarpString &   request,
                                        yarp::os::Property & info)
{
    ODL_OBJENTER(); //####
    ODL_S1s("request = ", request); //####
    ODL_P1("info = ", &info); //####
    try
    {
        info.put(MpM_REQREP_DICT_REQUEST_KEY_, request);
        info.put(MpM_REQREP_DICT_INPUT_KEY_, MpM_REQREP_ANYTHING_ MpM_REQREP_0_OR_MORE_);
        info.put(MpM_REQREP_DICT_OUTPUT_KEY_, MpM_REQREP_ANYTHING_ MpM_REQREP_0_OR_MORE_);
        info.put(MpM_REQREP_DICT_VERSION_KEY_, RGBLED_REQUEST_VERSION_NUMBER_);
        info.put(MpM_REQREP_DICT_DETAILS_KEY_, T_("Echo back any input\n"
                                                  "Input: R G B (floats between 0.0 and 1.0) for "
                                                  "colour values"
                                                  "Output: 1 if ok"));
        yarp::os::Value    keywords;
        yarp::os::Bottle * asList = keywords.asList();

        asList->addString(request);
        info.put(MpM_REQREP_DICT_KEYWORDS_KEY_, keywords);
    }
    catch (...)
    {
        ODL_LOG("Exception caught"); //####
        throw;
    }
    ODL_OBJEXIT(); //####
} // RGBLEDRequestHandler::fillInDescription
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:30,代码来源:m+mRGBLEDRequestHandler.cpp


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