mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
add convenience overloads for setting properties
This commit is contained in:
parent
e9d1742337
commit
78b86bb65f
@ -230,6 +230,12 @@ public:
|
|||||||
else
|
else
|
||||||
it->second.setValue(value);
|
it->second.setValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// overloading: const char* is stored as std::string
|
||||||
|
inline void set(const std::string& name, const char* value){
|
||||||
|
set<std::string>(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
/// temporarily set the value of a property
|
/// temporarily set the value of a property
|
||||||
void setCurrent(const std::string& name, const boost::any& value);
|
void setCurrent(const std::string& name, const boost::any& value);
|
||||||
|
|
||||||
|
|||||||
@ -182,6 +182,10 @@ public:
|
|||||||
}
|
}
|
||||||
/// set a previously declared property to a new value
|
/// set a previously declared property to a new value
|
||||||
void setProperty(const std::string& name, const boost::any& value);
|
void setProperty(const std::string& name, const boost::any& value);
|
||||||
|
/// overload: const char* values are stored as std::string
|
||||||
|
inline void setProperty(const std::string& name, const char* value) {
|
||||||
|
setProperty(name, std::string(value));
|
||||||
|
}
|
||||||
/// analyze source of error and report accordingly
|
/// analyze source of error and report accordingly
|
||||||
void reportPropertyError(const Property::error &e);
|
void reportPropertyError(const Property::error &e);
|
||||||
|
|
||||||
|
|||||||
@ -115,6 +115,10 @@ public:
|
|||||||
return const_cast<Task*>(this)->properties();
|
return const_cast<Task*>(this)->properties();
|
||||||
}
|
}
|
||||||
void setProperty(const std::string& name, const boost::any& value);
|
void setProperty(const std::string& name, const boost::any& value);
|
||||||
|
/// overload: const char* values are stored as std::string
|
||||||
|
inline void setProperty(const std::string& name, const char* value) {
|
||||||
|
setProperty(name, std::string(value));
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool canCompute() const override;
|
bool canCompute() const override;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user