Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelAPI / ModelAPI_AttributeValidator.h
index 15b8514ec9302c3fa6337af06c7fda16eadbe0d1..9eddf095930a2bbf3a7b83b02941a6d098526bec 100644 (file)
@@ -1,19 +1,44 @@
-// File:        ModelAPI_AttributeValidator.h
-// Created:     5 Aug 2014
-// Author:      Vitaly SMETANNIKOV
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #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,
+                       Events_InfoMessage& theError) const = 0;
+
+  MODELAPI_EXPORT ~ModelAPI_AttributeValidator();
 };
 
 #endif