diff options
Diffstat (limited to 'c++/src/H5DataSet.cpp')
-rw-r--r-- | c++/src/H5DataSet.cpp | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 699f982..c34769e 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -85,6 +85,7 @@ DataSet::DataSet(const DataSet& original) : AbstractDs(original), H5Object(origi /// object that the dataset is located within. ///\param ref - IN: Reference pointer ///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT ///\exception H5::DataSetIException ///\par Description /// \c loc can be DataSet, Group, H5File, or named DataType, that @@ -106,6 +107,7 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co ///\param attr - IN: Specifying location where the referenced object is in ///\param ref - IN: Reference pointer ///\param ref_type - IN: Reference type - default to H5R_OBJECT +///\param plist - IN: Property list - default to PropList::DEFAULT ///\exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification @@ -294,7 +296,7 @@ void DataSet::getSpaceStatus(H5D_space_status_t& status) const ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const +hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const { // Obtain identifiers for C API hid_t type_id = type.getId(); @@ -311,6 +313,20 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const } //-------------------------------------------------------------------------- +// Function: DataSet::getVlenBufSize +///\brief This is an overloaded member function, kept for backward +/// compatibility. It differs from the above function in that it +/// misses const's. This wrapper will be removed in future release. +///\return Amount of storage +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const +{ + return(getVlenBufSize((const DataType)type, (const DataSpace)space)); +} + +//-------------------------------------------------------------------------- // Function: DataSet::vlenReclaim ///\brief Reclaims VL datatype memory buffers. ///\param type - IN: Datatype, which is the datatype stored in the buffer @@ -575,9 +591,11 @@ void DataSet::extend( const hsize_t* size ) const ///\param buf_type - IN: Datatype of the elements in buffer ///\param space - IN: Dataspace describing memory buffer & containing selection to use ///\exception H5::DataSetIException -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2014 +// Modification +// Used the non-const version. //-------------------------------------------------------------------------- -void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space) +void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const { hid_t fill_type_id = fill_type.getId(); hid_t buf_type_id = buf_type.getId(); @@ -591,16 +609,32 @@ void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataT //-------------------------------------------------------------------------- // Function: DataSet::fillMemBuf -///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it only takes the -/// the last three arguments. +///\brief This is an overloaded member function, kept for backward +/// compatibility. It differs from the above function in that it +/// misses const's. This wrapper will be removed in future release. +///\param fill - IN: Pointer to fill value to use - default NULL +///\param fill_type - IN: Datatype of the fill value ///\param buf - IN/OUT: Memory buffer to fill selection within ///\param buf_type - IN: Datatype of the elements in buffer ///\param space - IN: Dataspace describing memory buffer & containing selection to use ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) +void DataSet::fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space) +{ + fillMemBuf(fill, (const DataType)fill_type, buf, (const DataType)buf_type, (const DataSpace)space); +} + +//-------------------------------------------------------------------------- +// Function: DataSet::fillMemBuf +///\brief Fills a selection in memory with 0. +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const { hid_t buf_type_id = buf_type.getId(); hid_t space_id = space.getId(); @@ -612,6 +646,22 @@ void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) } //-------------------------------------------------------------------------- +// Function: DataSet::fillMemBuf +///\brief This is an overloaded member function, kept for backward +/// compatibility. It differs from the above function in that it +/// misses const's. This wrapper will be removed in future release. +///\param buf - IN/OUT: Memory buffer to fill selection within +///\param buf_type - IN: Datatype of the elements in buffer +///\param space - IN: Dataspace describing memory buffer & containing selection to use +///\exception H5::DataSetIException +// Programmer Binh-Minh Ribler - 2000 +//-------------------------------------------------------------------------- +void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) +{ + fillMemBuf(buf, (const DataType)buf_type, (const DataSpace)space); +} + +//-------------------------------------------------------------------------- // Function: DataSet::getId ///\brief Get the id of this dataset. ///\return DataSet identifier |