summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-08-28 11:58:39 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2018-08-28 12:12:40 +0200
commitff18ec0fba305d041aa5abdccb943fccfaa8e4f5 (patch)
tree25dae821d1ec321611667622cd3bffc43ab3381b
parent21ae85a5a54a9822931b8965b08d806ea45e1dfe (diff)
downloadastra-ff18ec0fba305d041aa5abdccb943fccfaa8e4f5.tar.gz
astra-ff18ec0fba305d041aa5abdccb943fccfaa8e4f5.tar.bz2
astra-ff18ec0fba305d041aa5abdccb943fccfaa8e4f5.tar.xz
astra-ff18ec0fba305d041aa5abdccb943fccfaa8e4f5.zip
Fix missing findPlugin function in Windows
-rw-r--r--include/astra/AstraObjectFactory.h17
-rw-r--r--src/AstraObjectFactory.cpp12
2 files changed, 13 insertions, 16 deletions
diff --git a/include/astra/AstraObjectFactory.h b/include/astra/AstraObjectFactory.h
index 91efa61..8d31b53 100644
--- a/include/astra/AstraObjectFactory.h
+++ b/include/astra/AstraObjectFactory.h
@@ -39,9 +39,7 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#include "AlgorithmTypelist.h"
-#ifdef ASTRA_PYTHON
#include "PluginAlgorithmFactory.h"
-#endif
namespace astra {
@@ -106,6 +104,9 @@ CAstraObjectFactory<T, TypeList>::~CAstraObjectFactory()
//----------------------------------------------------------------------------------------
// Hook for finding plugin in registered plugins.
+template <>
+CAlgorithm* CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>::findPlugin(std::string _sType);
+
template <typename T, typename TypeList>
T* CAstraObjectFactory<T, TypeList>::findPlugin(std::string _sType)
{
@@ -135,18 +136,6 @@ T* CAstraObjectFactory<T, TypeList>::create(std::string _sType)
*/
class _AstraExport CAlgorithmFactory : public CAstraObjectFactory<CAlgorithm, AlgorithmTypeList> {};
-#ifdef ASTRA_PYTHON
-template <>
-inline CAlgorithm* CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>::findPlugin(std::string _sType)
- {
- CPluginAlgorithmFactory *fac = CPluginAlgorithmFactory::getFactory();
- if (fac)
- return fac->getPlugin(_sType);
- else
- return 0;
- }
-#endif
-
/**
* Class used to create 2D projectors from a string or a config object
*/
diff --git a/src/AstraObjectFactory.cpp b/src/AstraObjectFactory.cpp
index 2ce7474..a103bc6 100644
--- a/src/AstraObjectFactory.cpp
+++ b/src/AstraObjectFactory.cpp
@@ -27,12 +27,20 @@ along with the ASTRA Toolbox. If not, see <http://www.gnu.org/licenses/>.
#include "astra/AstraObjectFactory.h"
-using namespace std;
-
namespace astra {
DEFINE_SINGLETON2(CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>)
DEFINE_SINGLETON2(CAstraObjectFactory<CProjector2D, Projector2DTypeList>)
DEFINE_SINGLETON2(CAstraObjectFactory<CProjector3D, Projector3DTypeList>)
+template <>
+CAlgorithm* CAstraObjectFactory<CAlgorithm, AlgorithmTypeList>::findPlugin(std::string _sType)
+{
+ CPluginAlgorithmFactory *fac = CPluginAlgorithmFactory::getFactory();
+ if (fac)
+ return fac->getPlugin(_sType);
+ else
+ return 0;
+}
+
} // end namespace