AlgorithmHasProperty.h 1.07 KB
Newer Older
1
2
3
4
5
6
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
//     NScD Oak Ridge National Laboratory, European Spallation Source
//     & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8

9
#include "MantidAPI/DllConfig.h"
10
#include "MantidKernel/TypedValidator.h"
11

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace Mantid {
namespace API {

class IAlgorithm;

/**
  A validator to check whether a given algorithm has a named property.
  The algorithm's property must be valid for the validator to pass.

  @author Martyn Gigg, Tessella plc
  @date 30/03/2011
*/
class MANTID_API_DLL AlgorithmHasProperty
    : public Kernel::TypedValidator<boost::shared_ptr<IAlgorithm>> {
public:
  AlgorithmHasProperty(const std::string &propName);
28
29
  std::string getType() const;
  Kernel::IValidator_sptr clone() const override;
Hahn, Steven's avatar
Hahn, Steven committed
30

31
protected:
32
33
  std::string
  checkValidity(const boost::shared_ptr<IAlgorithm> &value) const override;
34
35
36
37
38
39

private:
  /// Store the property name
  std::string m_propName;
};

40
} // namespace API
LamarMoore's avatar
LamarMoore committed
41
} // namespace Mantid
42