SHAPER  9.12.0
ModelAPI_ValidatorsFactory Class Referenceabstract

Manages the registered validators. More...

Inheritance diagram for ModelAPI_ValidatorsFactory:
Inheritance graph

Public Types

typedef std::list< std::pair< std::string, std::list< std::string > > > Validators
 Validators is a list of pairs <Validator, list of arguments> More...
 

Public Member Functions

virtual void registerValidator (const std::string &theID, ModelAPI_Validator *theValidator)=0
 Registers the instance of the validator by the ID. More...
 
virtual void assignValidator (const std::string &theID, const std::string &theFeatureID)=0
 Assigns validator to the feature. More...
 
virtual void assignValidator (const std::string &theID, const std::string &theFeatureID, const std::list< std::string > &theArguments)=0
 Assigns validator to the feature with arguments of the validator. More...
 
virtual void assignValidator (const std::string &theID, const std::string &theFeatureID, const std::string &theAttrID, const std::list< std::string > &theArguments)=0
 Assigns validator to the attribute of the feature. More...
 
virtual void validators (const std::string &theFeatureID, Validators &theResult) const =0
 Provides a validator for the feature, returns NULL if no validator. More...
 
virtual void validators (const std::string &theFeatureID, const std::string &theAttrID, Validators &theResult) const =0
 Provides a validator for the attribute, returns NULL if no validator. More...
 
virtual const ModelAPI_Validatorvalidator (const std::string &theID) const =0
 Returns registered validator by its Id. More...
 
virtual bool validate (const std::shared_ptr< ModelAPI_Feature > &theFeature) const =0
 Returns true if feature and all its attributes are valid. More...
 
virtual bool validate (const std::shared_ptr< ModelAPI_Attribute > &theAttribute, std::string &theValidator, Events_InfoMessage &theError) const =0
 Returns true if the attribute is valid. More...
 
virtual void registerNotObligatory (std::string theFeature, std::string theAttribute)=0
 register that this attribute in feature is not obligatory for the feature execution so, it is not needed for the standard validation mechanism More...
 
virtual bool isNotObligatory (std::string theFeature, std::string theAttribute)=0
 Returns true if the attribute in feature is not obligatory for the feature execution. More...
 
virtual void registerConcealment (std::string theFeature, std::string theAttribute)=0
 register that this attribute conceals in the object browser all referenced features after execution More...
 
virtual bool isConcealed (std::string theFeature, std::string theAttribute)=0
 Returns true that it was registered that attribute conceals the referenced result. More...
 
virtual void registerMainArgument (std::string theFeature, std::string theAttribute)=0
 Register the attribute as a main argument of the feature. More...
 
virtual bool isMainArgument (std::string theFeature, std::string theAttribute)=0
 Returns true is the attribute is a main argument of the feature. More...
 
virtual void registerCase (std::string theFeature, std::string theAttribute, const std::list< std::pair< std::string, std::string > > &theCases)=0
 Register the case-attribute: this attribute is checked only if its case is selected. More...
 
virtual bool isCase (FeaturePtr theFeature, std::string theAttribute)=0
 Returns true if the attribute must be checked (the case is selected) More...
 
virtual void registerGeometricalSelection (std::string theFeature, std::string theAttribute)=0
 Register the selection attribute as geometrical selection. More...
 
virtual bool isGeometricalSelection (std::string theFeature, std::string theAttribute)=0
 Returns true if the attribute is a geometrical selection. More...
 

Protected Member Functions

 ModelAPI_ValidatorsFactory ()
 Get instance from Session. More...
 

Detailed Description

Manages the registered validators.

Allows to get a validator by the feature identifier and the attribute identifier (if attribute is validated). All accessible validators mustbe registered by the ID string first. The instance of this factory can be get in the Session. Keeps the validator objects alive and just returns one of it by request. All the needed information is provided to the validator as an argument, this allows to work with them independently from the feature specific object.

Member Typedef Documentation

◆ Validators

typedef std::list<std::pair<std::string, std::list<std::string> > > ModelAPI_ValidatorsFactory::Validators

Validators is a list of pairs <Validator, list of arguments>

Constructor & Destructor Documentation

◆ ModelAPI_ValidatorsFactory()

ModelAPI_ValidatorsFactory::ModelAPI_ValidatorsFactory ( )
inlineprotected

Get instance from Session.

Member Function Documentation

◆ registerValidator()

virtual void ModelAPI_ValidatorsFactory::registerValidator ( const std::string &  theID,
ModelAPI_Validator theValidator 
)
pure virtual

Registers the instance of the validator by the ID.

Implemented in Model_ValidatorsFactory.

◆ assignValidator() [1/3]

virtual void ModelAPI_ValidatorsFactory::assignValidator ( const std::string &  theID,
const std::string &  theFeatureID 
)
pure virtual

Assigns validator to the feature.

Implemented in Model_ValidatorsFactory.

◆ assignValidator() [2/3]

virtual void ModelAPI_ValidatorsFactory::assignValidator ( const std::string &  theID,
const std::string &  theFeatureID,
const std::list< std::string > &  theArguments 
)
pure virtual

Assigns validator to the feature with arguments of the validator.

Implemented in Model_ValidatorsFactory.

◆ assignValidator() [3/3]

virtual void ModelAPI_ValidatorsFactory::assignValidator ( const std::string &  theID,
const std::string &  theFeatureID,
const std::string &  theAttrID,
const std::list< std::string > &  theArguments 
)
pure virtual

Assigns validator to the attribute of the feature.

Implemented in Model_ValidatorsFactory.

◆ validators() [1/2]

virtual void ModelAPI_ValidatorsFactory::validators ( const std::string &  theFeatureID,
Validators theResult 
) const
pure virtual

Provides a validator for the feature, returns NULL if no validator.

Implemented in Model_ValidatorsFactory.

◆ validators() [2/2]

virtual void ModelAPI_ValidatorsFactory::validators ( const std::string &  theFeatureID,
const std::string &  theAttrID,
Validators theResult 
) const
pure virtual

Provides a validator for the attribute, returns NULL if no validator.

Implemented in Model_ValidatorsFactory.

◆ validator()

virtual const ModelAPI_Validator* ModelAPI_ValidatorsFactory::validator ( const std::string &  theID) const
pure virtual

Returns registered validator by its Id.

Implemented in Model_ValidatorsFactory.

◆ validate() [1/2]

virtual bool ModelAPI_ValidatorsFactory::validate ( const std::shared_ptr< ModelAPI_Feature > &  theFeature) const
pure virtual

Returns true if feature and all its attributes are valid.

Implemented in Model_ValidatorsFactory.

◆ validate() [2/2]

virtual bool ModelAPI_ValidatorsFactory::validate ( const std::shared_ptr< ModelAPI_Attribute > &  theAttribute,
std::string &  theValidator,
Events_InfoMessage theError 
) const
pure virtual

Returns true if the attribute is valid.

Implemented in Model_ValidatorsFactory.

◆ registerNotObligatory()

virtual void ModelAPI_ValidatorsFactory::registerNotObligatory ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

register that this attribute in feature is not obligatory for the feature execution so, it is not needed for the standard validation mechanism

Implemented in Model_ValidatorsFactory.

◆ isNotObligatory()

virtual bool ModelAPI_ValidatorsFactory::isNotObligatory ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Returns true if the attribute in feature is not obligatory for the feature execution.

Implemented in Model_ValidatorsFactory.

◆ registerConcealment()

virtual void ModelAPI_ValidatorsFactory::registerConcealment ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

register that this attribute conceals in the object browser all referenced features after execution

Implemented in Model_ValidatorsFactory.

◆ isConcealed()

virtual bool ModelAPI_ValidatorsFactory::isConcealed ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Returns true that it was registered that attribute conceals the referenced result.

Implemented in Model_ValidatorsFactory.

◆ registerMainArgument()

virtual void ModelAPI_ValidatorsFactory::registerMainArgument ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Register the attribute as a main argument of the feature.

Implemented in Model_ValidatorsFactory.

◆ isMainArgument()

virtual bool ModelAPI_ValidatorsFactory::isMainArgument ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Returns true is the attribute is a main argument of the feature.

Implemented in Model_ValidatorsFactory.

◆ registerCase()

virtual void ModelAPI_ValidatorsFactory::registerCase ( std::string  theFeature,
std::string  theAttribute,
const std::list< std::pair< std::string, std::string > > &  theCases 
)
pure virtual

Register the case-attribute: this attribute is checked only if its case is selected.

Implemented in Model_ValidatorsFactory.

◆ isCase()

virtual bool ModelAPI_ValidatorsFactory::isCase ( FeaturePtr  theFeature,
std::string  theAttribute 
)
pure virtual

Returns true if the attribute must be checked (the case is selected)

Implemented in Model_ValidatorsFactory.

◆ registerGeometricalSelection()

virtual void ModelAPI_ValidatorsFactory::registerGeometricalSelection ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Register the selection attribute as geometrical selection.

Implemented in Model_ValidatorsFactory.

◆ isGeometricalSelection()

virtual bool ModelAPI_ValidatorsFactory::isGeometricalSelection ( std::string  theFeature,
std::string  theAttribute 
)
pure virtual

Returns true if the attribute is a geometrical selection.

Implemented in Model_ValidatorsFactory.