summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-26 23:33:55 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2004-05-26 23:33:55 (GMT)
commit23de8877a3025bb2f8751b312dfe5751b8b91074 (patch)
tree41cbd77849c975e430c0654fd0ec474e217b3774
parent76336666db77295a2c1b918e4b2769ac557567be (diff)
downloadhdf5-23de8877a3025bb2f8751b312dfe5751b8b91074.zip
hdf5-23de8877a3025bb2f8751b312dfe5751b8b91074.tar.gz
hdf5-23de8877a3025bb2f8751b312dfe5751b8b91074.tar.bz2
[svn-r8587] Purpose:
Add C++ wrappers - incrementally check-in Description Added wrapper for these C APIs: H5Dget_offset H5Dget_space_status Platforms: SunOS 5.7 (arabica) Linux 2.4 (eirene) Misc. update:
-rw-r--r--c++/src/H5DataSet.cpp35
-rw-r--r--c++/src/H5DataSet.h6
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;