-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* moved STL datatype traits to contrib/stl Update #548 * Removed unused header files Update #548 * attribute tests are back Update #548 * node tests are back update #548 * file and utility tests are back Update #548 * datatype test is back Update #548 * dataspace test ist back Update #548 * moved dataspaces for STL containers to contrib Update #548 * removed ebool code from the mainline Update #548 * Added test build for the nexus contrib Update #548 * Fixing ebool tests Update #548 * add include statments * downgrade conan version * revert conanfile_ess.txt * fix typo * add CONAN_FILE for macos * move include statement to dataset.cpp * add back stl/string.hpp to dataset.hpp * add newline at the end of files * comment bzip2 from macos conanfile * since @amues remove * comment windows test Co-authored-by: Jan Kotanski <[email protected]>
- Loading branch information
1 parent
5a4f3e7
commit d014984
Showing
55 changed files
with
588 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set(CONTRIB_SOURCES) | ||
set(CONTRIB_HEADERS) | ||
|
||
if(H5CPP_ENABLE_STL) | ||
add_subdirectory(stl) | ||
endif() | ||
|
||
if(H5CPP_ENABLE_NEXUS) | ||
add_subdirectory(nexus) | ||
endif() | ||
|
||
set(h5cpp_sources ${h5cpp_sources} ${CONTRIB_SOURCES} PARENT_SCOPE) | ||
set(h5cpp_headers ${h5cpp_headers} ${CONTRIB_HEADERS} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ebool.cpp) | ||
set(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/ebool.hpp) | ||
|
||
install(FILES ${HEADERS} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/h5cpp/contrib/nexus) | ||
|
||
set(CONTRIB_SOURCES ${CONTRIB_SOURCES} ${SOURCES} PARENT_SCOPE) | ||
set(CONTRIB_HEADERS ${CONTROB_HEADERS} ${HEADERS} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/array.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/complex.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/stl.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/string.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/vector.hpp) | ||
|
||
install(FILES ${HEADERS} | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/h5cpp/contrib/stl) | ||
|
||
set(h5cpp_headers ${h5cpp_headers} ${HEADERS} PARENT_SCOPE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#pragma once | ||
|
||
#include <h5cpp/datatype/type_trait.hpp> | ||
#include <h5cpp/dataspace/type_trait.hpp> | ||
#include <h5cpp/dataspace/simple.hpp> | ||
#include <array> | ||
|
||
namespace hdf5 { | ||
namespace datatype { | ||
|
||
template<typename T, size_t N> | ||
class TypeTrait<std::array<T, N>> { | ||
public: | ||
using Type = std::array<T, N>; | ||
using TypeClass = typename TypeTrait<T>::TypeClass; | ||
static TypeClass create(const Type & = Type()) { | ||
return TypeTrait<typename std::remove_const<T>::type>::create(); | ||
} | ||
const static TypeClass & get(const Type & = Type()) { | ||
const static TypeClass & cref_ = TypeTrait<typename std::remove_const<T>::type>::create(); | ||
return cref_; | ||
} | ||
}; | ||
} // end of namespace datatype | ||
|
||
namespace dataspace { | ||
|
||
template<typename T, size_t N> | ||
class TypeTrait<std::array<T, N>> { | ||
public: | ||
using DataspaceType = Simple; | ||
|
||
static DataspaceType create(const std::array<T, N> &) { | ||
return Simple(hdf5::Dimensions{N}, hdf5::Dimensions{N}); | ||
} | ||
|
||
const static DataspaceType & get(const std::array<T, N> &, DataspacePool &) { | ||
const static DataspaceType & cref_ = Simple(hdf5::Dimensions{N}, hdf5::Dimensions{N}); | ||
return cref_; | ||
} | ||
|
||
static void *ptr(std::array<T, N> &value) { | ||
return reinterpret_cast<void *>(value.data()); | ||
} | ||
|
||
static const void *cptr(const std::array<T, N> &value) { | ||
return reinterpret_cast<const void *>(value.data()); | ||
} | ||
}; | ||
|
||
} // end of namespace dataspace | ||
} // end of namespace hdf5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// (c) Copyright 2021 DESY, ESS | ||
// 2021 Eugen Wintersberger <[email protected]> | ||
// | ||
// This file is part of h5cpp. | ||
// | ||
// This library is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as published | ||
// by the Free Software Foundation; either version 2.1 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY | ||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
// License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this library; if not, write to the | ||
// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor | ||
// Boston, MA 02110-1301 USA | ||
// =========================================================================== | ||
// | ||
// Authors: Eugen Wintersberger <[email protected]> | ||
// Created on: Dec 23, 2021 | ||
// | ||
#pragma once | ||
|
||
#include <h5cpp/datatype/type_trait.hpp> | ||
#include <complex> | ||
|
||
namespace hdf5 { | ||
namespace datatype { | ||
|
||
template<typename T> | ||
class TypeTrait<std::complex<T>> | ||
{ | ||
private: | ||
using element_type = TypeTrait<T>; | ||
|
||
public: | ||
using Type = std::complex<T>; | ||
using TypeClass = Compound; | ||
|
||
static TypeClass create(const Type & = Type()) | ||
{ | ||
datatype::Compound type = datatype::Compound::create( | ||
sizeof(std::complex<T>)); | ||
|
||
type.insert("real", 0, element_type::create(T())); | ||
type.insert("imag", alignof(T), element_type::create(T())); | ||
|
||
return type; | ||
} | ||
const static TypeClass & get(const Type & = Type()) { | ||
const static TypeClass & cref_ = create(); | ||
return cref_; | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// (c) Copyright 2017 DESY,ESS | ||
// | ||
// This file is part of h5cpp. | ||
// | ||
// This library is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License as published | ||
// by the Free Software Foundation; either version 2.1 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This library is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY | ||
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | ||
// License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with this library; if not, write to the | ||
// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor | ||
// Boston, MA 02110-1301 USA | ||
// =========================================================================== | ||
// | ||
// Authors: Eugen Wintersberger <[email protected]> | ||
// Sebastian Koenig <[email protected]> | ||
// Jan Kotanski <[email protected]> | ||
// Created on: Aug 28, 2017 | ||
// | ||
#pragma once | ||
|
||
#include <h5cpp/contrib/stl/array.hpp> | ||
#include <h5cpp/contrib/stl/string.hpp> | ||
#include <h5cpp/contrib/stl/vector.hpp> | ||
#include <h5cpp/contrib/stl/complex.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#pragma once | ||
|
||
#include <h5cpp/datatype/type_trait.hpp> | ||
#include <h5cpp/datatype/string.hpp> | ||
#include <string> | ||
|
||
namespace hdf5 { | ||
namespace datatype { | ||
|
||
template<> | ||
class TypeTrait<std::string> { | ||
public: | ||
using Type = std::string; | ||
using TypeClass = String; | ||
static TypeClass create(const Type & = Type()) { | ||
return datatype::String::variable(); | ||
} | ||
const static TypeClass & get(const Type & = Type()) { | ||
const static TypeClass & cref_ = create(); | ||
return cref_; | ||
} | ||
}; | ||
|
||
|
||
template<typename CharT> | ||
class TypeTrait<std::basic_string<CharT>> { | ||
private: | ||
|
||
public: | ||
using Type = std::basic_string<CharT>; | ||
using TypeClass = String; | ||
|
||
static TypeClass create(const Type & = Type()) { | ||
static_assert(std::is_same<CharT, char>::value, "Only support 8Bit characters"); | ||
|
||
String type = String::variable(); | ||
type.encoding(CharacterEncoding::UTF8); | ||
return type; | ||
|
||
} | ||
const static TypeClass & get(const Type & = Type()) { | ||
const static TypeClass & cref_ = create(); | ||
return cref_; | ||
} | ||
|
||
}; | ||
} // end of namespace datatype | ||
|
||
namespace dataspace { | ||
|
||
} // end of namespace dataspace | ||
} // end of namespace hdf5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
#include <h5cpp/datatype/type_trait.hpp> | ||
|
||
namespace hdf5 { | ||
namespace datatype { | ||
|
||
template<typename T> | ||
class TypeTrait<std::vector<T>> { | ||
public: | ||
using Type = std::vector<T>; | ||
using TypeClass = typename TypeTrait<T>::TypeClass; | ||
static TypeClass create(const Type & = Type()) { | ||
return TypeTrait<typename std::remove_const<T>::type>::create(); | ||
} | ||
const static TypeClass & get(const Type & = Type()) { | ||
const static TypeClass & cref_ = create(); | ||
return cref_; | ||
} | ||
}; | ||
|
||
} // end of namespace datatype | ||
|
||
namespace dataspace { | ||
|
||
template<typename T> | ||
class TypeTrait<std::vector<T>> { | ||
public: | ||
using DataspaceType = Simple; | ||
|
||
static Simple create(const std::vector<T> &value) { | ||
return Simple(hdf5::Dimensions{value.size()}, hdf5::Dimensions{value.size()}); | ||
} | ||
|
||
static const Dataspace & get(const std::vector<T> & value, DataspacePool & pool) { | ||
return pool.getSimple(value.size()); | ||
} | ||
|
||
static void *ptr(std::vector<T> &data) { | ||
return reinterpret_cast<void *>(data.data()); | ||
} | ||
|
||
static const void *cptr(const std::vector<T> &data) { | ||
return reinterpret_cast<const void *>(data.data()); | ||
} | ||
}; | ||
|
||
} // end of namespace dataspace | ||
} // end of namespace hdf5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.