Salome HOME
Error management -- Default attribute validator
[modules/shaper.git] / src / Model / Model_AttributeValidator.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModelAPI_AttributeValidator.h
4 // Created:     29 July 2015
5 // Author:      Sergey POKHODENKO
6
7 #ifndef Model_AttributeValidator_H
8 #define Model_AttributeValidator_H
9
10 #include "Model.h"
11 #include <ModelAPI_AttributeValidator.h>
12
13 /**\class Model_AttributeValidator
14  * \ingroup DataModel
15  * \brief The geneneric validator for the attribute.
16  *
17  * Can be redefined for some specific attributes, but by default for each attribute this validator is
18  * used: it checks the argument and if it contains invalid expression the attribute is invalid.
19  */
20 class Model_AttributeValidator : public ModelAPI_AttributeValidator
21 {
22 public:
23   /// \param theAttribute the checked attribute
24   /// \param theArguments arguments of the attribute
25   /// \returns true if attribute is valid
26   MODEL_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
27                                     const std::list<std::string>& theArguments,
28                                     std::string& theError) const;
29 };
30
31 #endif // Model_AttributeValidator_H