Skip to content
Snippets Groups Projects
Commit 46ccb44f authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Move NexusHDF5Descriptor to Kernel


Signed-off-by: default avatarSteven Hahn <hahnse@ornl.gov>
parent c0d42f19
No related branches found
No related tags found
No related merge requests found
......@@ -8,12 +8,12 @@
#include "MantidAPI/IFileLoader.h"
#include "MantidKernel/System.h"
#include "MantidNexus/NexusHDF5Descriptor.h"
#include "MantidKernel/NexusHDF5Descriptor.h"
namespace Mantid::DataHandling {
class DLLExport NexusFileLoader
: public API::IFileLoader<Mantid::NeXus::NexusHDF5Descriptor> {
: public API::IFileLoader<Mantid::Kernel::NexusHDF5Descriptor> {
public:
void exec() override;
boost::shared_ptr<Algorithm> createChildAlgorithm(
......@@ -21,9 +21,8 @@ public:
const double endProgress = -1., const bool enableLogging = true,
const int &version = -1) override;
void
setFileInfo(std::shared_ptr<Mantid::NeXus::NexusHDF5Descriptor> fileInfo);
setFileInfo(std::shared_ptr<Mantid::Kernel::NexusHDF5Descriptor> fileInfo);
private:
std::shared_ptr<Mantid::NeXus::NexusHDF5Descriptor> m_fileInfo;
std::shared_ptr<Mantid::Kernel::NexusHDF5Descriptor> m_fileInfo;
};
} // namespace Mantid::DataHandling
......@@ -17,7 +17,7 @@ namespace Mantid::DataHandling {
return nullptr;
}
void NexusFileLoader::setFileInfo(
std::shared_ptr<Mantid::NeXus::NexusHDF5Descriptor> fileInfo) {
std::shared_ptr<Mantid::Kernel::NexusHDF5Descriptor> fileInfo) {
m_fileInfo = std::move(fileInfo);
}
}
......@@ -76,6 +76,7 @@ set(SRC_FILES
src/NDRandomNumberGenerator.cpp
src/NeutronAtom.cpp
src/NexusDescriptor.cpp
src/NexusHDF5Descriptor.cpp
src/NullValidator.cpp
src/OptionalBool.cpp
src/ParaViewVersion.cpp
......@@ -241,6 +242,7 @@ set(INC_FILES
inc/MantidKernel/NetworkProxy.h
inc/MantidKernel/NeutronAtom.h
inc/MantidKernel/NexusDescriptor.h
inc/MantidKernel/NexusHDF5Descriptor.h
inc/MantidKernel/NullValidator.h
inc/MantidKernel/OptionalBool.h
inc/MantidKernel/ParaViewVersion.h
......@@ -396,6 +398,7 @@ set(TEST_FILES
NearestNeighboursTest.h
NeutronAtomTest.h
NexusDescriptorTest.h
NexusHDF5DescriptorTest.h
NullValidatorTest.h
OptionalBoolTest.h
ProgressBaseTest.h
......@@ -491,7 +494,7 @@ target_include_directories(Kernel SYSTEM
PUBLIC ${Boost_INCLUDE_DIRS} ${POCO_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIR}
PRIVATE ${NEXUS_INCLUDE_DIR} ${GSL_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR})
${OPENSSL_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS})
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(Kernel PROPERTIES INSTALL_RPATH "@loader_path/../MacOS;@loader_path/../Frameworks")
......@@ -521,6 +524,7 @@ target_link_libraries(Kernel
${MANTIDLIBS}
${NETWORK_LIBRARIES}
span
${HDF5_LIBRARIES}
)
if(WIN32)
target_link_libraries(Kernel LINK_PRIVATE Psapi.lib) # For memory usage
......
......@@ -12,8 +12,7 @@
#include <set>
#include <string>
namespace Mantid {
namespace NeXus {
namespace Mantid::Kernel {
class DLLExport NexusHDF5Descriptor {
......@@ -71,5 +70,4 @@ private:
std::map<std::string, std::set<std::string>> m_allEntries;
};
} // namespace NeXus
} // namespace Mantid
} // namespace Mantid::Kernel
......@@ -5,7 +5,7 @@
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidNexus/NexusHDF5Descriptor.h"
#include "MantidKernel/NexusHDF5Descriptor.h"
#include <hdf5.h>
......@@ -13,8 +13,7 @@
#include <cstring> // strcpy
#include <stdexcept> // std::invalid_argument
namespace Mantid {
namespace NeXus {
namespace Mantid::Kernel {
/// hdf5 specific functions, stay in anonymous namespace to make hdf5 linking
/// PRIVATE
......@@ -200,7 +199,7 @@ NexusHDF5Descriptor::initAllEntries() {
hid_t fileID = H5Fopen(m_filename.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
if (fileID < 0) {
throw std::invalid_argument(
"ERROR: NeXus::HDF5Descriptor couldn't open hdf5 file " + m_filename +
"ERROR: Kernel::HDF5Descriptor couldn't open hdf5 file " + m_filename +
"\n");
}
......@@ -216,5 +215,4 @@ NexusHDF5Descriptor::initAllEntries() {
return allEntries;
}
} // namespace NeXus
} // namespace Mantid
} // namespace Mantid::Kernel
set(SRC_FILES src/MuonNexusReader.cpp src/NexusClasses.cpp src/NexusFileIO.cpp src/NexusHDF5Descriptor.cpp)
set(SRC_FILES src/MuonNexusReader.cpp src/NexusClasses.cpp src/NexusFileIO.cpp)
set(INC_FILES
inc/MantidNexus/MuonNexusReader.h
inc/MantidNexus/NexusClasses.h
inc/MantidNexus/NexusFileIO.h
inc/MantidNexus/NexusIOHelper.h
inc/MantidNexus/NexusHDF5Descriptor.h)
inc/MantidNexus/NexusIOHelper.h)
set(TEST_FILES NexusIOHelperTest.h NexusHDF5DescriptorTest.h)
set(TEST_FILES NexusIOHelperTest.h)
if(COVERALLS)
foreach(loop_var ${SRC_FILES} ${INC_FILES})
......@@ -39,16 +38,12 @@ set_property(TARGET Nexus PROPERTY FOLDER "MantidFramework")
include_directories(inc)
target_include_directories(Nexus
PRIVATE ${HDF5_INCLUDE_DIRS})
target_link_libraries(Nexus
LINK_PRIVATE
${TCMALLOC_LIBRARIES_LINKTIME}
${MANTIDLIBS}
${NEXUS_C_LIBRARIES}
${NEXUS_LIBRARIES}
${HDF5_LIBRARIES})
${NEXUS_LIBRARIES})
# Add the unit tests directory
add_subdirectory(test)
......
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