add method to explicitely clone named properties

This commit is contained in:
Max Lyon
2020-02-05 19:12:21 +01:00
parent 2a773f20fb
commit f626837ad3

View File

@@ -253,6 +253,19 @@ class PropertyManager {
} }
} }
/**
* Create property manager referring to a copy of the current property.
* This can be used to explicitely create a copy of a named property. The cloned property
* will be unnamed.
*/
PropertyManager clone()
{
PropertyManager result(this->mesh());
Storage::copy(*this, result);
return result;
}
PropertyManager& operator=(const PropertyManager& rhs) PropertyManager& operator=(const PropertyManager& rhs)
{ {
if (&mesh_ == &rhs.mesh_ && prop_ == rhs.prop_) if (&mesh_ == &rhs.mesh_ && prop_ == rhs.prop_)