Commit e3d2c02a authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'bool_prop_fix' into 'master'

fix property manager property access for bool properties

See merge request !235
parents 5c99f603 05c01593
...@@ -84,6 +84,8 @@ class PropertyManager { ...@@ -84,6 +84,8 @@ class PropertyManager {
using value_type = typename PROPTYPE::value_type; using value_type = typename PROPTYPE::value_type;
using Handle = typename PROPTYPE::Handle; using Handle = typename PROPTYPE::Handle;
using Self = PropertyManager<PROPTYPE, MeshT>; using Self = PropertyManager<PROPTYPE, MeshT>;
using Reference = typename PROPTYPE::reference;
using ConstReference = typename PROPTYPE::const_reference;
private: private:
// Mesh properties (MPropHandleT<...>) are stored differently than the other properties. // Mesh properties (MPropHandleT<...>) are stored differently than the other properties.
...@@ -101,10 +103,10 @@ class PropertyManager { ...@@ -101,10 +103,10 @@ class PropertyManager {
static void swap(PropertyManager<PROPTYPE, MeshT>& from, PropertyManager2& to) { static void swap(PropertyManager<PROPTYPE, MeshT>& from, PropertyManager2& to) {
std::swap(*to, *from); std::swap(*to, *from);
} }
static const Value& access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) { static ConstReference access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) {
return mesh.property(prop_handle); return mesh.property(prop_handle);
} }
static Value& access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) { static Reference access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle&) {
return mesh.property(prop_handle); return mesh.property(prop_handle);
} }
}; };
...@@ -121,10 +123,10 @@ class PropertyManager { ...@@ -121,10 +123,10 @@ class PropertyManager {
lhs.mesh().property(lhs.prop_).resize(lhs.mesh().template n_elements<Handle>()); lhs.mesh().property(lhs.prop_).resize(lhs.mesh().template n_elements<Handle>());
rhs.mesh().property(rhs.prop_).resize(rhs.mesh().template n_elements<Handle>()); rhs.mesh().property(rhs.prop_).resize(rhs.mesh().template n_elements<Handle>());
} }
static const Value& access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) { static ConstReference access_property_const(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) {
return mesh.property(prop_handle, handle); return mesh.property(prop_handle, handle);
} }
static Value& access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) { static Reference access_property(PolyConnectivity& mesh, const PROPTYPE& prop_handle, const Handle& handle) {
return mesh.property(prop_handle, handle); return mesh.property(prop_handle, handle);
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment