From f552be05fa7ab418c2e38ab071bed876309f6cd5 Mon Sep 17 00:00:00 2001 From: Hans-Christian Ebke Date: Thu, 23 May 2013 09:36:41 +0000 Subject: [PATCH] Enabled initialization of invalid PropertyManager. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@826 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/Utils/PropertyManager.hh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/OpenMesh/Core/Utils/PropertyManager.hh b/src/OpenMesh/Core/Utils/PropertyManager.hh index f822d776..904fb826 100644 --- a/src/OpenMesh/Core/Utils/PropertyManager.hh +++ b/src/OpenMesh/Core/Utils/PropertyManager.hh @@ -43,6 +43,7 @@ #define PROPERTYMANAGER_HH_ #include +#include namespace OpenMesh { @@ -69,12 +70,12 @@ template class PropertyManager { private: /** - * Noncopyable because there aren't not straightforward copy semantics. + * Noncopyable because there aren't no straightforward copy semantics. */ PropertyManager(const PropertyManager&); /** - * Noncopyable because there aren't not straightforward copy semantics. + * Noncopyable because there aren't no straightforward copy semantics. */ const PropertyManager& operator=(const PropertyManager&); @@ -105,6 +106,9 @@ class PropertyManager { } } + PropertyManager() : mesh_(0), retain_(false) { + } + ~PropertyManager() { deleteProperty(); } @@ -120,6 +124,11 @@ class PropertyManager { return mesh.get_property_handle(dummy, propname); } + bool isValid() const { return mesh_ != 0; } + operator bool() const { return isValid(); } + + const PROPTYPE &getRawProperty() const { return prop_; } + #if __cplusplus > 199711L or __GXX_EXPERIMENTAL_CXX0X__ /** * Move constructor. Transfers ownership (delete responsibility).