h5cpp
0.5.0
A modern C++ wrapper for the HDF5 C library
|
Go to the documentation of this file.
60 const property::FileCreationList &fcpl = property::FileCreationList(),
61 const property::FileAccessList &fapl = property::FileAccessList());
64 const property::FileCreationList &fcpl = property::FileCreationList(),
65 const property::FileAccessList &fapl = property::FileAccessList());
80 const property::FileAccessList &fapl = property::FileAccessList());
83 const property::FileAccessList &fapl = property::FileAccessList());
112 const datatype::Datatype &mem_type,
113 const dataspace::Dataspace &mem_space,
141 throw std::runtime_error(
"Invalid ImageFlags for const buffer: the DONT_COPY flag together with the READWRITE flag");
150 return from_buffer(data, mem_type_holder.
get(data), mem_space, flags);
160 throw std::runtime_error(
"Invalid ImageFlags in from_buffer: the DONT_COPY flag without the DONT_RELEASE flag");
161 size_t databytesize = signed2unsigned<size_t>(mem_space.
size()) * mem_type.
size();
166 fid = H5LTopen_file_image(
dataspace::ptr(data), databytesize, flags);
169 std::stringstream ss;
170 ss <<
"Failure opening file image";
177 std::stringstream ss;
178 ss<<
"Failure to open non-integer buffer";
TypeTrait< T >::DataspaceType create(const T &value)
factory function for dataspaces
Definition: type_trait.hpp:89
virtual size_t size() const
get size of type in bytes
File create(const fs::path &path, AccessFlags flags=AccessFlags::Exclusive, const property::FileCreationList &fcpl=property::FileCreationList(), const property::FileAccessList &fapl=property::FileAccessList())
create a new file
const Datatype & get(const T &v=T())
factory holder method for getting reference of data types
Definition: factory.hpp:74
data type object holder
Definition: factory.hpp:53
Class get_class() const
returns the datatypes class
File open(const fs::path &path, AccessFlags flags=AccessFlags::ReadOnly, const property::FileAccessList &fapl=property::FileAccessList())
open an existing file
bool is_hdf5_file(const fs::path &path)
check if the file reference by the path is an HDF5 file
ImageFlags
flags controlling image file opening and getting
Definition: types.hpp:67
void * ptr(T &value)
Definition: type_trait.hpp:111
static Singleton & instance()
reference to singleton
Definition: error.hpp:59
std::underlying_type< AccessFlags >::type AccessFlagsBase
Definition: types.hpp:52
void throw_with_stack(const std::string &message)
throws an exception, potentially nested with error stack
AccessFlags
flags controlling file opening and creation
Definition: types.hpp:39
Wrapper for hid_t object identifiers.
Definition: object_handle.hpp:66
std::underlying_type< ImageFlags >::type ImageFlagsBase
Definition: types.hpp:76
@ Integer
indicates an integer type
#define DLL_EXPORT
Definition: windows.hpp:29
dataspace base class
Definition: dataspace.hpp:41
virtual hssize_t size() const
number of elements in the dataspace
File from_buffer(T &data, ImageFlags flags=ImageFlags::ReadOnly)
load an image file from a buffer
Definition: functions.hpp:126
base class for all data types
Definition: datatype.hpp:41
top-level namespace of the entire library
Definition: attribute.hpp:45