diff options
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5DataSet.cpp | 35 | ||||
-rw-r--r-- | c++/src/H5DataSet.h | 6 |
2 files changed, 41 insertions, 0 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 950f28c..c8171b9 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -136,6 +136,41 @@ hsize_t DataSet::getStorageSize() const } //-------------------------------------------------------------------------- +// Function: DataSet::getOffset +///\brief Returns the address of this dataset in the file. +///\return Address of dataset +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +haddr_t DataSet::getOffset() const +{ + haddr_t ds_addr; // for address of dataset + + ds_addr = H5Dget_offset(id); + if( ds_addr == HADDR_UNDEF ) + { + throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF"); + } + return(ds_addr); +} + +//-------------------------------------------------------------------------- +// Function: DataSet::getSpaceStatus +///\brief Determines whether space has been allocated for a dataset. +///\param status - OUT: Space allocation status +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DataSet::getSpaceStatus(H5D_space_status_t& status) const +{ + herr_t ret_value = H5Dget_space_status(id, &status); + if( ret_value < 0 ) + { + throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed"); + } +} + +//-------------------------------------------------------------------------- // Function: DataSet::getVlenBufSize ///\brief Returns the number of bytes required to store VL data. ///\return Amount of storage diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 9f01eb4..e97a963 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -33,6 +33,12 @@ class H5_DLLCPP DataSet : public AbstractDs { // Gets the storage size of this dataset. hsize_t getStorageSize() const; + // Returns the address of this dataset in the file. + haddr_t getOffset() const; + + // Determines whether space has been allocated for a dataset. + void getSpaceStatus(H5D_space_status_t& status) const; + // not yet implemented?? hsize_t getVlenBufSize( DataType& type, DataSpace& space ) const; void vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList& xfer_plist, void* buf ) const; |