mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
declare by std::type_index (instead of std::type_info)
This commit is contained in:
parent
6444229877
commit
0c8c298450
@ -182,7 +182,7 @@ class PropertyMap
|
|||||||
typedef std::map<std::string, Property>::const_iterator const_iterator;
|
typedef std::map<std::string, Property>::const_iterator const_iterator;
|
||||||
|
|
||||||
/// implementation of declare methods
|
/// implementation of declare methods
|
||||||
Property& declare(const std::string& name, const std::type_info& type,
|
Property& declare(const std::string& name, const std::type_index& type_index,
|
||||||
const std::string& description,
|
const std::string& description,
|
||||||
const boost::any& default_value,
|
const boost::any& default_value,
|
||||||
const Property::SerializeFunction &serialize);
|
const Property::SerializeFunction &serialize);
|
||||||
|
|||||||
@ -107,13 +107,13 @@ void Property::performInitFrom(SourceId source, const PropertyMap &other)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Property& PropertyMap::declare(const std::string &name, const std::type_info &type,
|
Property& PropertyMap::declare(const std::string &name, const std::type_index &type_index,
|
||||||
const std::string &description, const boost::any &default_value,
|
const std::string &description, const boost::any &default_value,
|
||||||
const Property::SerializeFunction &serialize)
|
const Property::SerializeFunction &serialize)
|
||||||
{
|
{
|
||||||
auto it_inserted = props_.insert(std::make_pair(name, Property(std::type_index(type), description, default_value, serialize)));
|
auto it_inserted = props_.insert(std::make_pair(name, Property(type_index, description, default_value, serialize)));
|
||||||
if (!it_inserted.second && std::type_index(type) != it_inserted.first->second.type_index_)
|
if (!it_inserted.second && type_index != it_inserted.first->second.type_index_)
|
||||||
throw Property::type_error(std::type_index(type).name(), it_inserted.first->second.type_index_.name());
|
throw Property::type_error(type_index.name(), it_inserted.first->second.type_index_.name());
|
||||||
return it_inserted.first->second;
|
return it_inserted.first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user