![]() |
kspaceFirstOrder3D-OMP 1.0
The C++ implementation of the k-wave toolbox for the time-domain simulation of acoustic wave fields in 3D
|
Class wrapping the HDF5 routines.
#include <HDF5_File.h>

Public Types | |
| enum | THDF5_MatrixDataType { hdf5_mdt_float = 0, hdf5_mdt_long = 1 } |
| HDF5 matrix data type. | |
| enum | THDF5_MatrixDomainType { hdf5_mdt_real = 0, hdf5_mdt_complex = 1 } |
| HDF5 Matrix domain type. | |
Public Member Functions | |
| THDF5_File () | |
| Constructor. | |
| void | Create (const char *FileName, unsigned int Flags=H5F_ACC_TRUNC) |
| Create the file. | |
| void | Open (const char *FileName, unsigned int Flags=H5F_ACC_RDONLY) |
| Open the file. | |
| bool | IsOpened () const |
| void | Close () |
| Close file. | |
| hid_t | OpenDataset (const char *DatasetName) |
| Open the HDF5 dataset. | |
| hid_t | CreateFloatDataset (const char *DatasetName, const TDimensionSizes &DimensionSizes, const TDimensionSizes &ChunkSizes, const int CompressionLevel) |
| Create the HDF5 dataset. | |
| void | CloseDataset (const hid_t &HDF5_Dataset_id) |
| Close the HDF5 dataset. | |
| void | WriteCompleteDataset (const char *DatasetName, const TDimensionSizes &DimensionSizes, const float *Data) |
| Write data into a dataset. | |
| void | WriteCompleteDataset (const char *DatasetName, const TDimensionSizes &DimensionSizes, const long *Data) |
| Write data into a dataset. | |
| void | WriteHyperSlab (const hid_t HDF5_Dataset_id, const TDimensionSizes &Position, const TDimensionSizes &Size, const float *Data) |
| Write a hyper-slab into the dataset. | |
| void | WriteHyperSlab (const hid_t HDF5_Dataset_id, const TDimensionSizes &Position, const TDimensionSizes &Size, const long *Data) |
| Write a hyper-slab into the dataset. | |
| void | WriteScalarValue (const char *DatasetName, const float Value) |
| Write the scalar value. | |
| void | WriteScalarValue (const char *DatasetName, const long Value) |
| Write the scalar value. | |
| void | ReadCompleteDataset (const char *DatasetName, const TDimensionSizes &DimensionSizes, float *Data) |
| Read data from the dataset. | |
| void | ReadCompleteDataset (const char *DatasetName, const TDimensionSizes &DimensionSizes, long *Data) |
| Read data from the dataset. | |
| TDimensionSizes | GetDatasetDimensionSizes (const char *DatasetName) |
| Check dataset dimension sizes. | |
| size_t | GetDatasetElementCount (const char *DatasetName) |
| Get dataset element count. | |
| void | WriteMatrixDataType (const char *DatasetName, const THDF5_MatrixDataType &MatrixDataType) |
| Write matrix data type into the dataset. | |
| void | WriteMatrixDomainType (const char *DatasetName, const THDF5_MatrixDomainType &MatrixDomainType) |
| Write matrix domain type into the dataset. | |
| THDF5_File::THDF5_MatrixDataType | ReadMatrixDataType (const char *DatasetName) |
| Read matrix data type from the dataset. | |
| THDF5_File::THDF5_MatrixDomainType | ReadMatrixDomainType (const char *DatasetName) |
| Read matrix domain type from the dataset. | |
| void | WriteStringAttribute (const char *DatasetName, const char *AttributeName, const string &Value) |
| Write string attribute into the dataset. | |
| string | ReadStringAttribute (const char *DatasetName, const char *AttributeName) |
| Read string attribute from the dataset. | |
| virtual | ~THDF5_File () |
| Destructor. | |
Protected Member Functions | |
| THDF5_File (const THDF5_File &src) | |
| Copy constructor is not allowed for public. | |
| THDF5_File & | operator= (const THDF5_File &src) |
| Operator = is not allowed for public. | |
Private Attributes | |
| hid_t | HDF5_FileId |
| HDF file handle. | |
| string | FileName |
| File name. | |
Static Private Attributes | |
| static const char * | HDF5_MatrixDomainTypeName = "domain_type" |
| String representation of the Domain type in the HDF5 file. | |
| static const char * | HDF5_MatrixDataTypeName = "data_type" |
| String representation of the Data type in the HDF5 file. | |
| static const string | HDF5_MatrixDomainTypeNames [] = {"real","complex"} |
| String representation of different domain types. | |
| static const string | HDF5_MatrixDataTypeNames [] = {"float","long"} |
| String representation of different data types. | |
Definition at line 357 of file HDF5_File.h.
| THDF5_File::THDF5_File | ( | ) |
Constructor
Definition at line 72 of file HDF5_File.cpp.
| THDF5_File::~THDF5_File | ( | ) | [virtual] |
| void THDF5_File::Close | ( | ) |
Close the HDF5 file.
Definition at line 155 of file HDF5_File.cpp.

| void THDF5_File::CloseDataset | ( | const hid_t & | HDF5_Dataset_id | ) |
Close dataset.
| [in] | HDF5_Dataset_id |
Definition at line 275 of file HDF5_File.cpp.

| void THDF5_File::Create | ( | const char * | FileName, |
| unsigned int | Flags = H5F_ACC_TRUNC |
||
| ) |
Create the HDF5 file.
| [in] | FileName | - File name |
| [in] | Flags | - Flags for the HDF5 runtime |
| ios:failure | if error happened |
Definition at line 89 of file HDF5_File.cpp.


| hid_t THDF5_File::CreateFloatDataset | ( | const char * | DatasetName, |
| const TDimensionSizes & | DimensionSizes, | ||
| const TDimensionSizes & | ChunkSizes, | ||
| const int | CompressionLevel | ||
| ) |
Create the dataset.
| ios::failure |
| [in] | DatasetName | - Dataset name |
| [in] | DimensionSizes | - Dataset dimension sizes |
| [in] | ChunkSizes | - 3D Chunk size |
| [in] | CompressionLevel | - Compression level |
Definition at line 218 of file HDF5_File.cpp.

| TDimensionSizes THDF5_File::GetDatasetDimensionSizes | ( | const char * | DatasetName | ) |
Get dimension sizes of the dataset.
| [in] | DatasetName |
| ios::failure |
Definition at line 548 of file HDF5_File.cpp.

| size_t THDF5_File::GetDatasetElementCount | ( | const char * | DatasetName | ) |
Get number of elements of the dataset.
| [in] | DatasetName |
| ios::failure |
Definition at line 572 of file HDF5_File.cpp.

| bool THDF5_File::IsOpened | ( | ) | const [inline] |
Is the file opened?
Definition at line 385 of file HDF5_File.h.

| void THDF5_File::Open | ( | const char * | FileName, |
| unsigned int | Flags = H5F_ACC_RDONLY |
||
| ) |
Open the HDF5 file.
| [in] | FileName | |
| [in] | Flags | - flags for the HDF5 runtime |
| ios:failure | if error happened |
Definition at line 122 of file HDF5_File.cpp.


| hid_t THDF5_File::OpenDataset | ( | const char * | DatasetName | ) |
Open the dataset.
| ios::failure |
| [in] | DatasetName |
Definition at line 191 of file HDF5_File.cpp.
| void THDF5_File::ReadCompleteDataset | ( | const char * | DatasetName, |
| const TDimensionSizes & | DimensionSizes, | ||
| float * | Data | ||
| ) |
Read data from the dataset.
| [in] | DatasetName | |
| [in] | DimensionSizes | |
| [out] | Data |
| ios::failure |
Definition at line 491 of file HDF5_File.cpp.


| void THDF5_File::ReadCompleteDataset | ( | const char * | DatasetName, |
| const TDimensionSizes & | DimensionSizes, | ||
| long * | Data | ||
| ) |
Write data from the dataset.
| [in] | DatasetName | |
| [in] | DimensionSizes | |
| [out] | Data |
| ios::failure |
Definition at line 520 of file HDF5_File.cpp.

| THDF5_File::THDF5_MatrixDataType THDF5_File::ReadMatrixDataType | ( | const char * | DatasetName | ) |
Read matrix data type.
| [in] | DatasetName |
| ios::failure |
Definition at line 626 of file HDF5_File.cpp.


| THDF5_File::THDF5_MatrixDomainType THDF5_File::ReadMatrixDomainType | ( | const char * | DatasetName | ) |
Read matrix domain type.
| [in] | DatasetName |
| ios::failure |
Definition at line 652 of file HDF5_File.cpp.


| string THDF5_File::ReadStringAttribute | ( | const char * | DatasetName, |
| const char * | AttributeName | ||
| ) | [inline] |
Read integer attribute.
| [in] | DatasetName | |
| [in] | AttributeName |
| ios::failure |
Definition at line 705 of file HDF5_File.cpp.

| void THDF5_File::WriteCompleteDataset | ( | const char * | DatasetName, |
| const TDimensionSizes & | DimensionSizes, | ||
| const float * | Data | ||
| ) |
Write data into a dataset.
| [in] | DatasetName | |
| [in] | DimensionSizes | |
| [in] | Data |
| ios::failure |
Definition at line 293 of file HDF5_File.cpp.

| void THDF5_File::WriteCompleteDataset | ( | const char * | DatasetName, |
| const TDimensionSizes & | DimensionSizes, | ||
| const long * | Data | ||
| ) |
Write data into a dataset.
| [in] | DatasetName | |
| [in] | DimensionSizes | |
| [in] | Data |
| ios::failure |
Definition at line 320 of file HDF5_File.cpp.
| void THDF5_File::WriteHyperSlab | ( | const hid_t | HDF5_Dataset_id, |
| const TDimensionSizes & | Position, | ||
| const TDimensionSizes & | Size, | ||
| const long * | Data | ||
| ) |
Write hyperslab.
| [in] | HDF5_Dataset_id | - Dataset id |
| [in] | Position | - Position in the dataset |
| [in] | Size | - Size of the hyperslab |
| [in] | Data |
| ios::failure |
Definition at line 403 of file HDF5_File.cpp.
| void THDF5_File::WriteHyperSlab | ( | const hid_t | HDF5_Dataset_id, |
| const TDimensionSizes & | Position, | ||
| const TDimensionSizes & | Size, | ||
| const float * | Data | ||
| ) |
Write a hyperslab into the dataset.
| [in] | HDF5_Dataset_id | - Dataset id |
| [in] | Position | - Position in the dataset |
| [in] | Size | - Size of the hyperslab |
| [in] | Data |
| ios::failure |
Definition at line 349 of file HDF5_File.cpp.

| void THDF5_File::WriteMatrixDataType | ( | const char * | DatasetName, |
| const THDF5_MatrixDataType & | MatrixDataType | ||
| ) |
Write matrix data type into the dataset.
| [in] | DatasetName | |
| [in] | MatrixDataType |
Definition at line 597 of file HDF5_File.cpp.


| void THDF5_File::WriteMatrixDomainType | ( | const char * | DatasetName, |
| const THDF5_MatrixDomainType & | MatrixDomainType | ||
| ) |
Write matrix data type into the dataset.
| [in] | DatasetName | |
| [in] | MatrixDomainType |
Definition at line 611 of file HDF5_File.cpp.


| void THDF5_File::WriteScalarValue | ( | const char * | DatasetName, |
| const long | Value | ||
| ) |
Write a scalar value.
| [in] | DatasetName | |
| [in] | Value |
Definition at line 471 of file HDF5_File.cpp.

| void THDF5_File::WriteScalarValue | ( | const char * | DatasetName, |
| const float | Value | ||
| ) |
Write a scalar value into the file.
| [in] | DatasetName | |
| [in] | Value |
Definition at line 455 of file HDF5_File.cpp.


| void THDF5_File::WriteStringAttribute | ( | const char * | DatasetName, |
| const char * | AttributeName, | ||
| const string & | Value | ||
| ) | [inline] |
Write integer attribute.
| [in] | DatasetName | |
| [in] | AttributeName | |
| [in] | Value |
| ios::failure |
Definition at line 681 of file HDF5_File.cpp.

1.7.4