From 8843ff2e46b881957c3513790828f336974364e4 Mon Sep 17 00:00:00 2001
From: Owen Arnold <owen.arnold@stfc.ac.uk>
Date: Wed, 11 Dec 2013 10:50:53 +0000
Subject: [PATCH] refs #8589. Create a base algorithm class.

---
 .../Framework/Algorithms/CMakeLists.txt       |  2 +
 .../CreateTransmissionWorkspace.h             |  4 +-
 .../ReflectometryReductionOne.h               |  4 +-
 .../ReflectometryWorkflowBase.h               | 51 +++++++++++++++++++
 .../src/ReflectometryWorkflowBase.cpp         | 30 +++++++++++
 5 files changed, 87 insertions(+), 4 deletions(-)
 create mode 100644 Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
 create mode 100644 Code/Mantid/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp

diff --git a/Code/Mantid/Framework/Algorithms/CMakeLists.txt b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
index 5e90d8ae502..bea0d1e11a9 100644
--- a/Code/Mantid/Framework/Algorithms/CMakeLists.txt
+++ b/Code/Mantid/Framework/Algorithms/CMakeLists.txt
@@ -170,6 +170,7 @@ set ( SRC_FILES
 	src/Rebunch.cpp
 	src/RecordPythonScript.cpp
 	src/ReflectometryReductionOne.cpp
+	src/ReflectometryWorkflowBase.cpp
 	src/Regroup.cpp
 	src/RemoveBins.cpp
 	src/RemoveExpDecay.cpp
@@ -394,6 +395,7 @@ set ( INC_FILES
 	inc/MantidAlgorithms/Rebunch.h
 	inc/MantidAlgorithms/RecordPythonScript.h
 	inc/MantidAlgorithms/ReflectometryReductionOne.h
+	inc/MantidAlgorithms/ReflectometryWorkflowBase.h
 	inc/MantidAlgorithms/Regroup.h
 	inc/MantidAlgorithms/RemoveBins.h
 	inc/MantidAlgorithms/RemoveExpDecay.h
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
index 598a9dabf69..ae786003708 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/CreateTransmissionWorkspace.h
@@ -2,7 +2,7 @@
 #define MANTID_ALGORITHMS_CREATETRANSMISSIONWORKSPACE_H_
 
 #include "MantidKernel/System.h"
-#include "MantidAPI/DataProcessorAlgorithm.h"
+#include "MantidAlgorithms/ReflectometryWorkflowBase.h"
 
 namespace Mantid
 {
@@ -31,7 +31,7 @@ namespace Algorithms
     File change history is stored at: <https://github.com/mantidproject/mantid>
     Code Documentation is available at: <http://doxygen.mantidproject.org>
   */
-  class DLLExport CreateTransmissionWorkspace  : public API::DataProcessorAlgorithm
+  class DLLExport CreateTransmissionWorkspace  : public ReflectometryWorkflowBase
   {
   public:
     CreateTransmissionWorkspace();
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
index 22d53d41c4f..8948fa9948a 100644
--- a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryReductionOne.h
@@ -2,11 +2,11 @@
 #define MANTID_ALGORITHMS_REFLECTOMETRYREDUCTIONONE_H_
 
 #include "MantidKernel/System.h"
-#include "MantidAPI/DataProcessorAlgorithm.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/IComponent.h"
 #include "MantidGeometry/IDetector.h"
+#include "MantidAlgorithms/ReflectometryWorkflowBase.h"
 #include <boost/optional.hpp>
 #include <boost/tuple/tuple.hpp>
 #include <vector>
@@ -38,7 +38,7 @@ namespace Mantid
      File change history is stored at: <https://github.com/mantidproject/mantid>
      Code Documentation is available at: <http://doxygen.mantidproject.org>
      */
-    class DLLExport ReflectometryReductionOne: public API::DataProcessorAlgorithm
+    class DLLExport ReflectometryReductionOne: public ReflectometryWorkflowBase
     {
     public:
 
diff --git a/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
new file mode 100644
index 00000000000..cde2f802e3a
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/ReflectometryWorkflowBase.h
@@ -0,0 +1,51 @@
+#ifndef MANTID_ALGORITHMS_REFLECTOMETRYWORKFLOWBASE_H_
+#define MANTID_ALGORITHMS_REFLECTOMETRYWORKFLOWBASE_H_
+
+#include "MantidKernel/System.h"
+#include "MantidAPI/DataProcessorAlgorithm.h"
+
+namespace Mantid
+{
+namespace Algorithms
+{
+
+  /** ReflectometryWorkflowBase : Abstract workflow algortithm base class containing common implementation functionality usable
+   *  by concrete reflectometry workflow algorithms.
+    
+    Copyright &copy; 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
+
+    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://github.com/mantidproject/mantid>
+    Code Documentation is available at: <http://doxygen.mantidproject.org>
+  */
+  class DLLExport ReflectometryWorkflowBase  : public API::DataProcessorAlgorithm
+  {
+  public:
+    ReflectometryWorkflowBase();
+    virtual ~ReflectometryWorkflowBase();
+    
+
+  //protected:
+
+
+  };
+
+
+} // namespace Algorithms
+} // namespace Mantid
+
+#endif  /* MANTID_ALGORITHMS_REFLECTOMETRYWORKFLOWBASE_H_ */
diff --git a/Code/Mantid/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp b/Code/Mantid/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp
new file mode 100644
index 00000000000..8ddee29bd5b
--- /dev/null
+++ b/Code/Mantid/Framework/Algorithms/src/ReflectometryWorkflowBase.cpp
@@ -0,0 +1,30 @@
+/*WIKI*
+TODO: Enter a full wiki-markup description of your algorithm here. You can then use the Build/wiki_maker.py script to generate your full wiki page.
+*WIKI*/
+
+#include "MantidAlgorithms/ReflectometryWorkflowBase.h"
+
+namespace Mantid
+{
+namespace Algorithms
+{
+
+  //----------------------------------------------------------------------------------------------
+  /** Constructor
+   */
+  ReflectometryWorkflowBase::ReflectometryWorkflowBase()
+  {
+  }
+    
+  //----------------------------------------------------------------------------------------------
+  /** Destructor
+   */
+  ReflectometryWorkflowBase::~ReflectometryWorkflowBase()
+  {
+  }
+  
+
+
+
+} // namespace Algorithms
+} // namespace Mantid
-- 
GitLab