Newer
Older
Russell Taylor
committed
#ifndef MANTID_KERNEL_IALGORITHM_H_
#define MANTID_KERNEL_IALGORITHM_H_
Russell Taylor
committed
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include <string>
#include <vector>
Russell Taylor
committed
#include "MantidKernel/INamedInterface.h"
#include "MantidKernel/Property.h"
Russell Taylor
committed
namespace Mantid
{
Russell Taylor
committed
{
Russell Taylor
committed
// Declaration of the interface ID ( interface id, major version, minor version)
// RJT: Have not yet imported the code for this (in IInterface.h in Gaudi)
//static const InterfaceID IID_IAlgorithm("IAlgorithm", 3 , 0);
/** @class IAlgorithm IAlgorithm.h Kernel/IAlgorithm.h
Russell Taylor
committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
IAlgorithm is the interface implemented by the Algorithm base class.
Concrete algorithms, derived from the Algorithm base class are controlled
via this interface.
@author Russell Taylor, Tessella Support Services plc
@author Based on the Gaudi class of the same name (see http://proj-gaudi.web.cern.ch/proj-gaudi/)
@date 11/09/2007
Copyright © 2007 STFC Rutherford Appleton Laboratories
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport IAlgorithm : virtual public Kernel::INamedInterface
{
public:
// Retrieve interface ID
// static const InterfaceID& interfaceID() { return IID_IAlgorithm; }
/// Virtual destructor (always needed for abstract classes)
virtual ~IAlgorithm() {}
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the init() method of the derived algorithm,
* and of any sub-algorithms which it creates.
*/
virtual void initialize() = 0;
/// System execution. This method invokes the exec() method of a concrete algorithm.
Anders Markvardsen
committed
virtual bool execute() = 0;
Russell Taylor
committed
/// Check whether the algorithm is initialized properly
virtual bool isInitialized() const = 0;
/// Check whether the algorithm has already been executed
virtual bool isExecuted() const = 0;
/** Set the value of an algorithm property by string
Russell Taylor
committed
* @param name The name of the property to set
* @param value The value to assign to the property
*/
virtual void setPropertyValue(const std::string& name, const std::string& value) = 0;
Freddie Akeroyd
committed
/** Set the value of an algorithm properties by string
* @param propertiesArray A separated string containing the properties and their values.
*/
virtual void setProperties(const std::string& propertiesArray) = 0;
* @param value The value to assign to the property
*/
virtual void setPropertyOrdinal(const int& index, const std::string& value) = 0;
Russell Taylor
committed
/** Get the value of a property as a string
* @param name The name of the property
* @return The value of the property
*/
virtual std::string getPropertyValue( const std::string &name ) const = 0;
/// Get the list of propeties associated with an Algorithm
virtual const std::vector< Mantid::Kernel::Property* >& getProperties() const = 0;
Russell Taylor
committed
};
Russell Taylor
committed
Russell Taylor
committed
} // namespace Mantid
#endif /*MANTID_KERNEL_IALGORITHM_H_*/