X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_FeatureValidator.h;h=3b995c6c150a396758c113e5e0d3964a0610bbe3;hb=9dc1fc2ff6f4143369cdb2042a5e01e8e737c635;hp=d2378a0dea994f19820a40caa7be441f374aebc3;hpb=426a1cf07dfee0bbb58dcd399787a89a4992fa72;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_FeatureValidator.h b/src/ModelAPI/ModelAPI_FeatureValidator.h index d2378a0de..3b995c6c1 100644 --- a/src/ModelAPI/ModelAPI_FeatureValidator.h +++ b/src/ModelAPI/ModelAPI_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 @@ -8,14 +10,32 @@ #include "ModelAPI.h" #include "ModelAPI_Validator.h" -class ModelAPI_FeatureValidator: public ModelAPI_Validator +/**\class ModelAPI_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 MODELAPI_EXPORT ModelAPI_FeatureValidator : public ModelAPI_Validator { -public: + public: + /// Default constructor + ModelAPI_FeatureValidator(); + /// Virtual destructor + virtual ~ModelAPI_FeatureValidator(); + /// Returns true if feature and/or attributes are valid /// \param theFeature the validated feature - /// \param theAttr the validated attribute ID, empty string of feature is validated /// \param theArguments list of string, feature attribute names: dependent attributes - virtual bool isValid(const boost::shared_ptr& theFeature) const = 0; + /// \param theError the error string message if validation fails + virtual bool isValid(const std::shared_ptr& theFeature, + const std::list& theArguments, + Events_InfoMessage& theError) const = 0; + + /// Returns true if the attribute in feature is not obligatory for the feature execution + virtual bool isNotObligatory(std::string theFeature, std::string theAttribute) = 0; }; #endif