fw4spl
IActivityValidator.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2016-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "fwActivities/config.hpp"
10 #include "fwActivities/IValidator.hpp"
11 
12 #include <fwCore/base.hpp>
13 
14 #include <fwMedData/ActivitySeries.hpp>
15 
16 namespace fwMedData
17 {
18 class ActivitySeries;
19 }
20 
21 namespace fwActivities
22 {
23 
29 class FWACTIVITIES_CLASS_API IActivityValidator : public ::fwActivities::IValidator
30 {
31 
32 public:
33 
35 
36 
37  FWACTIVITIES_API virtual ValidationType validate(
38  const ::fwActivities::registry::ActivityInfo&,
39  const CSPTR(::fwData::Vector)& ) const override
40  {
41  ValidationType validation;
42  validation.first = true;
43  validation.second = "This validator does not validate this selection of data.";
44  return validation;
45  }
46 
51  FWACTIVITIES_API virtual ValidationType validate(const CSPTR(::fwMedData::ActivitySeries)& activity ) const = 0;
52 
58  FWACTIVITIES_API ValidationType checkRequirements(const CSPTR(::fwMedData::ActivitySeries)& activity) const;
59 
67  FWACTIVITIES_API ValidationType checkParameters(const CSPTR(::fwMedData::ActivitySeries)& activity) const;
68 
76  FWACTIVITIES_API ValidationType checkObject(const CSPTR(::fwData::Object)& object,
77  const std::string& validatorImpl) const;
78 };
79 
80 } // namespace fwActivities
#define CSPTR(_cls_)
Contains fwAtomsFilter::registry details.
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
std::pair< bool, std::string > ValidationType
Defines validation result of an activity. First element tells if the activity is validated or not by ...
Definition: IValidator.hpp:39
Namespace containing medical data.
Base class for all fwActivities activity validator&#39;s classes.
Base class for all fwActivities validator&#39;s classes.
Definition: IValidator.hpp:29
Base class for each data object.
Namespace containing activities data and builder.
Contains the representation of the data objects used in the framework.