diff --git a/Framework/API/CMakeLists.txt b/Framework/API/CMakeLists.txt index de884455501c85a23895c1a2c2dc158e530ab698..3199f5d6a4e047488aff97cb8b269011148e200e 100644 --- a/Framework/API/CMakeLists.txt +++ b/Framework/API/CMakeLists.txt @@ -12,6 +12,7 @@ set ( SRC_FILES src/Axis.cpp src/BinEdgeAxis.cpp src/BoxController.cpp + src/CatalogFactory.cpp src/CatalogManager.cpp src/CatalogSession.cpp src/ChopperModel.cpp diff --git a/Framework/API/inc/MantidAPI/AlgorithmFactory.h b/Framework/API/inc/MantidAPI/AlgorithmFactory.h index 3869d01863ab49b2f8ad868e38520c82809d41db..37c18ad440faf7432f6eddcadab5225269947b64 100644 --- a/Framework/API/inc/MantidAPI/AlgorithmFactory.h +++ b/Framework/API/inc/MantidAPI/AlgorithmFactory.h @@ -168,14 +168,6 @@ private: VersionMap m_vmap; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<AlgorithmFactoryImpl>; -#endif /* _WIN32 */ - typedef Mantid::Kernel::SingletonHolder<AlgorithmFactoryImpl> AlgorithmFactory; @@ -188,4 +180,10 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DynamicFactory< } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::AlgorithmFactoryImpl>; +} +} + #endif /*MANTID_API_ALGORITHMFACTORY_H_*/ diff --git a/Framework/API/inc/MantidAPI/AnalysisDataService.h b/Framework/API/inc/MantidAPI/AnalysisDataService.h index d56ddcef2bd2619386e850017dccebac40e0e149..e9bf588fd3d780b01be28224ab26f0910103122a 100644 --- a/Framework/API/inc/MantidAPI/AnalysisDataService.h +++ b/Framework/API/inc/MantidAPI/AnalysisDataService.h @@ -178,14 +178,7 @@ private: std::string m_illegalChars; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AnalysisDataServiceImpl (needed for dllexport/dllimport) and a typedef for -/// it. -#ifdef _WIN32 -// this breaks new namespace declaration rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<AnalysisDataServiceImpl>; -#endif /* _WIN32 */ + typedef Mantid::Kernel::SingletonHolder<AnalysisDataServiceImpl> AnalysisDataService; @@ -249,4 +242,10 @@ typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> & } // Namespace API } // Namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::AnalysisDataServiceImpl>; +} +} + #endif /*MANTID_KERNEL_ANALYSISDATASERVICE_H_*/ diff --git a/Framework/API/inc/MantidAPI/ArchiveSearchFactory.h b/Framework/API/inc/MantidAPI/ArchiveSearchFactory.h index 875d6950d1430b238767ba8818b0847ee0f8cae2..98855c2622f4c3c7fba7c496bcd6a0d8dbf42497 100644 --- a/Framework/API/inc/MantidAPI/ArchiveSearchFactory.h +++ b/Framework/API/inc/MantidAPI/ArchiveSearchFactory.h @@ -56,17 +56,15 @@ private: ~ArchiveSearchFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ArchiveSearchFactoryImpl>; -#endif /* _WIN32 */ - typedef Mantid::Kernel::SingletonHolder<ArchiveSearchFactoryImpl> ArchiveSearchFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ArchiveSearchFactoryImpl>; +} +} + #endif // MANTID_API_ARCHIVESEARCHFACTORY_H_ diff --git a/Framework/API/inc/MantidAPI/CatalogFactory.h b/Framework/API/inc/MantidAPI/CatalogFactory.h index dc09ed9e26357aaf276078a69fac69ebbbb2d136..1bc7a885f9dceef154138a521f78bfd5a8588a1b 100644 --- a/Framework/API/inc/MantidAPI/CatalogFactory.h +++ b/Framework/API/inc/MantidAPI/CatalogFactory.h @@ -76,13 +76,6 @@ private: mutable std::map<std::string, boost::shared_ptr<ICatalog>> m_createdCatalogs; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// CatalogFactoryImpl (needed for dllexport/dllimport) . -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<CatalogFactoryImpl>; -#endif /* _WIN32 */ /// The specialisation of the SingletonHolder class that holds the /// CatalogFactory typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> @@ -91,4 +84,10 @@ typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::CatalogFactoryImpl>; +} +} + #endif /*MANTID_API_CATALOGFACTORYIMPL_H_*/ diff --git a/Framework/API/inc/MantidAPI/CatalogManager.h b/Framework/API/inc/MantidAPI/CatalogManager.h index 05b65ebc7945af211539b45529ae73590d304003..f528e2fd4a5544a995e6271511064a56e621010a 100644 --- a/Framework/API/inc/MantidAPI/CatalogManager.h +++ b/Framework/API/inc/MantidAPI/CatalogManager.h @@ -67,11 +67,14 @@ private: std::map<CatalogSession_sptr, ICatalog_sptr> m_activeCatalogs; }; -#ifdef _WIN32 -template class MANTID_API_DLL Kernel::SingletonHolder<CatalogManagerImpl>; -#endif typedef Kernel::SingletonHolder<CatalogManagerImpl> CatalogManager; } } + +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Kernel::SingletonHolder<Mantid::API::CatalogManagerImpl>; +} +} #endif /* MANTID_ICAT_CATALOGMANAGERIMPL_H_ */ diff --git a/Framework/API/inc/MantidAPI/ColumnFactory.h b/Framework/API/inc/MantidAPI/ColumnFactory.h index e17431b2d12ef08df0f49b686c7667bc8c78cc3e..2db50e7ca764ea0bfbde5489c555adc87a2e5673 100644 --- a/Framework/API/inc/MantidAPI/ColumnFactory.h +++ b/Framework/API/inc/MantidAPI/ColumnFactory.h @@ -63,17 +63,16 @@ private: ~ColumnFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ColumnFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<ColumnFactoryImpl> ColumnFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ColumnFactoryImpl>; +} +} + #endif /*MANTID_API_COLUMNFACTORY_H_*/ diff --git a/Framework/API/inc/MantidAPI/ConstraintFactory.h b/Framework/API/inc/MantidAPI/ConstraintFactory.h index 1d18787c26e464d7da8d7b239ffca391e6a7b44b..a4f210fdf7baa818897e1fd520fe027f4f3cc444 100644 --- a/Framework/API/inc/MantidAPI/ConstraintFactory.h +++ b/Framework/API/inc/MantidAPI/ConstraintFactory.h @@ -72,19 +72,18 @@ private: ~ConstraintFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ConstraintFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<ConstraintFactoryImpl> ConstraintFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ConstraintFactoryImpl>; +} +} + /** * Macro for declaring a new type of function to be used with the * FunctionFactory diff --git a/Framework/API/inc/MantidAPI/CostFunctionFactory.h b/Framework/API/inc/MantidAPI/CostFunctionFactory.h index b18865e04061739b206b5a60a9c0fb4fb9b421f4..c1717e0b3653fe1e6364aaf1332716ab6577093b 100644 --- a/Framework/API/inc/MantidAPI/CostFunctionFactory.h +++ b/Framework/API/inc/MantidAPI/CostFunctionFactory.h @@ -63,17 +63,17 @@ private: CostFunctionFactoryImpl(); }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<CostFunctionFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<CostFunctionFactoryImpl> CostFunctionFactory; } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::CostFunctionFactoryImpl>; +} +} + #endif /*MANTID_API_COSTFUNCTIONFACTORY_H_*/ diff --git a/Framework/API/inc/MantidAPI/DllConfig.h b/Framework/API/inc/MantidAPI/DllConfig.h index ff00439cca87c79e51166aca4a6e0e0eeeea87ef..c335cb665f6023ff4a6d918ca4aca2d1c5748657 100644 --- a/Framework/API/inc/MantidAPI/DllConfig.h +++ b/Framework/API/inc/MantidAPI/DllConfig.h @@ -32,8 +32,10 @@ #ifdef IN_MANTID_API #define MANTID_API_DLL DLLExport +#define EXTERN_MANTID_API extern #else #define MANTID_API_DLL DLLImport +#define EXTERN_MANTID_API extern #endif /* IN_MANTID_API*/ #endif // MANTID_API_DLLCONFIG_H_ diff --git a/Framework/API/inc/MantidAPI/DomainCreatorFactory.h b/Framework/API/inc/MantidAPI/DomainCreatorFactory.h index 6cb63eaaa718eb83b0b2be00b9d6a89bbf80d4e4..b778a7577093f27cc89284444f84fc68ee0a988b 100644 --- a/Framework/API/inc/MantidAPI/DomainCreatorFactory.h +++ b/Framework/API/inc/MantidAPI/DomainCreatorFactory.h @@ -68,18 +68,16 @@ private: using Kernel::DynamicFactory<IDomainCreator>::createUnwrapped; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// DomainCreatorFactoryImpl (needed for dllexport/dllimport) and a typedef for -/// it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<DomainCreatorFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<DomainCreatorFactoryImpl> DomainCreatorFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::DomainCreatorFactoryImpl>; +} +} + #endif /* MANTID_API_DOMAINCREATORFACTORY_H_ */ diff --git a/Framework/API/inc/MantidAPI/FileFinder.h b/Framework/API/inc/MantidAPI/FileFinder.h index 80956529005ab0a59e0f0d82c033237634d37e2a..92ef7c19cfca61848d7add051f29b4ec61bf6f81 100644 --- a/Framework/API/inc/MantidAPI/FileFinder.h +++ b/Framework/API/inc/MantidAPI/FileFinder.h @@ -94,16 +94,15 @@ private: int m_globOption; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<FileFinderImpl>; -#endif /* _WIN32 */ - typedef Mantid::Kernel::SingletonHolder<FileFinderImpl> FileFinder; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FileFinderImpl>; +} +} + #endif // MANTID_API_FILEFINDER_H_ diff --git a/Framework/API/inc/MantidAPI/FileLoaderRegistry.h b/Framework/API/inc/MantidAPI/FileLoaderRegistry.h index 18a300ac9f9b46f8cd4cc563b6ef682b7c7394f6..c3e3bf2f16f6b105da1640f59cceda648a88b18a 100644 --- a/Framework/API/inc/MantidAPI/FileLoaderRegistry.h +++ b/Framework/API/inc/MantidAPI/FileLoaderRegistry.h @@ -144,15 +144,6 @@ private: mutable Kernel::Logger m_log; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// FileLoaderRegistryImpl (needed for dllexport/dllimport) and a typedef for -/// it. -#ifdef _WIN32 -// this breaks new namespace declaration rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl>; -#endif /* _WIN32 */ - /// Type for the actual singleton instance typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl> FileLoaderRegistry; @@ -160,4 +151,10 @@ typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl> } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FileLoaderRegistryImpl>; +} +} + #endif /* MANTID_API_FILELOADERREGISTRY_H_ */ diff --git a/Framework/API/inc/MantidAPI/FrameworkManager.h b/Framework/API/inc/MantidAPI/FrameworkManager.h index 2053bfa975099eb798c8bfba44b0b774b79ac53d..90383b3f0ed271dbe0bed1e5c59b455df8070ae0 100644 --- a/Framework/API/inc/MantidAPI/FrameworkManager.h +++ b/Framework/API/inc/MantidAPI/FrameworkManager.h @@ -135,17 +135,16 @@ private: #endif }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaration rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<FrameworkManagerImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<FrameworkManagerImpl> FrameworkManager; } // namespace Kernel } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FrameworkManagerImpl>; +} +} + #endif /*MANTID_API_FRAMEWORKMANAGER_H_*/ diff --git a/Framework/API/inc/MantidAPI/FuncMinimizerFactory.h b/Framework/API/inc/MantidAPI/FuncMinimizerFactory.h index 850ce1c40d9a092d35e98496d00e7bdc7d2a891a..a8466107519a9fed222c4fa3a59e3b9218c167f7 100644 --- a/Framework/API/inc/MantidAPI/FuncMinimizerFactory.h +++ b/Framework/API/inc/MantidAPI/FuncMinimizerFactory.h @@ -61,19 +61,18 @@ private: FuncMinimizerFactoryImpl(); }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<FuncMinimizerFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<FuncMinimizerFactoryImpl> FuncMinimizerFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FuncMinimizerFactoryImpl>; +} +} + /** * Macro for declaring a new type of minimizers to be used with the * FuncMinimizerFactory diff --git a/Framework/API/inc/MantidAPI/FunctionFactory.h b/Framework/API/inc/MantidAPI/FunctionFactory.h index 0b708712df16e5bb63851e2dcfb7480cb37c76ca..b9e8c214a390f1b3124616a11bb74a989fb21217 100644 --- a/Framework/API/inc/MantidAPI/FunctionFactory.h +++ b/Framework/API/inc/MantidAPI/FunctionFactory.h @@ -142,13 +142,6 @@ const std::vector<std::string> &FunctionFactoryImpl::getFunctionNames() const { return typeNames; } -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<FunctionFactoryImpl> FunctionFactory; @@ -161,6 +154,12 @@ typedef const Poco::AutoPtr<FunctionFactoryUpdateNotification> & } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FunctionFactoryImpl>; +} +} + /** * Macro for declaring a new type of function to be used with the * FunctionFactory diff --git a/Framework/API/inc/MantidAPI/ImplicitFunctionFactory.h b/Framework/API/inc/MantidAPI/ImplicitFunctionFactory.h index 55e0fa2f1933fa8f218732ccb8b033c920f01a2b..69196e90c4f1e16624f4f8d2ddb3d29235553ca6 100644 --- a/Framework/API/inc/MantidAPI/ImplicitFunctionFactory.h +++ b/Framework/API/inc/MantidAPI/ImplicitFunctionFactory.h @@ -64,18 +64,17 @@ private: ~ImplicitFunctionFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// ImplicitFunctionFactoryImpl (needed for dllexport/dllimport) and a typedef -/// for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ImplicitFunctionFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder< ImplicitFunctionFactoryImpl> ImplicitFunctionFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionFactoryImpl>; +} +} + + #endif diff --git a/Framework/API/inc/MantidAPI/ImplicitFunctionParameterParserFactory.h b/Framework/API/inc/MantidAPI/ImplicitFunctionParameterParserFactory.h index 07bfe8243733ba3728232b8586f9bb94bb038dfc..25096efc9bccfce8616159237c78313d402e208c 100644 --- a/Framework/API/inc/MantidAPI/ImplicitFunctionParameterParserFactory.h +++ b/Framework/API/inc/MantidAPI/ImplicitFunctionParameterParserFactory.h @@ -62,18 +62,16 @@ private: ~ImplicitFunctionParameterParserFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// ImplicitFunctionFactoryImpl (needed for dllexport/dllimport) and a typedef -/// for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ImplicitFunctionParameterParserFactoryImpl>; -#endif /* _WIN32 */ - typedef Mantid::Kernel::SingletonHolder<ImplicitFunctionParameterParserFactoryImpl> ImplicitFunctionParameterParserFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParameterParserFactoryImpl>; +} +} + #endif diff --git a/Framework/API/inc/MantidAPI/ImplicitFunctionParserFactory.h b/Framework/API/inc/MantidAPI/ImplicitFunctionParserFactory.h index 8da39a8f65f12d3e5f362c94e21928560173b06f..b4953ccd77180cdd688d79cb542d1f188b3bac22 100644 --- a/Framework/API/inc/MantidAPI/ImplicitFunctionParserFactory.h +++ b/Framework/API/inc/MantidAPI/ImplicitFunctionParserFactory.h @@ -66,18 +66,17 @@ private: ~ImplicitFunctionParserFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// ImplicitFunctionFactoryImpl (needed for dllexport/dllimport) and a typedef -/// for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ImplicitFunctionParserFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder< ImplicitFunctionParserFactoryImpl> ImplicitFunctionParserFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParserFactoryImpl>; +} +} + #endif diff --git a/Framework/API/inc/MantidAPI/InstrumentDataService.h b/Framework/API/inc/MantidAPI/InstrumentDataService.h index 5c7040c63ee28e705e619a65eaf05a99139c480d..79304263a4544e97fd0a7429c69ffca23be29874 100644 --- a/Framework/API/inc/MantidAPI/InstrumentDataService.h +++ b/Framework/API/inc/MantidAPI/InstrumentDataService.h @@ -48,17 +48,17 @@ private: operator=(const InstrumentDataServiceImpl &) = delete; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AnalysisDataServiceImpl (needed for dllexport/dllimport) and a typedef for -/// it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<InstrumentDataServiceImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder< InstrumentDataServiceImpl> InstrumentDataService; } // Namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::InstrumentDataServiceImpl>; +} +} + #endif /*INSTRUMENTDATASERVICE_*/ diff --git a/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h b/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h index 8718622b4fe4174da321ea0fcc17211b447923c5..05321c94a9a849dfb507b359a12f8faafb2fbea8 100644 --- a/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h +++ b/Framework/API/inc/MantidAPI/RemoteJobManagerFactory.h @@ -86,14 +86,6 @@ private: using Kernel::DynamicFactory<IRemoteJobManager>::create; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// RemoteJobManagerFactoryImpl (needed for dllexport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<RemoteJobManagerFactoryImpl>; -#endif /* _WIN32 */ - // The factory is just a specialisation of SingletonHolder typedef Mantid::Kernel::SingletonHolder< RemoteJobManagerFactoryImpl> RemoteJobManagerFactory; @@ -101,6 +93,13 @@ typedef Mantid::Kernel::SingletonHolder< } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::RemoteJobManagerFactoryImpl>; +} +} + /* Macro to register (remote job manager) classes into the factory. As * with the equivalent macros of the workspace factory or the * algorithm factory, this creates a global object in an anonymous diff --git a/Framework/API/inc/MantidAPI/ScriptRepositoryFactory.h b/Framework/API/inc/MantidAPI/ScriptRepositoryFactory.h index e8d098323f353179eb59deeea2924066359f8e18..a9db437db5f77a3666f20dc868ad81fede9fa28d 100644 --- a/Framework/API/inc/MantidAPI/ScriptRepositoryFactory.h +++ b/Framework/API/inc/MantidAPI/ScriptRepositoryFactory.h @@ -67,19 +67,20 @@ private: ~ScriptRepositoryFactoryImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<ScriptRepositoryFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder< ScriptRepositoryFactoryImpl> ScriptRepositoryFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::ScriptRepositoryFactoryImpl>; +} +} + + /** * Macro for declaring a new type of function to be used with the * FunctionFactory diff --git a/Framework/API/inc/MantidAPI/TransformScaleFactory.h b/Framework/API/inc/MantidAPI/TransformScaleFactory.h index d7913f746537e048f5eef671ce90039ef8aa2882..c1f715acbd3041f635fb651082d44dba959699e3 100644 --- a/Framework/API/inc/MantidAPI/TransformScaleFactory.h +++ b/Framework/API/inc/MantidAPI/TransformScaleFactory.h @@ -67,18 +67,17 @@ private: // Do not use default methods }; -/// Forward declaration of a specialisation of SingletonHolder for -/// TransformScaleFactoryImpl (needed for dllexport/dllimport) and a typedef for -/// it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<TransformScaleFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder< TransformScaleFactoryImpl> TransformScaleFactory; } // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::TransformScaleFactoryImpl>; +} +} + #endif /* MANTID_API_TRANSFORMSCALEFACTORY_H_ */ diff --git a/Framework/API/inc/MantidAPI/WorkspaceFactory.h b/Framework/API/inc/MantidAPI/WorkspaceFactory.h index 3dc53497f9a1907902c6fd406ee42d6b09d16e86..a89c5720aba7ce9bd04495ba993208e214903d78 100644 --- a/Framework/API/inc/MantidAPI/WorkspaceFactory.h +++ b/Framework/API/inc/MantidAPI/WorkspaceFactory.h @@ -98,17 +98,17 @@ private: using Kernel::DynamicFactory<Workspace>::create; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_API_DLL - Mantid::Kernel::SingletonHolder<WorkspaceFactoryImpl>; -#endif /* _WIN32 */ typedef Mantid::Kernel::SingletonHolder<WorkspaceFactoryImpl> WorkspaceFactory; -} // namespace Kernel +} // namespace API } // namespace Mantid +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_API template class MANTID_API_DLL + Mantid::Kernel::SingletonHolder<Mantid::API::WorkspaceFactoryImpl>; +} +} + #endif /*MANTID_KERNEL_WORKSPACEFACTORY_H_*/ diff --git a/Framework/API/src/AlgorithmFactory.cpp b/Framework/API/src/AlgorithmFactory.cpp index 3401322948f38b68864ff5901e82b02d7aba53f0..a5234ba34e0b49d16d38ce3c92e1352c7cce6a67 100644 --- a/Framework/API/src/AlgorithmFactory.cpp +++ b/Framework/API/src/AlgorithmFactory.cpp @@ -426,5 +426,12 @@ AlgorithmFactoryImpl::createAlgorithm(const std::string &name, return Kernel::DynamicFactory<Algorithm>::create(createName(name, version)); } + } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::AlgorithmFactoryImpl>; +} +} diff --git a/Framework/API/src/AnalysisDataService.cpp b/Framework/API/src/AnalysisDataService.cpp index 44f38d031141b40c09c94f73a31b9a4bee0e5309..d7a7d7d0083a04f6ff36d64aaf3ae600c5ac1f3a 100644 --- a/Framework/API/src/AnalysisDataService.cpp +++ b/Framework/API/src/AnalysisDataService.cpp @@ -325,3 +325,9 @@ void AnalysisDataServiceImpl::verifyName(const std::string &name) { } // Namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::AnalysisDataServiceImpl>; +} +} diff --git a/Framework/API/src/ArchiveSearchFactory.cpp b/Framework/API/src/ArchiveSearchFactory.cpp index c05b3aa0aefac4cc9f5ef871f07ac352800c198c..36d22ab9fefa1e24bd2d86375cc4df83220828ba 100644 --- a/Framework/API/src/ArchiveSearchFactory.cpp +++ b/Framework/API/src/ArchiveSearchFactory.cpp @@ -8,6 +8,11 @@ namespace API { /// Default constructor ArchiveSearchFactoryImpl::ArchiveSearchFactoryImpl() {} - } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::ArchiveSearchFactoryImpl>; +} +} diff --git a/Framework/API/src/CatalogFactory.cpp b/Framework/API/src/CatalogFactory.cpp new file mode 100644 index 0000000000000000000000000000000000000000..59d6455239002da5a50b8cd4ea0476e1a2a1660a --- /dev/null +++ b/Framework/API/src/CatalogFactory.cpp @@ -0,0 +1,7 @@ +#include "MantidAPI/CatalogFactory.h" + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::CatalogFactoryImpl>; +} +} diff --git a/Framework/API/src/CatalogManager.cpp b/Framework/API/src/CatalogManager.cpp index ec7babcff5f436e3e907c9bb2d56044471cc9f82..47816044bdeff715d86b885204931bc6afd48342 100644 --- a/Framework/API/src/CatalogManager.cpp +++ b/Framework/API/src/CatalogManager.cpp @@ -108,5 +108,12 @@ std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() { size_t CatalogManagerImpl::numberActiveSessions() const { return m_activeCatalogs.size(); } + +} +} + +namespace Mantid { +namespace Kernel { + template class Kernel::SingletonHolder<Mantid::API::CatalogManagerImpl>; } } diff --git a/Framework/API/src/ColumnFactory.cpp b/Framework/API/src/ColumnFactory.cpp index 64b4617d82cf54ea002fbe919f4c42d7493dd2f5..964aef33fd64ffa2707e8afcdc1f16f8d372fe42 100644 --- a/Framework/API/src/ColumnFactory.cpp +++ b/Framework/API/src/ColumnFactory.cpp @@ -14,3 +14,9 @@ ColumnFactoryImpl::create(const std::string &type) const { } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::ColumnFactoryImpl>; +} +} diff --git a/Framework/API/src/ConstraintFactory.cpp b/Framework/API/src/ConstraintFactory.cpp index cf46f18d2fba7e83ec2bf27dddd7f6d72006cf50..fbda1f32c5e41e6a42156fdc07c94149016481ab 100644 --- a/Framework/API/src/ConstraintFactory.cpp +++ b/Framework/API/src/ConstraintFactory.cpp @@ -53,3 +53,9 @@ IConstraint *ConstraintFactoryImpl::createInitialized(IFunction *fun, } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::ConstraintFactoryImpl>; +} +} diff --git a/Framework/API/src/CostFunctionFactory.cpp b/Framework/API/src/CostFunctionFactory.cpp index ea0e131e3a024925ddd078ceea612d507ba7759f..bb454a716a340bbb9f842ae6b7f4ba145519ead6 100644 --- a/Framework/API/src/CostFunctionFactory.cpp +++ b/Framework/API/src/CostFunctionFactory.cpp @@ -15,3 +15,9 @@ CostFunctionFactoryImpl::CostFunctionFactoryImpl() } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::CostFunctionFactoryImpl>; +} +} diff --git a/Framework/API/src/DomainCreatorFactory.cpp b/Framework/API/src/DomainCreatorFactory.cpp index d9f492610cd5fc11065d1cd5c5dbacc15898098d..b0f6f8acca0303cea82929447fa74980cf6f18cd 100644 --- a/Framework/API/src/DomainCreatorFactory.cpp +++ b/Framework/API/src/DomainCreatorFactory.cpp @@ -26,3 +26,9 @@ IDomainCreator *DomainCreatorFactoryImpl::createDomainCreator( } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::DomainCreatorFactoryImpl>; +} +} diff --git a/Framework/API/src/FileFinder.cpp b/Framework/API/src/FileFinder.cpp index f271ee799f55d9f665c92670e360f38cd1beb4a4..7aeb6e0d621698980702634fab41ddbe1bac6f08 100644 --- a/Framework/API/src/FileFinder.cpp +++ b/Framework/API/src/FileFinder.cpp @@ -785,3 +785,9 @@ std::string FileFinderImpl::toUpper(const std::string &src) const { } // API } // Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::FileFinderImpl>; +} +} diff --git a/Framework/API/src/FileLoaderRegistry.cpp b/Framework/API/src/FileLoaderRegistry.cpp index 5f8befb87fbd54222babce9799010ad627f00b47..0315f9946166dec83ec7368c04724aa398901697 100644 --- a/Framework/API/src/FileLoaderRegistry.cpp +++ b/Framework/API/src/FileLoaderRegistry.cpp @@ -201,3 +201,9 @@ void FileLoaderRegistryImpl::removeAlgorithm( } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { +template class Mantid::Kernel::SingletonHolder<Mantid::API::FileLoaderRegistryImpl>; +} +} diff --git a/Framework/API/src/FrameworkManager.cpp b/Framework/API/src/FrameworkManager.cpp index 1e40186395538499302f9a4c9602d216dc7314ea..a65c41f0aa10f0b0efce0583b13c3c187bdba74f 100644 --- a/Framework/API/src/FrameworkManager.cpp +++ b/Framework/API/src/FrameworkManager.cpp @@ -434,3 +434,9 @@ void FrameworkManagerImpl::setupUsageReporting() { } // namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::FrameworkManagerImpl>; +} +} diff --git a/Framework/API/src/FuncMinimizerFactory.cpp b/Framework/API/src/FuncMinimizerFactory.cpp index 0ce1a3379385a7517bf3302ed3a36ad832cb9725..1ca211a39164b5386d79eb09a78e4c765e9326a9 100644 --- a/Framework/API/src/FuncMinimizerFactory.cpp +++ b/Framework/API/src/FuncMinimizerFactory.cpp @@ -60,3 +60,9 @@ FuncMinimizerFactoryImpl::createMinimizer(const std::string &str) const { } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::FuncMinimizerFactoryImpl>; +} +} diff --git a/Framework/API/src/FunctionFactory.cpp b/Framework/API/src/FunctionFactory.cpp index ecaf3a3177cdd1ae98233665c34d8e37a6bd007c..9595e2eaeb4c82d58d4a73e9c918dfa4b9cc7e42 100644 --- a/Framework/API/src/FunctionFactory.cpp +++ b/Framework/API/src/FunctionFactory.cpp @@ -317,3 +317,9 @@ void FunctionFactoryImpl::unsubscribe(const std::string &className) { } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::FunctionFactoryImpl>; +} +} diff --git a/Framework/API/src/ImplicitFunctionFactory.cpp b/Framework/API/src/ImplicitFunctionFactory.cpp index 7d4c0360f0927c8613fe093313c0d5ce66b1e8c9..8853faa93e65e20989077df9e51af2ee3af09e4f 100644 --- a/Framework/API/src/ImplicitFunctionFactory.cpp +++ b/Framework/API/src/ImplicitFunctionFactory.cpp @@ -49,5 +49,12 @@ ImplicitFunctionFactoryImpl::createUnwrapped( funcParser->createFunctionBuilder(pInstructionsXML)); return functionBuilder->create(); } + +} +} + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionFactoryImpl>; } } diff --git a/Framework/API/src/ImplicitFunctionParameterParserFactory.cpp b/Framework/API/src/ImplicitFunctionParameterParserFactory.cpp index 90261e36d85b66c051654a51a810a0e38979b79b..7a33f7394709e4212ebbd90b27725aa41dd4ece9 100644 --- a/Framework/API/src/ImplicitFunctionParameterParserFactory.cpp +++ b/Framework/API/src/ImplicitFunctionParameterParserFactory.cpp @@ -41,5 +41,12 @@ ImplicitFunctionParameterParser *ImplicitFunctionParameterParserFactoryImpl:: } return paramParser; } + +} +} + +namespace Mantid{ +namespace Kernel{ +template class Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParameterParserFactoryImpl>; } } diff --git a/Framework/API/src/ImplicitFunctionParserFactory.cpp b/Framework/API/src/ImplicitFunctionParserFactory.cpp index 9a13f894941560ad6e748903857b93a2fa91e4ef..c91d812d9d142e31096cfe21b3a0ae33c60072da 100644 --- a/Framework/API/src/ImplicitFunctionParserFactory.cpp +++ b/Framework/API/src/ImplicitFunctionParserFactory.cpp @@ -71,5 +71,12 @@ ImplicitFunctionParserFactoryImpl::createImplicitFunctionParserFromXML( return createImplicitFunctionParserFromXML(pRootElem); } + +} +} + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParserFactoryImpl>; } } diff --git a/Framework/API/src/InstrumentDataService.cpp b/Framework/API/src/InstrumentDataService.cpp index 0c785af2aaef4ca36a57d1986098703e75f2cf61..0d6910e65d806286a12c571eff4553e02cb3ca3b 100644 --- a/Framework/API/src/InstrumentDataService.cpp +++ b/Framework/API/src/InstrumentDataService.cpp @@ -11,3 +11,10 @@ InstrumentDataServiceImpl::InstrumentDataServiceImpl() } // Namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::InstrumentDataServiceImpl>; +} +} + diff --git a/Framework/API/src/RemoteJobManagerFactory.cpp b/Framework/API/src/RemoteJobManagerFactory.cpp index adb8fa032ee71d170ff484260d2e9e88ee9a76a7..8032e26f4ea0ddc414d468f42743a8b9a0b10145 100644 --- a/Framework/API/src/RemoteJobManagerFactory.cpp +++ b/Framework/API/src/RemoteJobManagerFactory.cpp @@ -82,3 +82,9 @@ RemoteJobManagerFactoryImpl::create(const std::string baseURL, } // namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::RemoteJobManagerFactoryImpl>; +} +} diff --git a/Framework/API/src/ScriptRepositoryFactory.cpp b/Framework/API/src/ScriptRepositoryFactory.cpp index 7457917e337cdf2152a7f957278badcb6df21d64..9cc4fcf2d7e58eed0584e54004bf74460bf457be 100644 --- a/Framework/API/src/ScriptRepositoryFactory.cpp +++ b/Framework/API/src/ScriptRepositoryFactory.cpp @@ -17,3 +17,9 @@ ScriptRepositoryFactoryImpl::ScriptRepositoryFactoryImpl() } // namespace API } // namespace Mantid + +namespace Mantid { +namespace Kernel { +template class Mantid::Kernel::SingletonHolder<Mantid::API::ScriptRepositoryFactoryImpl>; +} +} diff --git a/Framework/API/src/TransformScaleFactory.cpp b/Framework/API/src/TransformScaleFactory.cpp index 6de6bb9fe86e075bcd30a0019616e7255ca19618..ebf72d081b40fbe906716c4d7b11f34f63d1fc41 100644 --- a/Framework/API/src/TransformScaleFactory.cpp +++ b/Framework/API/src/TransformScaleFactory.cpp @@ -43,5 +43,12 @@ TransformScaleFactoryImpl::createUnwrapped(const std::string &className) const { throw Kernel::Exception::NotImplementedError( "Don't use this method - use the safe one!!!"); } + } // namespace Mantid } // namespace API + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::TransformScaleFactoryImpl>; +} +} diff --git a/Framework/API/src/WorkspaceFactory.cpp b/Framework/API/src/WorkspaceFactory.cpp index c8cf2e6bbb87aad0051a257a4eec63ebc98b2593..bb40859b1c9d5aa1e1044a1403369e3b2c2f18f7 100644 --- a/Framework/API/src/WorkspaceFactory.cpp +++ b/Framework/API/src/WorkspaceFactory.cpp @@ -204,3 +204,9 @@ WorkspaceFactoryImpl::createPeaks(const std::string &className) const { } // namespace API } // Namespace Mantid + +namespace Mantid { +namespace Kernel { + template class Mantid::Kernel::SingletonHolder<Mantid::API::WorkspaceFactoryImpl>; +} +} diff --git a/Framework/Kernel/inc/MantidKernel/ConfigService.h b/Framework/Kernel/inc/MantidKernel/ConfigService.h index 616f5cb3936dde7cc1edafa47189232820fa9631..7b1c490edc8e239d79f6d67a61ba4adcadcc0576 100644 --- a/Framework/Kernel/inc/MantidKernel/ConfigService.h +++ b/Framework/Kernel/inc/MantidKernel/ConfigService.h @@ -352,13 +352,7 @@ private: std::vector<std::string> m_filterChannels; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#if defined(__APPLE__) && defined(__INTEL_COMPILER) -inline -#endif - template class MANTID_KERNEL_DLL - Mantid::Kernel::SingletonHolder<ConfigServiceImpl>; +EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<ConfigServiceImpl>; typedef Mantid::Kernel::SingletonHolder<ConfigServiceImpl> ConfigService; diff --git a/Framework/Kernel/inc/MantidKernel/DllConfig.h b/Framework/Kernel/inc/MantidKernel/DllConfig.h index f7a6020c17f1a55441c6777b773c05d894e72c55..835e693444d77950c95191857ef5f67f75d239bd 100644 --- a/Framework/Kernel/inc/MantidKernel/DllConfig.h +++ b/Framework/Kernel/inc/MantidKernel/DllConfig.h @@ -32,8 +32,10 @@ #ifdef IN_MANTID_KERNEL #define MANTID_KERNEL_DLL DLLExport +#define EXTERN_MANTID_KERNEL extern #else #define MANTID_KERNEL_DLL DLLImport +#define EXTERN_MANTID_KERNEL extern #endif /* IN_MANTID_KERNEL*/ #endif // MANTID_KERNEL_DLLCONFIG_H_ diff --git a/Framework/Kernel/inc/MantidKernel/LibraryManager.h b/Framework/Kernel/inc/MantidKernel/LibraryManager.h index 089038d0c08851f904935459100d3803d28f2111..aa40347f6ddfb9b8f90b405a2a21ee32cbd49be1 100644 --- a/Framework/Kernel/inc/MantidKernel/LibraryManager.h +++ b/Framework/Kernel/inc/MantidKernel/LibraryManager.h @@ -69,13 +69,8 @@ private: OpenLibs; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// LibraryManagerImpl (needed for dllexport/dllimport) and a typedef for it. -#if defined(__APPLE__) && defined(__INTEL_COMPILER) -inline -#endif - template class MANTID_KERNEL_DLL - Mantid::Kernel::SingletonHolder<LibraryManagerImpl>; + +EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<LibraryManagerImpl>; typedef Mantid::Kernel::SingletonHolder<LibraryManagerImpl> LibraryManager; diff --git a/Framework/Kernel/inc/MantidKernel/PropertyManagerDataService.h b/Framework/Kernel/inc/MantidKernel/PropertyManagerDataService.h index 46d3d0b9513c6c37b32218248ba4b7c1b089cdfe..9168f8c91ba35b9cafaf6bf7482ebb33932217b7 100644 --- a/Framework/Kernel/inc/MantidKernel/PropertyManagerDataService.h +++ b/Framework/Kernel/inc/MantidKernel/PropertyManagerDataService.h @@ -46,14 +46,8 @@ private: ~PropertyManagerDataServiceImpl() override = default; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// PropertyManagerDataServiceImpl (needed for dllexport/dllimport) and a -/// typedef for it. -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_KERNEL_DLL - Mantid::Kernel::SingletonHolder<PropertyManagerDataServiceImpl>; -#endif /* _WIN32 */ + +EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<PropertyManagerDataServiceImpl>; typedef Mantid::Kernel::SingletonHolder< PropertyManagerDataServiceImpl> PropertyManagerDataService; diff --git a/Framework/Kernel/inc/MantidKernel/UsageService.h b/Framework/Kernel/inc/MantidKernel/UsageService.h index b3b461118e24e51613f2441d9d4d8a6a493e7962..1ae9ad684a226895e0bca1b4f5579e8c07a0b785 100644 --- a/Framework/Kernel/inc/MantidKernel/UsageService.h +++ b/Framework/Kernel/inc/MantidKernel/UsageService.h @@ -137,12 +137,8 @@ private: Poco::ActiveMethod<int, std::string, UsageServiceImpl> m_featureActiveMethod; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// AlgorithmFactoryImpl (needed for dllexport/dllimport) and a typedef for it. -#if defined(__APPLE__) && defined(__INTEL_COMPILER) -inline -#endif - template class MANTID_KERNEL_DLL + +EXTERN_MANTID_KERNEL template class MANTID_KERNEL_DLL Mantid::Kernel::SingletonHolder<UsageServiceImpl>; typedef Mantid::Kernel::SingletonHolder<UsageServiceImpl> UsageService; diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index c9ef7f008cbb2e672d898608d444418b853d67db..777c814b367a766cad744eefc13f583cbda590e4 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -2040,6 +2040,10 @@ int ConfigServiceImpl::FindLowestFilterLevel() const { return lowestPriority; } + + +template class Mantid::Kernel::SingletonHolder<ConfigServiceImpl>; + /// \cond TEMPLATE template DLLExport int ConfigServiceImpl::getValue(const std::string &, double &); diff --git a/Framework/Kernel/src/LibraryManager.cpp b/Framework/Kernel/src/LibraryManager.cpp index 6a22cad19e2ea1f21e70932f61782eb82ae70f07..3aa4e86101a893163aafe461cb977dc7b0a4d1a7 100644 --- a/Framework/Kernel/src/LibraryManager.cpp +++ b/Framework/Kernel/src/LibraryManager.cpp @@ -134,5 +134,7 @@ bool LibraryManagerImpl::loadLibrary(const std::string &filepath) { return false; } +template class Mantid::Kernel::SingletonHolder<LibraryManagerImpl>; + } // namespace Kernel } // namespace Mantid diff --git a/Framework/Kernel/src/PropertyManagerDataService.cpp b/Framework/Kernel/src/PropertyManagerDataService.cpp index bd4587f31bfc5ed75869a83b59c391d17c276858..ce7ea9564ddc2c45d0f6725333d0a672416ca1c4 100644 --- a/Framework/Kernel/src/PropertyManagerDataService.cpp +++ b/Framework/Kernel/src/PropertyManagerDataService.cpp @@ -9,5 +9,7 @@ namespace Kernel { PropertyManagerDataServiceImpl::PropertyManagerDataServiceImpl() : DataService<PropertyManager>("PropertyManagerDataService") {} +template class Mantid::Kernel::SingletonHolder<PropertyManagerDataServiceImpl>; + } // Namespace Kernel } // Namespace Mantid diff --git a/Framework/Kernel/src/UsageService.cpp b/Framework/Kernel/src/UsageService.cpp index 8130e67bf06da3c4390b1a5bdab0f444abb3935d..8836ff23832b8f6888676ce2901c94ce6718afec 100644 --- a/Framework/Kernel/src/UsageService.cpp +++ b/Framework/Kernel/src/UsageService.cpp @@ -302,5 +302,6 @@ int UsageServiceImpl::sendReport(const std::string &message, return status; } +template class Mantid::Kernel::SingletonHolder<UsageServiceImpl>; } // namespace API } // namespace Mantid diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DllConfig.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DllConfig.h index db73b6e65b00a1ebb4da0f9f2318d1d56545e357..dc77e2d0b544bb50f2142120e2fbc819d1590cf2 100644 --- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DllConfig.h +++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/DllConfig.h @@ -32,8 +32,10 @@ #ifdef IN_MANTID_MDALGORITHMS #define MANTID_MDALGORITHMS_DLL DLLExport +#define EXTERN_MANTID_MDALGORITHMS extern #else #define MANTID_MDALGORITHMS_DLL DLLImport +#define EXTERN_MANTID_MDALGORITHMS extern #endif /* IN_MANTID_MDALGORITHMS*/ #endif // MANTID_MDALGORITHMS_DLLCONFIG_H_ diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h index 04380c802fd8be1840162d37a372e6eda826c646..e9a6146cd90a1b944c5a4fe92132f887381af07b 100644 --- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h +++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/ForegroundModelFactory.h @@ -64,16 +64,16 @@ private: using BaseClass::createUnwrapped; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// ForegroundModelFactoryImpl (needed for dllexport/dllimport). -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_MDALGORITHMS_DLL - Kernel::SingletonHolder<ForegroundModelFactoryImpl>; -#endif /* _WIN32 */ /// Typedef singleton instance to ForegroundFactory typedef Kernel::SingletonHolder<ForegroundModelFactoryImpl> ForegroundModelFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_MDALGORITHMS template class MANTID_MDALGORITHMS_DLL + Kernel::SingletonHolder<Mantid::MDAlgorithms::ForegroundModelFactoryImpl>; +} +} + #endif /* MANTID_MDALGORITHMS_FOREGROUNDMODELFACTORY_H_ */ diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h index 2d1b8750ea4b93d0cbd6edf58749a0367b51eab8..0576d374928e7ab2b91d04fcc43978a2037123d8 100644 --- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h +++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/MDResolutionConvolutionFactory.h @@ -63,17 +63,17 @@ private: using BaseClass::createUnwrapped; }; -/// Forward declaration of a specialisation of SingletonHolder for -/// MDResolutionConvolutionFactoryImpl (needed for dllexport/dllimport). -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class MANTID_MDALGORITHMS_DLL - Kernel::SingletonHolder<MDResolutionConvolutionFactoryImpl>; -#endif /* _WIN32 */ /// Typedef singleton instance to MDResolutionConvolutionFactory typedef Kernel::SingletonHolder< MDResolutionConvolutionFactoryImpl> MDResolutionConvolutionFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTID_MDALGORITHMS template class MANTID_MDALGORITHMS_DLL + Kernel::SingletonHolder<Mantid::MDAlgorithms::MDResolutionConvolutionFactoryImpl>; +} +} + #endif /* MANTID_MDALGORITHMS_MDRESOLUTIONCONVOLUTIONFACTORY_H_ */ diff --git a/Framework/MDAlgorithms/src/Quantification/ForegroundModelFactory.cpp b/Framework/MDAlgorithms/src/Quantification/ForegroundModelFactory.cpp index 5320932439df9c9dbb1b36ee205c629adb6f1b39..1e2186874218b6313e11b3ff6d9d58248b70d66a 100644 --- a/Framework/MDAlgorithms/src/Quantification/ForegroundModelFactory.cpp +++ b/Framework/MDAlgorithms/src/Quantification/ForegroundModelFactory.cpp @@ -25,5 +25,12 @@ ForegroundModelFactoryImpl::createModel(const std::string &name, fgModel->setFunctionUnderMinimization(fitFunction); return fgModel; } + +} +} + +namespace Mantid { +namespace Kernel { + template class Kernel::SingletonHolder<Mantid::MDAlgorithms::ForegroundModelFactoryImpl>; } } diff --git a/Framework/MDAlgorithms/src/Quantification/MDResolutionConvolutionFactory.cpp b/Framework/MDAlgorithms/src/Quantification/MDResolutionConvolutionFactory.cpp index b01bbad62b5b8a6d4a722498abd1932d9daa2691..3f2bc671c1489f611553168f45f43e8b23f43568 100644 --- a/Framework/MDAlgorithms/src/Quantification/MDResolutionConvolutionFactory.cpp +++ b/Framework/MDAlgorithms/src/Quantification/MDResolutionConvolutionFactory.cpp @@ -26,5 +26,12 @@ MDResolutionConvolution *MDResolutionConvolutionFactoryImpl::createConvolution( convolution->initialize(); return convolution; } + +} +} + +namespace Mantid { +namespace Kernel { + template class Kernel::SingletonHolder<Mantid::MDAlgorithms::MDResolutionConvolutionFactoryImpl>; } } diff --git a/MantidQt/API/inc/MantidQtAPI/AlgorithmInputHistory.h b/MantidQt/API/inc/MantidQtAPI/AlgorithmInputHistory.h index 794db1cc8cc5022f303c6820b14252c3727cef78..aefb628ce327f791d03390a9db66429702c7be18 100644 --- a/MantidQt/API/inc/MantidQtAPI/AlgorithmInputHistory.h +++ b/MantidQt/API/inc/MantidQtAPI/AlgorithmInputHistory.h @@ -93,13 +93,13 @@ private: friend struct Mantid::Kernel::CreateUsingNew<AlgorithmInputHistoryImpl>; }; -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix - template class EXPORT_OPT_MANTIDQT_API Mantid::Kernel::SingletonHolder<AlgorithmInputHistoryImpl>; -#endif /* _WIN32 */ - /// The specific instantiation of the templated type - typedef Mantid::Kernel::SingletonHolder<AlgorithmInputHistoryImpl> AlgorithmInputHistory; +typedef Mantid::Kernel::SingletonHolder<AlgorithmInputHistoryImpl> AlgorithmInputHistory; +} +} +namespace Mantid { +namespace Kernel { + EXTERN_MANTIDQT_API template class EXPORT_OPT_MANTIDQT_API Mantid::Kernel::SingletonHolder<MantidQt::API::AlgorithmInputHistoryImpl>; } } diff --git a/MantidQt/API/inc/MantidQtAPI/DllOption.h b/MantidQt/API/inc/MantidQtAPI/DllOption.h index c6ffb39d8b688d95b1129c13e43d5e4ef4340052..d20c46208d48b04082ca7859ae2a291c3e02671a 100644 --- a/MantidQt/API/inc/MantidQtAPI/DllOption.h +++ b/MantidQt/API/inc/MantidQtAPI/DllOption.h @@ -5,8 +5,10 @@ #ifdef IN_MANTIDQT_API #define EXPORT_OPT_MANTIDQT_API DLLExport +#define EXTERN_MANTIDQT_API extern #else #define EXPORT_OPT_MANTIDQT_API DLLImport +#define EXTERN_MANTIDQT_API extern #endif /* IN_MANTIDQT_API */ #endif //MANTIDQT_API_DLLOPTION_H_ diff --git a/MantidQt/API/inc/MantidQtAPI/InterfaceFactory.h b/MantidQt/API/inc/MantidQtAPI/InterfaceFactory.h index 694792b5f4561aa987a29145ef362062bbcdb996..a43040369e51c3706317810f71513f2462a684d2 100644 --- a/MantidQt/API/inc/MantidQtAPI/InterfaceFactory.h +++ b/MantidQt/API/inc/MantidQtAPI/InterfaceFactory.h @@ -69,11 +69,7 @@ private: ~AlgorithmDialogFactoryImpl() override = default; }; -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class EXPORT_OPT_MANTIDQT_API - Mantid::Kernel::SingletonHolder<AlgorithmDialogFactoryImpl>; -#endif /* _WIN32 */ + /// The specific instantiation of the templated type typedef Mantid::Kernel::SingletonHolder< AlgorithmDialogFactoryImpl> AlgorithmDialogFactory; @@ -184,15 +180,19 @@ void UserSubWindowFactoryImpl::saveAliasNames(const std::string &realName) { } } -#ifdef _WIN32 -// this breaks new namespace declaraion rules; need to find a better fix -template class EXPORT_OPT_MANTIDQT_API - Mantid::Kernel::SingletonHolder<UserSubWindowFactoryImpl>; -#endif /* _WIN32 */ /// The specific instantiation of the templated type typedef Mantid::Kernel::SingletonHolder< UserSubWindowFactoryImpl> UserSubWindowFactory; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTIDQT_API template class EXPORT_OPT_MANTIDQT_API + Mantid::Kernel::SingletonHolder<MantidQt::API::AlgorithmDialogFactoryImpl>; + EXTERN_MANTIDQT_API template class EXPORT_OPT_MANTIDQT_API + Mantid::Kernel::SingletonHolder<MantidQt::API::UserSubWindowFactoryImpl>; +} +} + #endif // MANTIDQT_API_INTERFACEFACTORY_H_ diff --git a/MantidQt/API/inc/MantidQtAPI/SelectionNotificationService.h b/MantidQt/API/inc/MantidQtAPI/SelectionNotificationService.h index 3566bf08d264004fbafd173740ceaa57b823dfa2..6a472246c49e54465b91e7151ce38aabd92ce9e7 100644 --- a/MantidQt/API/inc/MantidQtAPI/SelectionNotificationService.h +++ b/MantidQt/API/inc/MantidQtAPI/SelectionNotificationService.h @@ -64,15 +64,15 @@ namespace MantidQt friend struct Mantid::Kernel::CreateUsingNew<SelectionNotificationServiceImpl>; }; - /// Forward declaration of a specialisation of SingletonHolder for SelectionNotificationServiceImpl - /// (needed for dllexport/dllimport) and a typedef for it. -#ifdef _WIN32 - template class EXPORT_OPT_MANTIDQT_API Mantid::Kernel::SingletonHolder<SelectionNotificationServiceImpl>; -#endif /* _WIN32 */ - typedef Mantid::Kernel::SingletonHolder<SelectionNotificationServiceImpl> SelectionNotificationService; } } +namespace Mantid { +namespace Kernel { + EXTERN_MANTIDQT_API template class EXPORT_OPT_MANTIDQT_API Mantid::Kernel::SingletonHolder<MantidQt::API::SelectionNotificationServiceImpl>; +} +} + #endif // MANTIDQTAPI_SELECTION_NOTIFICATION_SERVICE_H_ diff --git a/MantidQt/API/src/AlgorithmInputHistory.cpp b/MantidQt/API/src/AlgorithmInputHistory.cpp index ae0cc53a0c1fcea39964dcc2cd16b962f261f7f9..0a8307c6fe134b6d926001315af3bd548b7a8ab7 100644 --- a/MantidQt/API/src/AlgorithmInputHistory.cpp +++ b/MantidQt/API/src/AlgorithmInputHistory.cpp @@ -149,3 +149,5 @@ void AbstractAlgorithmInputHistory::load() settings.endGroup(); } + +template class Mantid::Kernel::SingletonHolder<AlgorithmInputHistoryImpl>; diff --git a/MantidQt/API/src/InterfaceFactory.cpp b/MantidQt/API/src/InterfaceFactory.cpp index d1f5a8d434337a4fe9cca63586ef73867cec609a..d444a240d9ed9d93ba92f26e9e1f99147b94827d 100644 --- a/MantidQt/API/src/InterfaceFactory.cpp +++ b/MantidQt/API/src/InterfaceFactory.cpp @@ -109,4 +109,5 @@ UserSubWindow * UserSubWindowFactoryImpl::createFromAlias(const std::string & na } } - +template class Mantid::Kernel::SingletonHolder<AlgorithmDialogFactoryImpl>; +template class Mantid::Kernel::SingletonHolder<UserSubWindowFactoryImpl>; diff --git a/MantidQt/API/src/SelectionNotificationService.cpp b/MantidQt/API/src/SelectionNotificationService.cpp index 428f83720a2395c3609d55d68e1f2c8981562b45..8bcac0630494489bff5a43ed65931d850fb1acd9 100644 --- a/MantidQt/API/src/SelectionNotificationService.cpp +++ b/MantidQt/API/src/SelectionNotificationService.cpp @@ -38,4 +38,4 @@ void SelectionNotificationServiceImpl::sendQPointSelection( bool lab_coords, dou // std::cout << "QPointSelection_signal emitted" << std::endl; } - +template class Mantid::Kernel::SingletonHolder<SelectionNotificationServiceImpl>;