Salome HOME
Issue #1437: provide update of parameters table part on editing of any parameter
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeValidator.h
index 15b8514ec9302c3fa6337af06c7fda16eadbe0d1..142c91c233689bb32a729ca6e232263c3b8b2a9f 100644 (file)
@@ -1,19 +1,31 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModelAPI_AttributeValidator.h
-// Created:     5 Aug 2014
-// Author:      Vitaly SMETANNIKOV
+// Created:     4 Sep 2014
+// Author:      Mikhail PONIKAROV
 
 #ifndef ModelAPI_AttributeValidator_H
 #define ModelAPI_AttributeValidator_H
 
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_Object.h>
+#include <ModelAPI.h>
+#include <ModelAPI_Attribute.h>
 #include <ModelAPI_Validator.h>
 
+/**
+ * Generic validator for any attribute of a feature.
+ */
 class ModelAPI_AttributeValidator : public ModelAPI_Validator
 {
- public:
-  virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const ObjectPtr& theObject) const = 0;
+public:
+  //! \returns true if attribute is valid
+  //! \param theAttribute the checked attribute
+  //! \param theArguments arguments of the attribute
+  //! \param theError the error string message if validation fails
+  virtual bool isValid(const AttributePtr& theAttribute,
+                       const std::list<std::string>& theArguments,
+                       std::string& theError) const = 0;
+
+  MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
 };
 
 #endif