X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_FeatureValidator.h;h=47c091937927bfe3dbc9e51ff6dcd55ded887a23;hb=dfd8991c975a7493c1e7be200503a5c9456ad2da;hp=b262ff0ea552b0fee6cbb9d1ba2fc063fdbf4af5;hpb=4783f146b71a48c651523fcf0e12367bcf3d1fa8;p=modules%2Fshaper.git diff --git a/src/Model/Model_FeatureValidator.h b/src/Model/Model_FeatureValidator.h index b262ff0ea..47c091937 100644 --- a/src/Model/Model_FeatureValidator.h +++ b/src/Model/Model_FeatureValidator.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModelAPI_FeatureValidator.h // Created: 8 Jul 2014 // Author: Vitaly SMETANNIKOV @@ -13,18 +15,33 @@ #include #include +/**\class Model_FeatureValidator + * \ingroup DataModel + * \brief The geneneric validator for the whole feature. + * + * Can be redefined for some specific feature, but by default for each feature this validator is + * used: it checks each argument of the feature and if one of it is not valid (and obligatory), + * the hole feature is invalid. + */ class Model_FeatureValidator : public ModelAPI_FeatureValidator { // not obligatory attributes, not checked for initialization std::map > myNotObligatory; - public: +public: /// Returns true if feature and/or attributes are valid /// \param theFeature the validated feature + /// \param theArguments the arguments in the configuration file for this validator + /// \param theError erros message produced by validator to the user if it fails + /// \returns true if feature is valid MODEL_EXPORT virtual bool isValid(const std::shared_ptr& theFeature, - const std::list& theArguments) const; + const std::list& theArguments, + Events_InfoMessage& theError) const; + + /// sets not obligatory attributes, not checked for initialization + virtual void registerNotObligatory(std::string theFeature, std::string theAttribute); - // sets not obligatory attributes, not checked for initialization - void registerNotObligatory(std::string theFeature, std::string theAttribute); + /// Returns true if the attribute in feature is not obligatory for the feature execution + virtual bool isNotObligatory(std::string theFeature, std::string theAttribute); }; #endif