From d11963c20ff798bbf2dd72b612dfeb8de4cb6ac9 Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@gmail.com>
Date: Thu, 26 Nov 2015 12:56:38 +0000
Subject: [PATCH] Introduce a typedef for unique_ptr<IAlgorithm>

The definitions, along with the shared_ptr variants have been moved
to a fwd declare header.
Refs #14599
---
 Framework/API/CMakeLists.txt                 |  1 +
 Framework/API/inc/MantidAPI/IAlgorithm.h     | 12 +----
 Framework/API/inc/MantidAPI/IAlgorithm_fwd.h | 48 ++++++++++++++++++++
 3 files changed, 50 insertions(+), 11 deletions(-)
 create mode 100644 Framework/API/inc/MantidAPI/IAlgorithm_fwd.h

diff --git a/Framework/API/CMakeLists.txt b/Framework/API/CMakeLists.txt
index f847f9e46dd..4abf2d8319c 100644
--- a/Framework/API/CMakeLists.txt
+++ b/Framework/API/CMakeLists.txt
@@ -202,6 +202,7 @@ set ( INC_FILES
 	inc/MantidAPI/HistoryItem.h
 	inc/MantidAPI/HistoryView.h
 	inc/MantidAPI/IAlgorithm.h
+	inc/MantidAPI/IAlgorithm_fwd.h
 	inc/MantidAPI/IArchiveSearch.h
 	inc/MantidAPI/IBackgroundFunction.h
 	inc/MantidAPI/IBoxControllerIO.h
diff --git a/Framework/API/inc/MantidAPI/IAlgorithm.h b/Framework/API/inc/MantidAPI/IAlgorithm.h
index 445be5047e9..bffe1ca7094 100644
--- a/Framework/API/inc/MantidAPI/IAlgorithm.h
+++ b/Framework/API/inc/MantidAPI/IAlgorithm.h
@@ -5,10 +5,9 @@
 // Includes
 //----------------------------------------------------------------------
 #include "MantidAPI/DllConfig.h"
+#include "MantidAPI/IAlgorithm_fwd.h"
 #include "MantidKernel/IPropertyManager.h"
 
-#include <memory>
-
 namespace Poco {
 class AbstractObserver;
 template <class T> class ActiveResult;
@@ -179,15 +178,6 @@ public:
   virtual std::string toString() const = 0;
 };
 
-/// Typedef for shared_ptr to IAlgorithm
-typedef boost::shared_ptr<IAlgorithm> IAlgorithm_sptr;
-/// Typedef for shared_ptr to IAlgorithm (const version)
-typedef boost::shared_ptr<const IAlgorithm> IAlgorithm_const_sptr;
-/// Typedef for unique_ptr to IAlgorithm
-typedef std::unique<IAlgorithm> IAlgorithm_uptr;
-/// Typedef for unique_ptr to IAlgorithm (const version)
-typedef std::unique_ptr<const IAlgorithm> IAlgorithm_const_uptr;
-
 } // namespace API
 } // namespace Mantid
 
diff --git a/Framework/API/inc/MantidAPI/IAlgorithm_fwd.h b/Framework/API/inc/MantidAPI/IAlgorithm_fwd.h
new file mode 100644
index 00000000000..84e31b1a6a1
--- /dev/null
+++ b/Framework/API/inc/MantidAPI/IAlgorithm_fwd.h
@@ -0,0 +1,48 @@
+#ifndef MANTID_API_IALGORITHM_FWD_H_
+#define MANTID_API_IALGORITHM_FWD_H_
+
+#include <boost/shared_ptr.hpp>
+#include <memory>
+
+namespace Mantid {
+namespace API {
+/**
+  This file provides forward declarations for Mantid::API::IAlgorithm
+
+  Copyright &copy; 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
+  National Laboratory & European Spallation Source
+
+  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>
+*/
+
+/// forward declare of Mantid::API::IAlgorithm
+class IAlgorithm;
+/// shared pointer to Mantid::API::IAlgorithm
+typedef boost::shared_ptr<IAlgorithm> IAlgorithm_sptr;
+/// shared pointer to Mantid::API::IAlgorithm (const version)
+typedef boost::shared_ptr<const IAlgorithm> IAlgorithm_const_sptr;
+/// unique pointer to Mantid::API::IAlgorithm
+typedef std::unique_ptr<IAlgorithm> IAlgorithm_uptr;
+/// unique pointer to Mantid::API::IAlgorithm (const version)
+typedef std::unique_ptr<const IAlgorithm> IAlgorithm_const_uptr;
+
+} // namespace API
+} // namespace Mantid
+
+#endif // MANTID_API_IALGORITHM_FWD_H_
-- 
GitLab