Skip to content
Snippets Groups Projects
IAlgorithm.h 3.98 KiB
Newer Older
#ifndef MANTID_KERNEL_IALGORITHM_H_
#define MANTID_KERNEL_IALGORITHM_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include <string>
#include <vector>
#include "MantidKernel/INamedInterface.h"
Nick Draper's avatar
Nick Draper committed
namespace API
// 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

 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 &copy; 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.

  /// 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
   *  @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;
Dickon Champion's avatar
Dickon Champion 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;

Dickon Champion's avatar
Dickon Champion committed
  /** Set the value of an algorithm property by index
Dickon Champion's avatar
Dickon Champion committed
   *  @param index The index of the property to set
Dickon Champion's avatar
Dickon Champion committed
   *  @param value The value to assign to the property
   */
  virtual void setPropertyOrdinal(const int& index, const std::string& value) = 0;


  /** 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;
Nick Draper's avatar
Nick Draper committed
} // namespace API
} // namespace Mantid

#endif /*MANTID_KERNEL_IALGORITHM_H_*/