Skip to content
Snippets Groups Projects
Commit 624416ae authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeL] Add destructor, copy constructor and method excludeCopyProperties().

parent 60609422
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,41 @@ public:
return names;
}
/** copy all PropertyVector objects stored in the (internal) map but only
* those values of a PropertyVector whose ids are not in the vector
* exclude_ids.
*/
Properties excludeCopyProperties(std::vector<std::size_t> const& exclude_ids) const
{
Properties exclude_copy;
for (auto property_vector : _properties) {
exclude_copy._properties.insert(
std::make_pair(property_vector.first,
property_vector.second->clone(exclude_ids))
);
}
return exclude_copy;
}
Properties() {}
Properties(Properties const& properties)
: _properties(properties._properties)
{
std::vector<std::size_t> exclude_positions;
for (auto it(_properties.begin()); it != _properties.end(); ++it) {
PropertyVectorBase *t(it->second->clone(exclude_positions));
it->second = t;
}
}
~Properties()
{
for (auto property_vector : _properties) {
delete property_vector.second;
}
}
private:
/// A mapping from property's name to the stored object of any type.
/// See addProperty() and getProperty() documentation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment