diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MaskedProperty.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MaskedProperty.h index 99dd619b240b9c662c6b2daf0f38f619c6c12252..a229b5222380abe5907929b50395b3e49bb1fc1a 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/MaskedProperty.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/MaskedProperty.h @@ -51,6 +51,7 @@ namespace Mantid const unsigned int direction = Direction::Input): Kernel::PropertyWithValue<TYPE>(name,defaultvalue , validator, direction ),m_maskedValue("") { + this->setRemember(false); } /** Constructor for Maskedproperty class @@ -61,7 +62,7 @@ namespace Mantid MaskedProperty( const std::string& name, const TYPE& defaultvalue, const unsigned int direction): Kernel::PropertyWithValue <TYPE>(name,defaultvalue,direction ),m_maskedValue("") { - + this->setRemember(false); } /** @@ -83,11 +84,6 @@ namespace Mantid doMasking(); return m_maskedValue; } - /** - * Do not remember the inputs from a masked property - * @return do not remember masked property values - */ - virtual bool remember() const { return false; }; // Unhide the PropertyWithValue assignment operator using Kernel::PropertyWithValue<TYPE>::operator=; diff --git a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h index 447f3a976585f3f253b4ee4efdf270684c1721cb..e8350d55d959c8a7f9a9858c05b80a6fb8917b61 100644 --- a/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h +++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/Property.h @@ -118,7 +118,8 @@ public: ///Overriden function that returns if property has the same value that it was initialised with, if applicable virtual bool isDefault() const = 0; ///Whether to save input values - virtual bool remember() const; + bool remember() const; + void setRemember(bool); /**Sets the user level description of the property * @param documentation :: The string that the user will see @@ -204,6 +205,9 @@ private: /// Private default constructor Property(); + + /// Flag whether to save input values + bool m_remember; }; /// Return the name corresponding to the mangled string given by typeid diff --git a/Code/Mantid/Framework/Kernel/src/Property.cpp b/Code/Mantid/Framework/Kernel/src/Property.cpp index b2ae5d1970ba8e5d15d101daa7ffcb374ce9b62b..edf8fcdc89cc6bdd6dc66e943f607793c33a40d2 100644 --- a/Code/Mantid/Framework/Kernel/src/Property.cpp +++ b/Code/Mantid/Framework/Kernel/src/Property.cpp @@ -21,7 +21,8 @@ Property::Property( const std::string &name, const std::type_info &type, const u m_direction( direction ), m_units(""), m_settings(NULL), - m_group("") + m_group(""), + m_remember(true) { // Make sure a random int hasn't been passed in for the direction // Property & PropertyWithValue destructors will be called in this case @@ -36,7 +37,8 @@ Property::Property( const Property& right ) : m_direction( right.m_direction ), m_units( right.m_units), m_settings(NULL), - m_group( right.m_group) + m_group( right.m_group), + m_remember(right.m_remember) { if (right.m_settings) m_settings = right.m_settings->clone(); @@ -103,7 +105,16 @@ std::string Property::isValid() const */ bool Property::remember() const { - return true; + return m_remember; +} + +/** + * Set wheter to remeber this property input + * @param remember :: true to remember + */ +void Property::setRemember(bool remember) +{ + m_remember=remember; } /** Sets the property's (optional) documentation string