本文整理汇总了C++中PropertyBag::addProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyBag::addProperty方法的具体用法?C++ PropertyBag::addProperty怎么用?C++ PropertyBag::addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyBag
的用法示例。
在下文中一共展示了PropertyBag::addProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy_monitor
bool YouBotMonitorService::copy_monitor(std::string source, std::string target)
{
vector<monitor*>::iterator i;
monitor* m(NULL);
monitor* m2(NULL);
m = (i = getMonitor(m_monitors, source)) < m_monitors.end() ? *i : NULL;
if(m == NULL)
{
log(Error) << source << ": monitor not in database." << endlog();
return false;
}
m2 = (i = getMonitor(m_monitors, target)) < m_monitors.end() ? *i : NULL;
if(m2 != NULL)
{
log(Error) << target << ": monitor already in database." << endlog();
return false;
}
PropertyBag* p = new PropertyBag;
m = new monitor(*m);
m->descriptive_name = target;
p->addProperty("descriptive_name", m->descriptive_name).doc("Descriptive name of the monitor");
p->addProperty("physical_part", m->part).doc("Robot part: ARM, BASE or BOTH");
p->addProperty("control_space", m->space).doc("Compare in JOINT or CARTESIAN space");
p->addProperty("physical_quantity", m->quantity).doc("Interesting quantity: POSITION, VELOCITY, FORCE or TORQUE");
p->addProperty("event_type", m->e_type).doc("LEVEL or EDGE triggered event(s)");
p->addProperty("compare_type", m->c_type).doc("LESS, LESS_EQUAL, EQUAL, GREATER, GREATER_EQUAL");
p->addProperty("msg", m->msg).doc("Event's message");
p->addProperty("epsilon", m->epsilon).doc("Epsilon range for the EQUAL compare_type (only).");
p->addProperty("indices", m->indices).doc("Interesting states (indices).");
p->addProperty("values", m->values).doc("Triggering state set-points");
this->addProperty(m->descriptive_name, *p);
if(m_monitors.size() + 1 > m_monitors.capacity())
{
m_monitors.reserve(m_monitors.size() + 1);
m_active_monitors.reserve(m_monitors.size() + 1);
}
m_monitors.push_back(m);
return true;
}