fw4spl
fwActivities::IActivityValidator Class Referenceabstract

Base class for all fwActivities activity validator's classes. More...

#include <IActivityValidator.hpp>

+ Inheritance diagram for fwActivities::IActivityValidator:
+ Collaboration diagram for fwActivities::IActivityValidator:

Public Member Functions

virtual bool isA (const std::string &type) const override
 
virtual FWACTIVITIES_API ValidationType validate (const ::fwActivities::registry::ActivityInfo &, const std::shared_ptr< const ::fwData::Vector > &) const override
 Does nothing.
 
virtual FWACTIVITIES_API ValidationType validate (const std::shared_ptr< const ::fwMedData::ActivitySeries > &activity) const =0
 Performs the validation of the given activity data. More...
 
FWACTIVITIES_API ValidationType checkRequirements (const std::shared_ptr< const ::fwMedData::ActivitySeries > &activity) const
 Checks if all the required data are present in the activity series. More...
 
FWACTIVITIES_API ValidationType checkParameters (const std::shared_ptr< const ::fwMedData::ActivitySeries > &activity) const
 Checks if all the activity's AppConfig parameters are valid. More...
 
FWACTIVITIES_API ValidationType checkObject (const std::shared_ptr< const ::fwData::Object > &object, const std::string &validatorImpl) const
 Calls the object validator if it is defined. More...
 
- Public Member Functions inherited from fwActivities::IValidator
- Public Member Functions inherited from fwCore::BaseObject
virtual const std::string & getLeafClassname () const
 return object's classname without its namespace, i.e. BaseObject
 

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwActivities::IValidator
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Demangling methods

virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 

Additional Inherited Members

- Public Types inherited from fwActivities::IValidator
typedef std::pair< bool, std::string > ValidationType
 Defines validation result of an activity. First element tells if the activity is validated or not by the IValidator implementation. Second element may contains information about the result of activity validation.
 
typedef ::fwActivities::validator::factory::Key Key
 

Detailed Description

Base class for all fwActivities activity validator's classes.

This validator allows to check if all the required data are valid for the activity.

Definition at line 29 of file IActivityValidator.hpp.

Member Function Documentation

IValidator::ValidationType fwActivities::IActivityValidator::checkObject ( const std::shared_ptr< const ::fwData::Object > &  object,
const std::string &  validatorImpl 
) const

Calls the object validator if it is defined.

Parameters
objectobject to validate
validatorImplimplementation of the validator to apply (if it is empty, check is assumed as valid).
Returns
pair <isValid, errorMsg> : errorMsg is empty if the object is valid else it contains the detailed error.
See also
fwActivities::IObjectValidator

Process object validator

Definition at line 240 of file IActivityValidator.cpp.

Referenced by checkRequirements().

+ Here is the caller graph for this function:

IValidator::ValidationType fwActivities::IActivityValidator::checkParameters ( const std::shared_ptr< const ::fwMedData::ActivitySeries > &  activity) const

Checks if all the activity's AppConfig parameters are valid.

It checks if the object described with "camp" path are present in the activity.

Returns
pair <isValid, errorMsg> : errorMsg is empty if the data are valid else it contains the list of missing (or not valid) data.

Definition at line 204 of file IActivityValidator.cpp.

References fwActivities::registry::Activities::getDefault().

+ Here is the call graph for this function:

IValidator::ValidationType fwActivities::IActivityValidator::checkRequirements ( const std::shared_ptr< const ::fwMedData::ActivitySeries > &  activity) const

Checks if all the required data are present in the activity series.

Returns
pair <isValid, errorMsg> : errorMsg is empty if the data are valid else it contains the list of missing (or not valid) data.

Definition at line 23 of file IActivityValidator.cpp.

References checkObject(), fwActivities::registry::ActivityRequirement::container, fwActivities::registry::ActivityRequirement::create, fwActivities::registry::Activities::getDefault(), fwActivities::registry::ActivityRequirement::keys, fwActivities::registry::ActivityRequirement::maxOccurs, fwActivities::registry::ActivityRequirement::minOccurs, fwActivities::registry::ActivityRequirement::type, and fwActivities::registry::ActivityRequirement::validator.

+ Here is the call graph for this function:

virtual FWACTIVITIES_API ValidationType fwActivities::IActivityValidator::validate ( const std::shared_ptr< const ::fwMedData::ActivitySeries > &  activity) const
pure virtual

Performs the validation of the given activity data.

Returns
pair <isValid, errorMsg> : errorMsg is empty if the data are valid else it contains detailed error.

Implemented in fwActivities::validator::DefaultActivity.


The documentation for this class was generated from the following files: