diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9e5567b..48fb6b9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,8 +3,8 @@ include_directories(${CMAKE_SOURCE_DIR}/src/include) add_subdirectory(tests) add_subdirectory(lib) -#if(ENABLE_hdf5) -# add_subdirectory(opt/hdf5) -#endif() +if(ENABLE_hdf5) + add_subdirectory(opt/hdf5) +endif() install(DIRECTORY include/ DESTINATION ${INSTALL_PATH}/include) diff --git a/src/opt/hdf5/CMakeLists.txt b/src/opt/hdf5/CMakeLists.txt new file mode 100644 index 0000000..2119643 --- /dev/null +++ b/src/opt/hdf5/CMakeLists.txt @@ -0,0 +1,8 @@ + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +add_subdirectory(lib) +#add_subdirectory(tests) + +set(HDF5_INSTALL_PATH ${INSTALL_PATH}/hdf5) +install(DIRECTORY include/ DESTINATION ${HDF5_INSTALL_PATH}/include) diff --git a/src/opt/hdf5/include/h5_content_base.h b/src/opt/hdf5/include/h5_content_base.h index 77580ff..bf18bce 100644 --- a/src/opt/hdf5/include/h5_content_base.h +++ b/src/opt/hdf5/include/h5_content_base.h @@ -30,10 +30,10 @@ namespace CNORXZ virtual ContentBase& load() = 0; virtual ContentBase& write() = 0; virtual ContentBase& close() = 0; - virtual MArray* get() = 0; - virtual const MArray* get() const = 0; + virtual MArray>* get() = 0; + virtual const MArray>* get() const = 0; virtual String path() const = 0; - virtual String file() const = 0; + virtual String filename() const = 0; const String& name() const; const ContentBase* parent() const; @@ -46,9 +46,10 @@ namespace CNORXZ RangePtr mRange; hid_t mId = 0; }; - } - typedef Sptr ContentPtr; + typedef Sptr ContentPtr; + + } } #endif diff --git a/src/opt/hdf5/include/h5_file.h b/src/opt/hdf5/include/h5_file.h index 8e7146a..3707c8f 100644 --- a/src/opt/hdf5/include/h5_file.h +++ b/src/opt/hdf5/include/h5_file.h @@ -22,8 +22,8 @@ namespace CNORXZ virtual File& load() override final; virtual File& write() override final; virtual File& close() override final; - virtual MArray* get() override final; - virtual const MArray* get() const override final; + virtual MArray>* get() override final; + virtual const MArray>* get() const override final; virtual String path() const override final; virtual String filename() const override final; diff --git a/src/opt/hdf5/include/h5_group.h b/src/opt/hdf5/include/h5_group.h index aa66864..5a32be2 100644 --- a/src/opt/hdf5/include/h5_group.h +++ b/src/opt/hdf5/include/h5_group.h @@ -19,8 +19,8 @@ namespace CNORXZ virtual bool ro() const override final; virtual Group& load() override final; virtual Group& close() override final; - virtual MArray* get() override final; - virtual const MArray* get() const override final; + virtual MArray>* get() override final; + virtual const MArray>* get() const override final; virtual String path() const override final; virtual String filename() const override final; diff --git a/src/opt/hdf5/lib/CMakeLists.txt b/src/opt/hdf5/lib/CMakeLists.txt new file mode 100644 index 0000000..651cd17 --- /dev/null +++ b/src/opt/hdf5/lib/CMakeLists.txt @@ -0,0 +1,22 @@ + +set(libcnorxzhdf5_a_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/h5_content_base.cc + ${CMAKE_CURRENT_SOURCE_DIR}/h5_file.cc + ${CMAKE_CURRENT_SOURCE_DIR}/h5_group.cc + ) + +add_library(cnorxzhdf5_obj OBJECT + ${libcnorxzhdf5_a_SOURCES} + ) + +set_target_properties(cnorxzhdf5_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +add_library(cnorxzhdf5 SHARED + $ + ) +set_target_properties(cnorxzhdf5 PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + +install(TARGETS cnorxz + ARCHIVE DESTINATION ${HDF5_INSTALL_PATH}/lib + LIBRARY DESTINATION ${HDF5_INSTALL_PATH}/lib + ) diff --git a/src/opt/hdf5/lib/h5_content_base.cc b/src/opt/hdf5/lib/h5_content_base.cc index 686e2e6..0726f6c 100644 --- a/src/opt/hdf5/lib/h5_content_base.cc +++ b/src/opt/hdf5/lib/h5_content_base.cc @@ -6,7 +6,7 @@ namespace CNORXZ namespace hdf5 { ContentBase::ContentBase(const String& _name, const ContentBase* _parent) : - mName(_name), mParent(parent) + mName(_name), mParent(_parent) {} const String& ContentBase::name() const diff --git a/src/opt/hdf5/lib/h5_file.cc b/src/opt/hdf5/lib/h5_file.cc index 447bb84..a520be8 100644 --- a/src/opt/hdf5/lib/h5_file.cc +++ b/src/opt/hdf5/lib/h5_file.cc @@ -1,5 +1,6 @@ #include "h5_file.h" +#include namespace CNORXZ { @@ -54,7 +55,7 @@ namespace CNORXZ { CXZ_ASSERT( not mRo, "could not write to file: opened as read-only" ); for(auto& x: mCont){ - x.write(); + x->write(); } return *this; } @@ -62,7 +63,7 @@ namespace CNORXZ File& File::close() { for(auto& x: mCont){ - x.close(); + x->close(); } if(mId != 0){ H5Fclose(mId); @@ -70,12 +71,12 @@ namespace CNORXZ return *this; } - MArray* File::get() + MArray>* File::get() { return &mCont; } - const MArray* File::get() const + const MArray>* File::get() const { return &mCont; } diff --git a/src/opt/hdf5/lib/h5_group.cc b/src/opt/hdf5/lib/h5_group.cc index d6242e0..603b668 100644 --- a/src/opt/hdf5/lib/h5_group.cc +++ b/src/opt/hdf5/lib/h5_group.cc @@ -48,14 +48,14 @@ namespace CNORXZ return *this; } - MArray* Group::get() + MArray>* Group::get() { - return mCont; + return &mCont; } - const MArray* Group::get() const + const MArray>* Group::get() const { - return mCont; + return &mCont; } String Group::path() const