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

Classes

class  Driver
 abstract class for file drivers More...
 
class  File
 
class  MemoryDriver
 memory file driver 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  DriverID : unsigned { DriverID::ePosix = 1, DriverID::eDirect = 2, DriverID::eMemory = 3, DriverID::eMPI = 4 }
 enumeration to determine the file driver More...
 
enum  AccessFlags : unsigned { AccessFlags::TRUNCATE = 0x0002, AccessFlags::EXCLUSIVE = 0x0004, AccessFlags::READWRITE = 0x0001, AccessFlags::READONLY = 0x0000 }
 flags controlling file opening and creation More...
 
enum  ImageFlags : unsigned {
  ImageFlags::READONLY = 0x0000, ImageFlags::READWRITE = H5LT_FILE_IMAGE_OPEN_RW, ImageFlags::DONT_COPY = H5LT_FILE_IMAGE_DONT_COPY, ImageFlags::DONT_RELEASE = H5LT_FILE_IMAGE_DONT_RELEASE,
  ImageFlags::ALL = H5LT_FILE_IMAGE_ALL
}
 flags controlling image file opening and getting More...
 
enum  SearchFlags : unsigned int {
  SearchFlags::FILE = H5F_OBJ_FILE, SearchFlags::DATASET = H5F_OBJ_DATASET, SearchFlags::GROUP = H5F_OBJ_GROUP, SearchFlags::DATATYPE = H5F_OBJ_DATATYPE,
  SearchFlags::ATTRIBUTE = H5F_OBJ_ATTR, SearchFlags::ALL = H5F_OBJ_ALL, SearchFlags::LOCAL = H5F_OBJ_LOCAL
}
 flags controlling object search in a file More...
 
enum  Scope : std::underlying_type< H5F_scope_t >::type { Scope::LOCAL = H5F_SCOPE_LOCAL, Scope::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 (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)
 
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)
 
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)
 
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 

◆ DriverID

enum hdf5::file::DriverID : unsigned
strong
Enumerator
ePosix 
eDirect 
eMemory 
eMPI 

◆ ImageFlags

enum hdf5::file::ImageFlags : unsigned
strong
Enumerator
READONLY 
READWRITE 
DONT_COPY 
DONT_RELEASE 
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/4]

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() [2/4]

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

◆ from_buffer() [3/4]

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

◆ from_buffer() [4/4]

template<typename T >
File hdf5::file::from_buffer ( const 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/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 SearchFlags flags 
)

◆ operator<<() [4/4]

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

◆ operator|() [1/9]

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

◆ operator|() [2/9]

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

◆ operator|() [3/9]

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

◆ operator|() [4/9]

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

◆ operator|() [5/9]

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

◆ operator|() [6/9]

ImageFlagsBase hdf5::file::operator| ( const ImageFlags lhs,
const ImageFlagsBase 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 
)