MCKL
Monte Carlo Kernel Library
Public Member Functions | Static Public Member Functions | List of all members
mckl::HDF5File Class Reference

RAII class for HDF5 file object. More...

#include <mckl/utility/hdf5.hpp>

Inherits mckl::HDF5ID< HDF5File >.

Public Member Functions

 HDF5File ()=default
 
 HDF5File (const std::string &filename)
 Open an HDF5 file if it possible, otherwise create a new one. More...
 
 HDF5File (const std::string &filename, bool append)
 Open or create an HDF5 file. More...
 
 HDF5File (const std::string &filename, bool append, bool read_only)
 Open or create an HDF5 file. More...
 
- Public Member Functions inherited from mckl::HDF5ID< HDF5File >
 HDF5ID ()
 
 HDF5ID (::hid_t id)
 
 HDF5ID (const HDF5ID &other)
 
 HDF5ID (HDF5ID &&other)
 
 ~HDF5ID ()
 
bool good () const
 
::hid_t id () const
 
 operator bool () const
 
bool operator! () const
 
HDF5IDoperator= (const HDF5ID &other)
 
HDF5IDoperator= (HDF5ID &&other)
 

Static Public Member Functions

static void close (::hid_t id)
 
::hid_t copy (::hid_t)=delete
 

Additional Inherited Members

- Protected Attributes inherited from mckl::HDF5ID< HDF5File >
::hid_t id_
 

Detailed Description

RAII class for HDF5 file object.

Definition at line 141 of file hdf5.hpp.

Constructor & Destructor Documentation

◆ HDF5File() [1/4]

mckl::HDF5File::HDF5File ( )
default

◆ HDF5File() [2/4]

mckl::HDF5File::HDF5File ( const std::string &  filename)
inlineexplicit

Open an HDF5 file if it possible, otherwise create a new one.

Definition at line 149 of file hdf5.hpp.

◆ HDF5File() [3/4]

mckl::HDF5File::HDF5File ( const std::string &  filename,
bool  append 
)
inline

Open or create an HDF5 file.

Parameters
filenameThe name of the file to open/create
appendIf true then an existing file is open, otherwise a new one is created

Definition at line 165 of file hdf5.hpp.

◆ HDF5File() [4/4]

mckl::HDF5File::HDF5File ( const std::string &  filename,
bool  append,
bool  read_only 
)
inline

Open or create an HDF5 file.

Parameters
filenameThe name of the file to open/create
appendIf true then an existing file is open, otherwise a new one is created
read_onlyIf true the file will be opened in read only mode.

Definition at line 179 of file hdf5.hpp.

Member Function Documentation

◆ close()

static void mckl::HDF5File::close ( ::hid_t  id)
inlinestatic

Definition at line 191 of file hdf5.hpp.

◆ copy()

::hid_t mckl::HDF5File::copy ( ::hid_t  )
staticdelete