From 7b461d62b8669b4f564afeac4f68b7c8f7780220 Mon Sep 17 00:00:00 2001 From: Nicolas Gallego-Ortiz Date: Tue, 13 Aug 2019 17:35:06 +0200 Subject: [PATCH] data member added to handle type name as a string --- src/OpenMesh/Core/Utils/BaseProperty.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/Utils/BaseProperty.hh b/src/OpenMesh/Core/Utils/BaseProperty.hh index 9991b3ba..1e63d6d3 100644 --- a/src/OpenMesh/Core/Utils/BaseProperty.hh +++ b/src/OpenMesh/Core/Utils/BaseProperty.hh @@ -80,13 +80,13 @@ public: /// /// \param _name Optional textual name for the property. /// - BaseProperty(const std::string& _name = "") - : name_(_name), persistent_(false) + BaseProperty(const std::string& _name = "", const std::string& _internal_type_name = "" ) + : name_(_name), internal_type_name_(_internal_type_name), persistent_(false) {} /// \brief Copy constructor BaseProperty(const BaseProperty & _rhs) - : name_( _rhs.name_ ), persistent_( _rhs.persistent_ ) {} + : name_( _rhs.name_ ), internal_type_name_(_rhs.internal_type_name_), persistent_( _rhs.persistent_ ) {} /// Destructor. virtual ~BaseProperty() {} @@ -119,6 +119,9 @@ public: // named property interface /// Return the name of the property const std::string& name() const { return name_; } + /// Return internal type name of the property for type safe casting alternative to runtime information + const std::string& internal_type_name() const { return internal_type_name_; } + virtual void stats(std::ostream& _ostr) const; public: // I/O support @@ -173,6 +176,7 @@ protected: private: std::string name_; + std::string internal_type_name_; bool persistent_; };