本文整理汇总了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
示例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
示例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
示例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));
}
}
}
}
示例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);
}
}
}
}
}
示例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
示例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
示例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
示例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
示例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