本文整理汇总了C++中xmlrpc::XmlRpcValue::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlRpcValue::valid方法的具体用法?C++ XmlRpcValue::valid怎么用?C++ XmlRpcValue::valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpc::XmlRpcValue
的用法示例。
在下文中一共展示了XmlRpcValue::valid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get
bool get(std::string key, XmlRpc::XmlRpcValue& val)
{
try
{
bool v;
if (get(key,v)){
XmlRpc::XmlRpcValue vb(v);
val = vb;
return (val.valid());
}
double vd;
if (get(key,vd)){
val = vd;
return (val.valid());
}
int vi;
if (get(key,vi)){
val=vi;
return (val.valid());
}
std::string vs;
if (get(key, vs)){
val=vs.c_str();
return (val.valid());
}
}
catch (...)
{
return false;
}
return false;
}
示例2: execute
void startWorkingCallback::execute (XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result)
{
// if no arguments were received
if (!params.valid())
{
result = ctrl_xmlrpc->startProcessing();
}
else
{
switch(params.size())
{
// start the server in online mode with port and blocksize
case 2:
ctrl_xmlrpc->startEegServer((int) params[0], (int) params[1]);
result = 0;
break;
case 3:
ctrl_xmlrpc->startEegServer((std::string) params[0], (int) params[1], (int) params[2]);
result = 0;
break;
default:
OMG("WARNING! Server got wrong number of arguments!");
break;
}
}
fflush(stdout);
}
示例3: loadMonocularNodelets
void loadMonocularNodelets(nodelet::Loader& manager, const std::string& side,
const XmlRpc::XmlRpcValue& rectify_params,
const nodelet::V_string& my_argv)
{
nodelet::M_string remappings;
// Explicitly resolve global remappings (wg-ros-pkg #5055).
// Otherwise the internal remapping 'image_raw' -> 'left/image_raw' can hide a
// global remapping from the launch file or command line.
std::string image_raw_topic = ros::names::resolve(side + "/image_raw");
std::string image_mono_topic = ros::names::resolve(side + "/image_mono");
std::string image_color_topic = ros::names::resolve(side + "/image_color");
std::string image_rect_topic = ros::names::resolve(side + "/image_rect");
std::string image_rect_color_topic = ros::names::resolve(side + "/image_rect_color");
std::string camera_info_topic = ros::names::resolve(side + "/camera_info");
// Debayer nodelet: image_raw -> image_mono, image_color
remappings["image_raw"] = image_raw_topic;
remappings["image_mono"] = image_mono_topic;
remappings["image_color"] = image_color_topic;
std::string debayer_name = ros::this_node::getName() + "_debayer_" + side;
manager.load(debayer_name, "image_proc/debayer", remappings, my_argv);
// Rectify nodelet: image_mono -> image_rect
remappings.clear();
remappings["image_mono"] = image_mono_topic;
remappings["camera_info"] = camera_info_topic;
remappings["image_rect"] = image_rect_topic;
std::string rectify_mono_name = ros::this_node::getName() + "_rectify_mono_" + side;
if (rectify_params.valid())
ros::param::set(rectify_mono_name, rectify_params);
manager.load(rectify_mono_name, "image_proc/rectify", remappings, my_argv);
// Rectify nodelet: image_color -> image_rect_color
remappings.clear();
remappings["image_mono"] = image_color_topic;
remappings["camera_info"] = camera_info_topic;
remappings["image_rect"] = image_rect_color_topic;
std::string rectify_color_name = ros::this_node::getName() + "_rectify_color_" + side;
if (rectify_params.valid())
ros::param::set(rectify_color_name, rectify_params);
manager.load(rectify_color_name, "image_proc/rectify", remappings, my_argv);
}