Salome HOME
3a4db55c88a8944bd6ede1e74e2ba600260a70b8
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_Validators.h
1 /*
2  * Parameters_VariableValidator.h
3  *
4  *  Created on: Apr 9, 2015
5  *      Author: sbh
6  */
7
8 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
9 #define PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
10
11 #include <ParametersPlugin.h>
12 #include <ParametersPlugin_Validators.h>
13
14 #include <ModelAPI_AttributeValidator.h>
15
16 #include <regex>
17 #include <memory>
18
19 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
20 {
21  public:
22   PARAMETERSPLUGIN_EXPORT ParametersPlugin_VariableValidator();
23   PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_VariableValidator();
24
25   //! returns true if attribute is valid
26   //! \param theAttribute the checked attribute
27   //! \param theArguments arguments of the attribute
28   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
29                                                const std::list<std::string>& theArguments) const;
30
31  private:
32   std::regex myPyVariableRegex;
33 };
34
35 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
36 {
37  public:
38   PARAMETERSPLUGIN_EXPORT ParametersPlugin_ExpressionValidator();
39   PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_ExpressionValidator();
40
41   //! returns true if attribute is valid
42   //! \param theAttribute the checked attribute
43   //! \param theArguments arguments of the attribute
44   PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
45                                                const std::list<std::string>& theArguments) const;
46 };
47
48
49 #endif /* PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_ */