Skip to content
Snippets Groups Projects
Commit f6b35c29 authored by marco's avatar marco
Browse files

Add RemoveProp to generic property container

Fixes BZDNG-138

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2534 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent ab1206ae
No related branches found
No related tags found
No related merge requests found
......@@ -185,6 +185,7 @@ void generic_prop_def(O& bp_class)
.def("SetGenericFloatProperty", &depr_set_float<C>)
.def("SetGenericBoolProperty", &depr_set_bool<C>)
.def("SetGenericStringProperty", &depr_set_string<C>)
.def("RemoveProp", &C::RemoveProp)
;
}
......
......@@ -102,6 +102,12 @@ public:
}
}
void RemoveProp(const String& key)
{
if (map_) {
map_->erase(key);
}
}
void Assign(const GenericPropContainerImpl& impl)
{
if (impl.map_) {
......@@ -159,6 +165,7 @@ protected:
{
return static_cast<const H*>(this)->GpImpl();
}
public:
/// \brief checks existence of property
bool HasProp(const String& key) const {
......@@ -296,6 +303,11 @@ public:
{
this->GetImpl()->GenericProp(key)=value;
}
void RemoveProp(const String& key)
{
this->GetImpl()->RemoveProp(key);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment