h5cpp  0.5.1
A modern C++ wrapper for the HDF5 C library
hdf5::file Namespace Reference

Classes

class  DirectDriver
 direct write without buffering (for hdf5 compiled with H5_HAVE_DIRECT) More...
 
class  Driver
 abstract class for file drivers More...
 
class  File
 
class  MemoryDriver
 memory file driver More...
 
class  MPIDriver
 class for the MPI driver (for hdf5 with compiled MPI) More...
 
class  PosixDriver
 

Typedefs

using AccessFlagsBase = std::underlying_type< AccessFlags >::type
 
using ImageFlagsBase = std::underlying_type< ImageFlags >::type
 
using SearchFlagsBase = std::underlying_type< SearchFlags >::type
 
using ScopeBase = std::underlying_type< Scope >::type
 

Enumerations

enum class  DriverID : unsigned { Posix = 1 , Direct = 2 , Memory = 3 , MPI = 4 }
 enumeration to determine the file driver More...
 
enum class  AccessFlags : unsigned {
  Truncate = 0x0002 , Exclusive = 0x0004 , ReadWrite = 0x0001 , ReadOnly = 0x0000 ,
  SWMRRead = 0x0040 , SWMRWrite = 0x0020
}
 flags controlling file opening and creation More...
 
enum class  ImageFlags : unsigned {
  ReadOnly = 0x0000 , ReadWrite = H5LT_FILE_IMAGE_OPEN_RW , DontCopy = H5LT_FILE_IMAGE_DONT_COPY , DontRelease = H5LT_FILE_IMAGE_DONT_RELEASE ,
  All = H5LT_FILE_IMAGE_ALL
}
 flags controlling image file opening and getting More...
 
enum class  SearchFlags : unsigned int {
  File = H5F_OBJ_FILE , Dataset = H5F_OBJ_DATASET , Group = H5F_OBJ_GROUP , Datatype = H5F_OBJ_DATATYPE ,
  Attribute = H5F_OBJ_ATTR , All = H5F_OBJ_ALL , Local = H5F_OBJ_LOCAL
}
 flags controlling object search in a file More...
 
enum class  Scope : std::underlying_type< H5F_scope_t >::type { Local = H5F_SCOPE_LOCAL , Global = H5F_SCOPE_GLOBAL }
 file scope More...
 

Functions

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 More...
 
File create (const fs::path &path, AccessFlagsBase flags, const property::FileCreationList &fcpl=property::FileCreationList(), const property::FileAccessList &fapl=property::FileAccessList())
 
File open (const fs::path &path, AccessFlags flags=AccessFlags::ReadOnly, const property::FileAccessList &fapl=property::FileAccessList())
 open an existing file More...
 
File open (const fs::path &path, AccessFlagsBase flags, const property::FileAccessList &fapl=property::FileAccessList())
 
bool is_hdf5_file (const fs::path &path)
 check if the file reference by the path is an HDF5 file More...
 
template<typename T >
File from_buffer (T &data, ImageFlags flags=ImageFlags::ReadOnly)
 load an image file from a buffer More...
 
template<typename T >
File from_buffer (T &data, ImageFlagsBase flags)
 
template<typename T >
File from_buffer (T &data, const datatype::Datatype &mem_type, const dataspace::Dataspace &mem_space, ImageFlagsBase flags)
 
template<typename T >
File from_buffer (const T &data, ImageFlags flags=ImageFlags::ReadOnly)
 
template<typename T >
File from_buffer (const T &data, ImageFlagsBase flags)
 
std::ostream & operator<< (std::ostream &stream, const AccessFlags &flags)
 
AccessFlagsBase operator| (const AccessFlags &lhs, const AccessFlags &rhs)
 
AccessFlagsBase operator| (const AccessFlagsBase &lhs, const AccessFlags &rhs)
 
AccessFlagsBase operator| (const AccessFlags &lhs, const AccessFlagsBase &rhs)
 
AccessFlagsBase operator& (const AccessFlags &lhs, const AccessFlags &rhs)
 
AccessFlagsBase operator& (const AccessFlagsBase &lhs, const AccessFlags &rhs)
 
AccessFlagsBase operator& (const AccessFlags &lhs, const AccessFlagsBase &rhs)
 
std::ostream & operator<< (std::ostream &stream, const ImageFlags &flags)
 
ImageFlagsBase operator| (const ImageFlags &lhs, const ImageFlags &rhs)
 
ImageFlagsBase operator| (const ImageFlagsBase &lhs, const ImageFlags &rhs)
 
ImageFlagsBase operator| (const ImageFlags &lhs, const ImageFlagsBase &rhs)
 
ImageFlagsBase operator& (const ImageFlags &lhs, const ImageFlags &rhs)
 
ImageFlagsBase operator& (const ImageFlagsBase &lhs, const ImageFlags &rhs)
 
ImageFlagsBase operator& (const ImageFlags &lhs, const ImageFlagsBase &rhs)
 
std::ostream & operator<< (std::ostream &stream, const SearchFlags &flags)
 
SearchFlagsBase operator| (const SearchFlags &lhs, const SearchFlags &rhs)
 
SearchFlagsBase operator| (const SearchFlags &lhs, const SearchFlagsBase &rhs)
 
SearchFlagsBase operator| (const SearchFlagsBase &lhs, const SearchFlags &rhs)
 
SearchFlagsBase operator& (const SearchFlags &lhs, const SearchFlags &rhs)
 
SearchFlagsBase operator& (const SearchFlags &lhs, const SearchFlagsBase &rhs)
 
SearchFlagsBase operator& (const SearchFlagsBase &lhs, const SearchFlags &rhs)
 
std::ostream & operator<< (std::ostream &stream, const Scope &scope)
 

Typedef Documentation

◆ AccessFlagsBase

using hdf5::file::AccessFlagsBase = typedef std::underlying_type<AccessFlags>::type

◆ ImageFlagsBase

using hdf5::file::ImageFlagsBase = typedef std::underlying_type<ImageFlags>::type

◆ ScopeBase

using hdf5::file::ScopeBase = typedef std::underlying_type<Scope>::type

◆ SearchFlagsBase

using hdf5::file::SearchFlagsBase = typedef std::underlying_type<SearchFlags>::type

Enumeration Type Documentation

◆ AccessFlags

enum hdf5::file::AccessFlags : unsigned
strong
Enumerator
Truncate 
Exclusive 
ReadWrite 
ReadOnly 
SWMRRead 

(since hdf5 1.10.0)

SWMRWrite 

(since hdf5 1.10.0)

◆ DriverID

enum hdf5::file::DriverID : unsigned
strong
Enumerator
Posix 
Direct 
Memory 
MPI 

◆ ImageFlags

enum hdf5::file::ImageFlags : unsigned
strong
Enumerator
ReadOnly 
ReadWrite 
DontCopy 
DontRelease 
All 

◆ Scope

enum hdf5::file::Scope : std::underlying_type< H5F_scope_t >::type
strong
Enumerator
Local 
Global 

◆ SearchFlags

enum hdf5::file::SearchFlags : unsigned int
strong
Enumerator
File 
Dataset 
Group 
Datatype 
Attribute 
All 
Local 

Function Documentation

◆ create() [1/2]

File hdf5::file::create ( const fs::path &  path,
AccessFlags  flags = AccessFlags::Exclusive,
const property::FileCreationList fcpl = property::FileCreationList(),
const property::FileAccessList fapl = property::FileAccessList() 
)
Parameters
paththe path to the new file
flagsHDF5 file creation flags
fcplreference to a file creation property list
faplreference to a file access property list
Exceptions
std::runtime_errorin case of a failure
Returns
new instance of File
See also
AccessFlags
FileCreationList
FileAccessList

◆ create() [2/2]

File hdf5::file::create ( const fs::path &  path,
AccessFlagsBase  flags,
const property::FileCreationList fcpl = property::FileCreationList(),
const property::FileAccessList fapl = property::FileAccessList() 
)

◆ from_buffer() [1/5]

template<typename T >
File hdf5::file::from_buffer ( const T &  data,
ImageFlags  flags = ImageFlags::ReadOnly 
)

◆ from_buffer() [2/5]

template<typename T >
File hdf5::file::from_buffer ( const T &  data,
ImageFlagsBase  flags 
)

◆ from_buffer() [3/5]

template<typename T >
File hdf5::file::from_buffer ( T &  data,
const datatype::Datatype mem_type,
const dataspace::Dataspace mem_space,
ImageFlagsBase  flags 
)

◆ from_buffer() [4/5]

template<typename T >
File hdf5::file::from_buffer ( T &  data,
ImageFlags  flags = ImageFlags::ReadOnly 
)
Exceptions
std::runtime_errorin case of a failure
Template Parameters
Tsource type
Parameters
datareference to the source instance of T
flagsfile image flags
Returns
a new File instance
See also
ImageFlags

◆ from_buffer() [5/5]

template<typename T >
File hdf5::file::from_buffer ( T &  data,
ImageFlagsBase  flags 
)

◆ is_hdf5_file()

bool hdf5::file::is_hdf5_file ( const fs::path &  path)
Parameters
pathreference to the files path
Exceptions
std::runtime_errorin case of a failure
Returns
true if the path references an HDF5 file, false otherwise

◆ open() [1/2]

File hdf5::file::open ( const fs::path &  path,
AccessFlags  flags = AccessFlags::ReadOnly,
const property::FileAccessList fapl = property::FileAccessList() 
)
Parameters
paththe path to the file to open
flagsfile open flags
faplreference to a file access property list
Exceptions
std::runtime_errorin case of a failure
Returns
a new File instance
See also
AccessFlags
FileAccessList

◆ open() [2/2]

File hdf5::file::open ( const fs::path &  path,
AccessFlagsBase  flags,
const property::FileAccessList fapl = property::FileAccessList() 
)

◆ operator&() [1/9]

AccessFlagsBase hdf5::file::operator& ( const AccessFlags lhs,
const AccessFlags rhs 
)

◆ operator&() [2/9]

AccessFlagsBase hdf5::file::operator& ( const AccessFlags lhs,
const AccessFlagsBase rhs 
)

◆ operator&() [3/9]

AccessFlagsBase hdf5::file::operator& ( const AccessFlagsBase lhs,
const AccessFlags rhs 
)

◆ operator&() [4/9]

ImageFlagsBase hdf5::file::operator& ( const ImageFlags lhs,
const ImageFlags rhs 
)

◆ operator&() [5/9]

ImageFlagsBase hdf5::file::operator& ( const ImageFlags lhs,
const ImageFlagsBase rhs 
)

◆ operator&() [6/9]

ImageFlagsBase hdf5::file::operator& ( const ImageFlagsBase lhs,
const ImageFlags rhs 
)

◆ operator&() [7/9]

SearchFlagsBase hdf5::file::operator& ( const SearchFlags lhs,
const SearchFlags rhs 
)

◆ operator&() [8/9]

SearchFlagsBase hdf5::file::operator& ( const SearchFlags lhs,
const SearchFlagsBase rhs 
)

◆ operator&() [9/9]

SearchFlagsBase hdf5::file::operator& ( const SearchFlagsBase lhs,
const SearchFlags rhs 
)

◆ operator<<() [1/4]

std::ostream& hdf5::file::operator<< ( std::ostream &  stream,
const AccessFlags flags 
)

◆ operator<<() [2/4]

std::ostream& hdf5::file::operator<< ( std::ostream &  stream,
const ImageFlags flags 
)

◆ operator<<() [3/4]

std::ostream& hdf5::file::operator<< ( std::ostream &  stream,
const Scope scope 
)

◆ operator<<() [4/4]

std::ostream& hdf5::file::operator<< ( std::ostream &  stream,
const SearchFlags flags 
)

◆ operator|() [1/9]

AccessFlagsBase hdf5::file::operator| ( const AccessFlags lhs,
const AccessFlags rhs 
)

◆ operator|() [2/9]

AccessFlagsBase hdf5::file::operator| ( const AccessFlags lhs,
const AccessFlagsBase rhs 
)

◆ operator|() [3/9]

AccessFlagsBase hdf5::file::operator| ( const AccessFlagsBase lhs,
const AccessFlags rhs 
)

◆ operator|() [4/9]

ImageFlagsBase hdf5::file::operator| ( const ImageFlags lhs,
const ImageFlags rhs 
)

◆ operator|() [5/9]

ImageFlagsBase hdf5::file::operator| ( const ImageFlags lhs,
const ImageFlagsBase rhs 
)

◆ operator|() [6/9]

ImageFlagsBase hdf5::file::operator| ( const ImageFlagsBase lhs,
const ImageFlags rhs 
)

◆ operator|() [7/9]

SearchFlagsBase hdf5::file::operator| ( const SearchFlags lhs,
const SearchFlags rhs 
)

◆ operator|() [8/9]

SearchFlagsBase hdf5::file::operator| ( const SearchFlags lhs,
const SearchFlagsBase rhs 
)

◆ operator|() [9/9]

SearchFlagsBase hdf5::file::operator| ( const SearchFlagsBase lhs,
const SearchFlags rhs 
)