1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 * Parameters_VariableValidator.h
5 * Created on: Apr 9, 2015
9 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
10 #define PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
12 #include <ParametersPlugin.h>
13 #include <ParametersPlugin_Validators.h>
15 #include <ModelAPI_AttributeValidator.h>
20 * \class ParametersPlugin_VariableValidator
22 * \brief Validator for the variable name of parameter.
24 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
27 PARAMETERSPLUGIN_EXPORT ParametersPlugin_VariableValidator();
28 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_VariableValidator();
31 * \brief Returns true if attribute has a valid parameter name.
32 * \param theAttribute the checked attribute
33 * \param theArguments arguments of the attribute
34 * \param theError the error string message if validation fails
36 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
37 const std::list<std::string>& theArguments,
38 Events_InfoMessage& theError) const;
41 /// Returns true if theString is unique parameter name in the document of theAttribute.
42 PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute,
43 const std::string& theString) const;
47 * \class ParametersPlugin_ExpressionValidator
49 * \brief Validator for the expression of parameter.
51 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
54 PARAMETERSPLUGIN_EXPORT ParametersPlugin_ExpressionValidator();
55 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_ExpressionValidator();
58 * \brief Returns true if attribute has a valid parameter expression.
59 * \param theAttribute the checked attribute
60 * \param theArguments arguments of the attribute
61 * \param theError the error string message if validation fails
63 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
64 const std::list<std::string>& theArguments,
65 Events_InfoMessage& theError) const;
69 #endif /* PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_ */