2 * Parameters_VariableValidator.h
4 * Created on: Apr 9, 2015
8 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
9 #define PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
11 #include <ParametersPlugin.h>
12 #include <ParametersPlugin_Validators.h>
14 #include <ModelAPI_AttributeValidator.h>
19 * \class ParametersPlugin_VariableValidator
21 * \brief Validator for the variable name of parameter.
23 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
26 PARAMETERSPLUGIN_EXPORT ParametersPlugin_VariableValidator();
27 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_VariableValidator();
29 //! returns true if attribute is valid
30 //! \param theAttribute the checked attribute
31 //! \param theArguments arguments of the attribute
32 //! \param theError the error string message if validation fails
33 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
34 const std::list<std::string>& theArguments,
35 std::string& theError) const;
38 /// Returns true if theString is a variable name.
39 PARAMETERSPLUGIN_EXPORT bool isVariable(const std::string& theString) const;
40 /// Returns true if theString is unique parameter name for theAttribute context.
41 PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute,
42 const std::string& theString) const;
46 * \class ParametersPlugin_ExpressionValidator
48 * \brief Validator for the expression of parameter.
50 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
53 PARAMETERSPLUGIN_EXPORT ParametersPlugin_ExpressionValidator();
54 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_ExpressionValidator();
56 //! returns true if attribute is valid
57 //! \param theAttribute the checked attribute
58 //! \param theArguments arguments of the attribute
59 //! \param theError the error string message if validation fails
60 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
61 const std::list<std::string>& theArguments,
62 std::string& theError) const;
66 #endif /* PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_ */