Commit 7b461d62 authored by Nicolas Gallego-Ortiz's avatar Nicolas Gallego-Ortiz
Browse files

data member added to handle type name as a string

parent 481ffd7f
...@@ -80,13 +80,13 @@ public: ...@@ -80,13 +80,13 @@ public:
/// ///
/// \param _name Optional textual name for the property. /// \param _name Optional textual name for the property.
/// ///
BaseProperty(const std::string& _name = "<unknown>") BaseProperty(const std::string& _name = "<unknown>", const std::string& _internal_type_name = "<unknown>" )
: name_(_name), persistent_(false) : name_(_name), internal_type_name_(_internal_type_name), persistent_(false)
{} {}
/// \brief Copy constructor /// \brief Copy constructor
BaseProperty(const BaseProperty & _rhs) BaseProperty(const BaseProperty & _rhs)
: name_( _rhs.name_ ), persistent_( _rhs.persistent_ ) {} : name_( _rhs.name_ ), internal_type_name_(_rhs.internal_type_name_), persistent_( _rhs.persistent_ ) {}
/// Destructor. /// Destructor.
virtual ~BaseProperty() {} virtual ~BaseProperty() {}
...@@ -119,6 +119,9 @@ public: // named property interface ...@@ -119,6 +119,9 @@ public: // named property interface
/// Return the name of the property /// Return the name of the property
const std::string& name() const { return name_; } 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; virtual void stats(std::ostream& _ostr) const;
public: // I/O support public: // I/O support
...@@ -173,6 +176,7 @@ protected: ...@@ -173,6 +176,7 @@ protected:
private: private:
std::string name_; std::string name_;
std::string internal_type_name_;
bool persistent_; bool persistent_;
}; };
......
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