hdf5File
C++ Class Reference
1 Overview
Constructor with path and filename.
2 Detailed Description
routeDirectory path filenFilename overwriteWhether to overwrite existing file
3 Class Hierarchy
4 Public Interface
4.1 Methods
4.1.1 hdf5File()
BigDataStatMeth::hdf5File::hdf5File(H5::H5File *file)Constructor with file pointer.
Parameters:
file(H5::H5File *): HDF5 file pointer
fileHDF5 file pointer
4.1.2 createFile()
int BigDataStatMeth::hdf5File::createFile()Create a new HDF5 file.
Returns: EXEC_OK on success, EXEC_ERROR on error, EXEC_WARNING if file exists
Creates a new HDF5 file at the specified location. If the file exists and overwrite is true, it will be truncated.
4.1.3 openFile()
H5::H5File * BigDataStatMeth::hdf5File::openFile(std::string opentype)Open an existing HDF5 file.
Parameters:
opentype(std::string): Access mode (“r” for read-only, “rw” for read-write)
Returns: Pointer to opened file or nullptr on error
Opens an HDF5 file in read or read/write mode.
4.1.4 getFileptr()
H5::H5File * BigDataStatMeth::hdf5File::getFileptr()Get file pointer.
Returns: Pointer to HDF5 file
Pointer to HDF5 file
4.1.5 getFilename()
std::string BigDataStatMeth::hdf5File::getFilename()Get filename.
Returns: Filename without path
Filename without path
4.1.6 getPath()
std::string BigDataStatMeth::hdf5File::getPath()Get file path.
Returns: Directory path without filename
Directory path without filename
4.1.7 getFullPath()
std::string BigDataStatMeth::hdf5File::getFullPath()Get full file path.
Returns: Complete path including filename
Complete path including filename
4.1.8 checkFile()
bool BigDataStatMeth::hdf5File::checkFile()Check if file exists.
Returns: True if file exists, false otherwise
True if file exists, false otherwise
4.1.9 getDatasetNames()
Rcpp::StringVector BigDataStatMeth::hdf5File::getDatasetNames(std::string strgroup, std::string strprefix, std::string strsufix)Get list of dataset names.
Parameters:
strgroup(std::string): Group pathstrprefix(std::string): Prefix filterstrsufix(std::string): Suffix filter
Returns: Vector of dataset names
strgroupGroup path strprefixPrefix filter strsufixSuffix filter Vector of dataset names
4.1.10 close_file()
void BigDataStatMeth::hdf5File::close_file()Close file and cleanup resources.
Closes all open objects and the file itself. Used for emergency cleanup.
4.1.11 ~hdf5File()
BigDataStatMeth::hdf5File::~hdf5File()Destructor.
Closes the file and releases resources
5 Protected Members
5.1 Attributes
5.1.1 pfile
Type: H5::H5File *
5.1.2 filename
Type: std::string
5.1.3 path
Type: std::string
6 Private Implementation
Internal implementation details for advanced users and contributors.
6.1 Methods
6.1.1 ResFileExist_filestream()
bool BigDataStatMeth::hdf5File::ResFileExist_filestream()Check if file exists using file stream.
Returns: True if file exists and is accessible
True if file exists and is accessible
6.1.2 checkHDF5File()
bool BigDataStatMeth::hdf5File::checkHDF5File()Check if file is corrupt, open, accessible or has_valid_structure.
Returns: True if file exists and is accessible
True if file exists and is accessible
6.1.3 lockedByOtherProcess()
bool BigDataStatMeth::hdf5File::lockedByOtherProcess()Return true if existing HDF5 file appears locked/busy.
Requires HDF5 file locking enabled (env var set above).
6.1.4 isHDF5FileOpen()
bool BigDataStatMeth::hdf5File::isHDF5FileOpen()Check if HDF5 file is already open.
Returns: True if file is open
True if file is open
6.1.5 get_dataset_names_from_group()
Rcpp::StringVector BigDataStatMeth::hdf5File::get_dataset_names_from_group(std::string strgroup, std::string strprefix, std::string strsufix)Get dataset names from group.
Parameters:
strgroup(std::string): Group pathstrprefix(std::string): Prefix filterstrsufix(std::string): Suffix filter
Returns: Vector of dataset names
strgroupGroup path strprefixPrefix filter strsufixSuffix filter Vector of dataset names
6.2 Attributes
6.2.1 opentype
Type: std::string
6.2.2 fullPath
Type: std::string
6.2.3 boverwrite
Type: bool
7 Usage Example
#include "hdf5File.hpp"
// Example usage
hdf5File obj;
// Your code here