Skip to content
Snippets Groups Projects
Commit 56c04fce authored by Anton Piccardo-Selg's avatar Anton Piccardo-Selg
Browse files

Refs #15283 Create template declaraions for Singletons

parent 45f3b2dc
No related merge requests found
Showing
with 118 additions and 133 deletions
...@@ -12,6 +12,7 @@ set ( SRC_FILES ...@@ -12,6 +12,7 @@ set ( SRC_FILES
src/Axis.cpp src/Axis.cpp
src/BinEdgeAxis.cpp src/BinEdgeAxis.cpp
src/BoxController.cpp src/BoxController.cpp
src/CatalogFactory.cpp
src/CatalogManager.cpp src/CatalogManager.cpp
src/CatalogSession.cpp src/CatalogSession.cpp
src/ChopperModel.cpp src/ChopperModel.cpp
......
...@@ -168,14 +168,6 @@ private: ...@@ -168,14 +168,6 @@ private:
VersionMap m_vmap; 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> typedef Mantid::Kernel::SingletonHolder<AlgorithmFactoryImpl>
AlgorithmFactory; AlgorithmFactory;
...@@ -188,4 +180,10 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DynamicFactory< ...@@ -188,4 +180,10 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DynamicFactory<
} // namespace API } // namespace API
} // namespace Mantid } // 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_*/ #endif /*MANTID_API_ALGORITHMFACTORY_H_*/
...@@ -178,14 +178,7 @@ private: ...@@ -178,14 +178,7 @@ private:
std::string m_illegalChars; 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> typedef Mantid::Kernel::SingletonHolder<AnalysisDataServiceImpl>
AnalysisDataService; AnalysisDataService;
...@@ -249,4 +242,10 @@ typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> & ...@@ -249,4 +242,10 @@ typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> &
} // Namespace API } // Namespace API
} // Namespace Mantid } // 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_*/ #endif /*MANTID_KERNEL_ANALYSISDATASERVICE_H_*/
...@@ -56,17 +56,15 @@ private: ...@@ -56,17 +56,15 @@ private:
~ArchiveSearchFactoryImpl() override = default; ~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> typedef Mantid::Kernel::SingletonHolder<ArchiveSearchFactoryImpl>
ArchiveSearchFactory; ArchiveSearchFactory;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ArchiveSearchFactoryImpl>;
}
}
#endif // MANTID_API_ARCHIVESEARCHFACTORY_H_ #endif // MANTID_API_ARCHIVESEARCHFACTORY_H_
...@@ -76,13 +76,6 @@ private: ...@@ -76,13 +76,6 @@ private:
mutable std::map<std::string, boost::shared_ptr<ICatalog>> m_createdCatalogs; 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 /// The specialisation of the SingletonHolder class that holds the
/// CatalogFactory /// CatalogFactory
typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl>
...@@ -91,4 +84,10 @@ typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> ...@@ -91,4 +84,10 @@ typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl>
} // namespace API } // namespace API
} // namespace Mantid } // 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_*/ #endif /*MANTID_API_CATALOGFACTORYIMPL_H_*/
...@@ -67,11 +67,14 @@ private: ...@@ -67,11 +67,14 @@ private:
std::map<CatalogSession_sptr, ICatalog_sptr> m_activeCatalogs; std::map<CatalogSession_sptr, ICatalog_sptr> m_activeCatalogs;
}; };
#ifdef _WIN32
template class MANTID_API_DLL Kernel::SingletonHolder<CatalogManagerImpl>;
#endif
typedef Kernel::SingletonHolder<CatalogManagerImpl> typedef Kernel::SingletonHolder<CatalogManagerImpl>
CatalogManager; CatalogManager;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL Kernel::SingletonHolder<Mantid::API::CatalogManagerImpl>;
}
}
#endif /* MANTID_ICAT_CATALOGMANAGERIMPL_H_ */ #endif /* MANTID_ICAT_CATALOGMANAGERIMPL_H_ */
...@@ -63,17 +63,16 @@ private: ...@@ -63,17 +63,16 @@ private:
~ColumnFactoryImpl() override = default; ~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> typedef Mantid::Kernel::SingletonHolder<ColumnFactoryImpl>
ColumnFactory; ColumnFactory;
} // namespace API } // namespace API
} // namespace Mantid } // 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_*/ #endif /*MANTID_API_COLUMNFACTORY_H_*/
...@@ -72,19 +72,18 @@ private: ...@@ -72,19 +72,18 @@ private:
~ConstraintFactoryImpl() override = default; ~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> typedef Mantid::Kernel::SingletonHolder<ConstraintFactoryImpl>
ConstraintFactory; ConstraintFactory;
} // namespace API } // namespace API
} // namespace Mantid } // 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 * Macro for declaring a new type of function to be used with the
* FunctionFactory * FunctionFactory
......
...@@ -63,17 +63,17 @@ private: ...@@ -63,17 +63,17 @@ private:
CostFunctionFactoryImpl(); 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> typedef Mantid::Kernel::SingletonHolder<CostFunctionFactoryImpl>
CostFunctionFactory; CostFunctionFactory;
} // namespace API } // namespace API
} // namespace Mantid } // 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_*/ #endif /*MANTID_API_COSTFUNCTIONFACTORY_H_*/
...@@ -32,8 +32,10 @@ ...@@ -32,8 +32,10 @@
#ifdef IN_MANTID_API #ifdef IN_MANTID_API
#define MANTID_API_DLL DLLExport #define MANTID_API_DLL DLLExport
#define EXTERN_MANTID_API extern
#else #else
#define MANTID_API_DLL DLLImport #define MANTID_API_DLL DLLImport
#define EXTERN_MANTID_API extern
#endif /* IN_MANTID_API*/ #endif /* IN_MANTID_API*/
#endif // MANTID_API_DLLCONFIG_H_ #endif // MANTID_API_DLLCONFIG_H_
...@@ -68,18 +68,16 @@ private: ...@@ -68,18 +68,16 @@ private:
using Kernel::DynamicFactory<IDomainCreator>::createUnwrapped; 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> typedef Mantid::Kernel::SingletonHolder<DomainCreatorFactoryImpl>
DomainCreatorFactory; DomainCreatorFactory;
} // namespace API } // namespace API
} // namespace Mantid } // 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_ */ #endif /* MANTID_API_DOMAINCREATORFACTORY_H_ */
...@@ -94,16 +94,15 @@ private: ...@@ -94,16 +94,15 @@ private:
int m_globOption; 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> typedef Mantid::Kernel::SingletonHolder<FileFinderImpl>
FileFinder; FileFinder;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::FileFinderImpl>;
}
}
#endif // MANTID_API_FILEFINDER_H_ #endif // MANTID_API_FILEFINDER_H_
...@@ -144,15 +144,6 @@ private: ...@@ -144,15 +144,6 @@ private:
mutable Kernel::Logger m_log; 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 /// Type for the actual singleton instance
typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl> typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl>
FileLoaderRegistry; FileLoaderRegistry;
...@@ -160,4 +151,10 @@ typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl> ...@@ -160,4 +151,10 @@ typedef Mantid::Kernel::SingletonHolder<FileLoaderRegistryImpl>
} // namespace API } // namespace API
} // namespace Mantid } // 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_ */ #endif /* MANTID_API_FILELOADERREGISTRY_H_ */
...@@ -135,17 +135,16 @@ private: ...@@ -135,17 +135,16 @@ private:
#endif #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> typedef Mantid::Kernel::SingletonHolder<FrameworkManagerImpl>
FrameworkManager; FrameworkManager;
} // namespace Kernel } // namespace Kernel
} // namespace Mantid } // 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_*/ #endif /*MANTID_API_FRAMEWORKMANAGER_H_*/
...@@ -61,19 +61,18 @@ private: ...@@ -61,19 +61,18 @@ private:
FuncMinimizerFactoryImpl(); 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> typedef Mantid::Kernel::SingletonHolder<FuncMinimizerFactoryImpl>
FuncMinimizerFactory; FuncMinimizerFactory;
} // namespace API } // namespace API
} // namespace Mantid } // 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 * Macro for declaring a new type of minimizers to be used with the
* FuncMinimizerFactory * FuncMinimizerFactory
......
...@@ -142,13 +142,6 @@ const std::vector<std::string> &FunctionFactoryImpl::getFunctionNames() const { ...@@ -142,13 +142,6 @@ const std::vector<std::string> &FunctionFactoryImpl::getFunctionNames() const {
return typeNames; 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> typedef Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>
FunctionFactory; FunctionFactory;
...@@ -161,6 +154,12 @@ typedef const Poco::AutoPtr<FunctionFactoryUpdateNotification> & ...@@ -161,6 +154,12 @@ typedef const Poco::AutoPtr<FunctionFactoryUpdateNotification> &
} // namespace API } // namespace API
} // namespace Mantid } // 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 * Macro for declaring a new type of function to be used with the
* FunctionFactory * FunctionFactory
......
...@@ -64,18 +64,17 @@ private: ...@@ -64,18 +64,17 @@ private:
~ImplicitFunctionFactoryImpl() override = default; ~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< typedef Mantid::Kernel::SingletonHolder<
ImplicitFunctionFactoryImpl> ImplicitFunctionFactory; ImplicitFunctionFactoryImpl> ImplicitFunctionFactory;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionFactoryImpl>;
}
}
#endif #endif
...@@ -62,18 +62,16 @@ private: ...@@ -62,18 +62,16 @@ private:
~ImplicitFunctionParameterParserFactoryImpl() override = default; ~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> typedef Mantid::Kernel::SingletonHolder<ImplicitFunctionParameterParserFactoryImpl>
ImplicitFunctionParameterParserFactory; ImplicitFunctionParameterParserFactory;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL
Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParameterParserFactoryImpl>;
}
}
#endif #endif
...@@ -66,18 +66,17 @@ private: ...@@ -66,18 +66,17 @@ private:
~ImplicitFunctionParserFactoryImpl() override = default; ~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< typedef Mantid::Kernel::SingletonHolder<
ImplicitFunctionParserFactoryImpl> ImplicitFunctionParserFactory; ImplicitFunctionParserFactoryImpl> ImplicitFunctionParserFactory;
} }
} }
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL
Mantid::Kernel::SingletonHolder<Mantid::API::ImplicitFunctionParserFactoryImpl>;
}
}
#endif #endif
...@@ -48,17 +48,17 @@ private: ...@@ -48,17 +48,17 @@ private:
operator=(const InstrumentDataServiceImpl &) = delete; 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< typedef Mantid::Kernel::SingletonHolder<
InstrumentDataServiceImpl> InstrumentDataService; InstrumentDataServiceImpl> InstrumentDataService;
} // Namespace API } // Namespace API
} // Namespace Mantid } // Namespace Mantid
namespace Mantid {
namespace Kernel {
EXTERN_MANTID_API template class MANTID_API_DLL
Mantid::Kernel::SingletonHolder<Mantid::API::InstrumentDataServiceImpl>;
}
}
#endif /*INSTRUMENTDATASERVICE_*/ #endif /*INSTRUMENTDATASERVICE_*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment