diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-08-12 08:06:35 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-08-12 08:06:35 (GMT) |
commit | b8a08e043ec8c3a37ace521314063df6f14e894a (patch) | |
tree | e3e86741e2057df18f054bf0abe2008532242daa /c++ | |
parent | 6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0 (diff) | |
download | hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.zip hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.tar.gz hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.tar.bz2 |
[svn-r30280] Purpose: Code improvement (HDFFR-9725)
Description:
- Added "const" to arguments that should be const
- Added "const" to const functions, i.e., function that don't change
the objects they operate on.
- Removed deprecated functions in previous releases due to missing const.
Merged from trunk: 30272 and 30279
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'c++')
-rw-r--r-- | c++/src/H5ArrayType.cpp | 40 | ||||
-rw-r--r-- | c++/src/H5ArrayType.h | 4 | ||||
-rw-r--r-- | c++/src/H5Attribute.cpp | 11 | ||||
-rw-r--r-- | c++/src/H5CommonFG.cpp | 36 | ||||
-rw-r--r-- | c++/src/H5CommonFG.h | 4 | ||||
-rw-r--r-- | c++/src/H5DataSet.cpp | 65 | ||||
-rw-r--r-- | c++/src/H5DataSet.h | 4 | ||||
-rw-r--r-- | c++/src/H5DataSpace.cpp | 18 | ||||
-rw-r--r-- | c++/src/H5DataSpace.h | 2 | ||||
-rw-r--r-- | c++/src/H5DataType.cpp | 22 | ||||
-rw-r--r-- | c++/src/H5DataType.h | 6 | ||||
-rw-r--r-- | c++/src/H5DcreatProp.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5DcreatProp.h | 12 | ||||
-rw-r--r-- | c++/src/H5DxferProp.cpp | 17 | ||||
-rw-r--r-- | c++/src/H5DxferProp.h | 12 | ||||
-rw-r--r-- | c++/src/H5FaccProp.cpp | 4 | ||||
-rw-r--r-- | c++/src/H5FaccProp.h | 4 | ||||
-rw-r--r-- | c++/src/H5File.cpp | 20 | ||||
-rw-r--r-- | c++/src/H5File.h | 1 | ||||
-rw-r--r-- | c++/src/H5Location.cpp | 7 | ||||
-rw-r--r-- | c++/src/H5Object.cpp | 3 | ||||
-rw-r--r-- | c++/src/H5Object.h | 2 |
22 files changed, 207 insertions, 99 deletions
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index e11227a..02596a2 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -80,10 +80,9 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) ///\param rhs - IN: Reference to the existing array datatype ///\return Reference to ArrayType instance ///\exception H5::DataTypeIException -/// std::bad_alloc // Description // Closes the id on the lhs object first with setId, then copies -// each data member from the rhs object. +// each data member from the rhs object. (Issue HDFFV-9562) // Programmer Binh-Minh Ribler - Mar 2016 // Modification //-------------------------------------------------------------------------- @@ -120,24 +119,7 @@ int ArrayType::getArrayNDims() const int ndims = H5Tget_array_ndims(id); if (ndims < 0) { - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_ndims failed"); - } - - return(ndims); -} -//---------------------------- Deprecated ---------------------------------- -// Function: ArrayType::getArrayNDims -// This non-const version of the above method is here for compatibility -// purposes and may be removed in the future. -// -BMR, Apr 2016 -//-------------------------------------------------------------------------- -int ArrayType::getArrayNDims() -{ - // Get the rank of the array type specified by id from the C API - int ndims = H5Tget_array_ndims(id); - if (ndims < 0) - { - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); } return(ndims); @@ -159,23 +141,7 @@ int ArrayType::getArrayDims(hsize_t* dims) const // Get the dimensions int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_dims2 failed"); - - // Return the number of dimensions - return(ndims); -} -//---------------------------- Deprecated ---------------------------------- -// Function: ArrayType::getArrayDims -// This non-const version of the above method is here for compatibility -// purposes and may be removed in the future. -// -BMR, Apr 2016 -//-------------------------------------------------------------------------- -int ArrayType::getArrayDims(hsize_t* dims) -{ - // Get the dimensions - int ndims = H5Tget_array_dims2(id, dims); - if (ndims < 0) - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_dims2 failed"); + throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // Return the number of dimensions return(ndims); diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index eee430e..fb6c711 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -36,11 +36,11 @@ class H5_DLLCPP ArrayType : public DataType { // Returns the number of dimensions of this array datatype. int getArrayNDims() const; - int getArrayNDims(); // deprecated + //int getArrayNDims(); // removed 1.8.18 and 1.10.1 // Returns the sizes of dimensions of this array datatype. int getArrayDims(hsize_t* dims) const; - int getArrayDims(hsize_t* dims); // deprecated + //int getArrayDims(hsize_t* dims); // removed 1.8.18 and 1.10.1 ///\brief Returns this class name. virtual H5std_string fromClass () const { return("ArrayType"); } diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 821f601..b810624 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -462,12 +462,13 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const // Programmer Binh-Minh Ribler - Nov, 2001 // Modification // Modified to call its replacement. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const -{ - return (getName(attr_name, len)); -} +//ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const +//{ +// return (getName(attr_name, len)); +//} //-------------------------------------------------------------------------- // Function: Attribute::getStorageSize diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 789abc9..9d284c3 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -500,6 +500,26 @@ void CommonFG::mount(const char* name, const H5File& child, const PropList& plis //-------------------------------------------------------------------------- // Function: CommonFG::mount +// Purpose 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 name - IN: Name of the group +// Param child - IN: File to mount +// Param plist - IN: Property list to use +// Exception H5::FileIException or H5::GroupIException +// Programmer Binh-Minh Ribler - 2000 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//void CommonFG::mount(const char* name, H5File& child, PropList& plist) const +//{ +// mount(name, child, plist); +//} + +//-------------------------------------------------------------------------- +// Function: CommonFG::mount ///\brief This is an overloaded member function, provided for convenience. /// It takes an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 @@ -512,6 +532,22 @@ void CommonFG::mount(const H5std_string& name, const H5File& child, const PropLi } //-------------------------------------------------------------------------- +// Function: CommonFG::mount +// Purpose 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. +// Programmer Binh-Minh Ribler - 2014 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//void CommonFG::mount(const H5std_string& name, H5File& child, PropList& plist) const +//{ +// mount(name.c_str(), child, plist); +//} + +//-------------------------------------------------------------------------- // Function: CommonFG::unmount ///\brief Unmounts the specified file. ///\param name - IN: Name of the file to unmount diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index d36d78c..9fee802 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -107,9 +107,9 @@ class H5_DLLCPP CommonFG { // Mounts the file 'child' onto this location. void mount(const char* name, const H5File& child, const PropList& plist) const; - void mount(const char* name, H5File& child, PropList& plist) const; // backward compatibility + //void mount(const char* name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 void mount(const H5std_string& name, const H5File& child, const PropList& plist) const; - void mount(const H5std_string& name, H5File& child, PropList& plist) const; // backward compatibility + //void mount(const H5std_string& name, H5File& child, PropList& plist) const; // removed from 1.8.18 and 1.10.1 // Unmounts the file named 'name' from this parent location. void unmount(const char* name) const; diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index b3ad708..8a42494 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -299,6 +299,8 @@ void DataSet::getSpaceStatus(H5D_space_status_t& status) const //-------------------------------------------------------------------------- // Function: DataSet::getVlenBufSize ///\brief Returns the number of bytes required to store VL data. +///\param type - IN: Datatype, which is the datatype for the buffer +///\param space - IN: Selection for the memory buffer ///\return Amount of storage ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2000 @@ -322,6 +324,24 @@ hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) c } //-------------------------------------------------------------------------- +// Function: DataSet::getVlenBufSize +// Purpose 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 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const +//{ +// return(getVlenBufSize(type, space)); +//} + +//-------------------------------------------------------------------------- // Function: DataSet::vlenReclaim ///\brief Reclaims VL datatype memory buffers. ///\param type - IN: Datatype, which is the datatype stored in the buffer @@ -588,9 +608,6 @@ void DataSet::extend( const hsize_t* size ) const ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - 2014 // Modification -// Replaced the version without const parameter - Apr, 2014 -// Modification -// Used the non-const version. //-------------------------------------------------------------------------- void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const { @@ -606,6 +623,28 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, //-------------------------------------------------------------------------- // Function: DataSet::fillMemBuf +// Purpose 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 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//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 @@ -627,6 +666,26 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s } //-------------------------------------------------------------------------- +// Function: DataSet::fillMemBuf +// Purpose 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 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//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 diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 6c483ea..dce21a5 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -39,9 +39,11 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Fills a selection in memory with a value void fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 // Fills a selection in memory with zero void fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const; + //void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // removed from 1.8.18 and 1.10.1 // Gets the creation property list of this dataset. DSetCreatPropList getCreatePlist() const; @@ -63,7 +65,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Returns the number of bytes required to store VL data. hsize_t getVlenBufSize(const DataType& type, const DataSpace& space ) const; - hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // kept for backward compatibility + //hsize_t getVlenBufSize(DataType& type, DataSpace& space) const; // removed from 1.8.18 and 1.10.1 // Reclaims VL datatype memory buffers. static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf ); diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index b8ce529..e10b841 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -341,6 +341,24 @@ void DataSpace::extentCopy (const DataSpace& dest_space) const } //-------------------------------------------------------------------------- +// Function: DataSpace::extentCopy +// Purpose This is an overloaded member function, kept for backward +// compatibility. It differs from the above function in that it +// misses const. This wrapper will be removed in future release. +// Param dest_space - IN: Dataspace to copy from +// Exception H5::DataSpaceIException +// Programmer Binh-Minh Ribler - 2000 +// Modification +// Modified to call its replacement. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//void DataSpace::extentCopy( DataSpace& dest_space ) const +//{ +// extentCopy(dest_space); +//} + +//-------------------------------------------------------------------------- // Function: DataSpace::setExtentSimple ///\brief Sets or resets the size of an existing dataspace. ///\param rank - IN: Rank of the dataspace diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index a0bd689..384f1a3 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -50,6 +50,8 @@ class H5_DLLCPP DataSpace : public IdComponent { // Copies the extent of this dataspace. void extentCopy(const DataSpace& dest_space) const; + // removed from 1.8.18 and 1.10.1 + //void extentCopy(DataSpace& dest_space) const; // Gets the bounding box containing the current selection. void getSelectBounds( hsize_t* start, hsize_t* end ) const; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index efe46de..dab5637 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -311,12 +311,13 @@ void DataType::commit(const H5Location& loc, const char* name) // Programmer Binh-Minh Ribler - Jan, 2007 // Modification // Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -void DataType::commit(H5Location& loc, const char* name) -{ - p_commit(loc.getId(), name); -} +//void DataType::commit(H5Location& loc, const char* name) +//{ +// p_commit(loc.getId(), name); +//} //-------------------------------------------------------------------------- // Function: DataType::commit @@ -341,12 +342,13 @@ void DataType::commit(const H5Location& loc, const H5std_string& name) // Programmer Binh-Minh Ribler - Jan, 2007 // Modification // Planned for removal. -BMR, 2014/04/16 -// Removed from documentation. -BMR, 2016/03/07 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 //-------------------------------------------------------------------------- -void DataType::commit(H5Location& loc, const H5std_string& name) -{ - p_commit(loc.getId(), name.c_str()); -} +//void DataType::commit(H5Location& loc, const H5std_string& name) +//{ +// p_commit(loc.getId(), name.c_str()); +//} //-------------------------------------------------------------------------- // Function: DataType::committed diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 69f59b1..7dd25ac 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -63,9 +63,9 @@ class H5_DLLCPP DataType : public H5Object { void commit(const H5Location& loc, const char* name); void commit(const H5Location& loc, const H5std_string& name); // These two overloaded functions are kept for backward compatibility - // only; they missed the const. - void commit(H5Location& loc, const char* name); - void commit(H5Location& loc, const H5std_string& name); + // only; they missed the const - removed from 1.8.18 and 1.10.1 + //void commit(H5Location& loc, const char* name); + //void commit(H5Location& loc, const H5std_string& name); // Determines whether this datatype is a named datatype or // a transient datatype. diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index b2a3e96..d362d65 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -333,7 +333,7 @@ void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5D_fill_value_t DSetCreatPropList::isFillValueDefined() +H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const { H5D_fill_value_t status; herr_t ret_value = H5Pfill_value_defined(id, &status); @@ -517,7 +517,7 @@ void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool DSetCreatPropList::allFiltersAvail() +bool DSetCreatPropList::allFiltersAvail() const { htri_t ret_value = H5Pall_filters_avail(id); if( ret_value > 0 ) @@ -565,7 +565,7 @@ void DSetCreatPropList::setShuffle() const /// \li \c H5D_ALLOC_TIME_INCR // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5D_alloc_time_t DSetCreatPropList::getAllocTime() +H5D_alloc_time_t DSetCreatPropList::getAllocTime() const { H5D_alloc_time_t alloc_time; herr_t ret_value = H5Pget_alloc_time(id, &alloc_time); @@ -589,7 +589,7 @@ H5D_alloc_time_t DSetCreatPropList::getAllocTime() /// \li \c H5D_FILL_TIME_ALLOC. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -H5D_fill_time_t DSetCreatPropList::getFillTime() +H5D_fill_time_t DSetCreatPropList::getFillTime() const { H5D_fill_time_t fill_time; herr_t ret_value = H5Pget_fill_time(id, &fill_time); @@ -615,7 +615,7 @@ H5D_fill_time_t DSetCreatPropList::getFillTime() /// \li \c H5D_ALLOC_TIME_INCR // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) +void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const { herr_t ret_value = H5Pset_alloc_time(id, alloc_time); if( ret_value < 0 ) @@ -636,7 +636,7 @@ void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) /// \li \c H5D_FILL_TIME_ALLOC. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) +void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const { herr_t ret_value = H5Pset_fill_time(id, fill_time); if( ret_value < 0 ) diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 51347e8..fed41b4 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -38,13 +38,13 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { // Queries whether all the filters set in this property list are // available currently. - bool allFiltersAvail(); + bool allFiltersAvail() const; // Get space allocation time for this property. - H5D_alloc_time_t getAllocTime(); + H5D_alloc_time_t getAllocTime() const; // Set space allocation time for dataset during creation. - void setAllocTime(H5D_alloc_time_t alloc_time); + void setAllocTime(H5D_alloc_time_t alloc_time) const; // Retrieves the size of the chunks used to store a chunked layout dataset. int getChunk( int max_ndims, hsize_t* dim ) const; @@ -59,10 +59,10 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { int getExternalCount() const; // Gets fill value writing time. - H5D_fill_time_t getFillTime(); + H5D_fill_time_t getFillTime() const; // Sets fill value writing time for dataset. - void setFillTime(H5D_fill_time_t fill_time); + void setFillTime(H5D_fill_time_t fill_time) const; // Retrieves a dataset fill value. void getFillValue( const DataType& fvalue_type, void* value ) const; @@ -88,7 +88,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { int getNfilters() const; // Checks if fill value has been defined for this property. - H5D_fill_value_t isFillValueDefined(); + H5D_fill_value_t isFillValueDefined() const; // Modifies the specified filter. void modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const; diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 21d8ff2..74db9ef 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -145,13 +145,12 @@ void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getBuffer ///\brief Reads buffer settings. -///\param tconv - IN: Pointer to application-allocated type conversion buffer -///\param bkg - IN: Pointer to application-allocated background buffer +///\param tconv - OUT: Pointer to application-allocated type conversion buf +///\param bkg - OUT: Pointer to application-allocated background buffer ///\return Buffer size, in bytes ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- - size_t DSetMemXferPropList::getBuffer( void** tconv, void** bkg ) const { size_t buffer_size = H5Pget_buffer( id, tconv, bkg ); @@ -444,7 +443,7 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) +void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const { herr_t ret_value = H5Pset_small_data_block_size(id, size); if (ret_value < 0) @@ -461,7 +460,7 @@ void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -hsize_t DSetMemXferPropList::getSmallDataBlockSize() +hsize_t DSetMemXferPropList::getSmallDataBlockSize() const { hsize_t size; herr_t ret_value = H5Pget_small_data_block_size(id, &size); @@ -484,7 +483,7 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) +void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const { herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size); if (ret_value < 0) @@ -502,7 +501,7 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -size_t DSetMemXferPropList::getHyperVectorSize() +size_t DSetMemXferPropList::getHyperVectorSize() const { size_t vector_size; herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size); @@ -532,7 +531,7 @@ size_t DSetMemXferPropList::getHyperVectorSize() /// \li \c H5Z_DISABLE_EDC // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) +void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const { herr_t ret_value = H5Pset_edc_check(id, check); if (ret_value < 0) @@ -549,7 +548,7 @@ void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -H5Z_EDC_t DSetMemXferPropList::getEDCCheck() +H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const { H5Z_EDC_t check = H5Pget_edc_check(id); if (check < 0) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 52a9a48..31fc372 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -86,24 +86,24 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { H5MM_free_t& free, void** free_info ) const; // Sets the size of a contiguous block reserved for small data. - void setSmallDataBlockSize(hsize_t size); + void setSmallDataBlockSize(hsize_t size) const; // Returns the current small data block size setting. - hsize_t getSmallDataBlockSize(); + hsize_t getSmallDataBlockSize() const; // Sets number of I/O vectors to be read/written in hyperslab I/O. - void setHyperVectorSize(size_t vector_size); + void setHyperVectorSize(size_t vector_size) const; // Returns the number of I/O vectors to be read/written in // hyperslab I/O. - size_t getHyperVectorSize(); + size_t getHyperVectorSize() const; // Enables or disables error-detecting for a dataset reading // process. - void setEDCCheck(H5Z_EDC_t check); + void setEDCCheck(H5Z_EDC_t check) const; // Determines whether error-detection is enabled for dataset reads. - H5Z_EDC_t getEDCCheck(); + H5Z_EDC_t getEDCCheck() const; ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DSetMemXferPropList"); } diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 52896e9..1b05b02 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -617,7 +617,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) +void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const { herr_t ret_value = H5Pset_fclose_degree(id, degree); if( ret_value < 0 ) @@ -633,7 +633,7 @@ void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- -H5F_close_degree_t FileAccPropList::getFcloseDegree() +H5F_close_degree_t FileAccPropList::getFcloseDegree() const { H5F_close_degree_t degree; herr_t ret_value = H5Pget_fclose_degree(id, °ree); diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index ce2dc91..831488c 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -112,10 +112,10 @@ class H5_DLLCPP FileAccPropList : public PropList { void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const; // Sets the degree for the file close behavior. - void setFcloseDegree(H5F_close_degree_t degree); + void setFcloseDegree(H5F_close_degree_t degree) const; // Returns the degree for the file close behavior. - H5F_close_degree_t getFcloseDegree(); + H5F_close_degree_t getFcloseDegree() const; // Sets garbage collecting references flag. void setGcReferences( unsigned gc_ref = 0 ) const; diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 227e1c5..1b13af0 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -469,6 +469,26 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const //-------------------------------------------------------------------------- // Function: H5File::getVFDHandle +// Purpose 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 fapl - File access property list +// Param file_handle - Pointer to the file handle being used by +// the low-level virtual file driver +// Exception H5::FileIException +// Programmer Binh-Minh Ribler - May 2004 +// Modification +// Planned for removal. -BMR, 2014/04/16 +// Removed from documentation. -BMR, 2016/03/07 1.8.17 and 1.10.0 +// Removed from code. -BMR, 2016/08/11 1.8.18 and 1.10.1 +//-------------------------------------------------------------------------- +//void H5File::getVFDHandle(FileAccPropList& fapl, void **file_handle) const +//{ +// getVFDHandle((const FileAccPropList)fapl, file_handle); +//} + +//-------------------------------------------------------------------------- +// Function: H5File::getVFDHandle ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function only in what arguments it /// accepts. diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 49ab190..7f271da 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -68,6 +68,7 @@ class H5_DLLCPP H5File : public H5Location, public CommonFG { // Returns the pointer to the file handle of the low-level file driver. void getVFDHandle(void **file_handle) const; void getVFDHandle(const FileAccPropList& fapl, void **file_handle) const; + //void getVFDHandle(FileAccPropList& fapl, void **file_handle) const; // removed from 1.8.18 and 1.10.1 // Determines if a file, specified by its name, is in HDF5 format static bool isHdf5(const char* name ); diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 062d5ec..0195fb8 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -74,8 +74,9 @@ H5Location::H5Location() : IdComponent() {} // been moved to the sub-classes. It will be removed in 1.10 release. If its // removal does not raise any problems in 1.10, it will be removed from 1.8 in // subsequent releases. +// Removed in 1.10.1 - Aug 2016 //-------------------------------------------------------------------------- -H5Location::H5Location(const hid_t object_id) : IdComponent() {} +// H5Location::H5Location(const hid_t object_id) : IdComponent() {} //-------------------------------------------------------------------------- // Function: H5Location copy constructor @@ -563,8 +564,8 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const HDmemset(comment_C, 0, tmp_len+1); // clear buffer // Used overloaded function - ssize_t comment_len = getComment(name, tmp_len+1, comment_C); - if (comment_len < 0) + ssize_t temp_len = getComment(name, tmp_len+1, comment_C); + if (temp_len < 0) { delete []comment_C; throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed"); diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index 3cce9fe..f9d5abf 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -56,8 +56,9 @@ H5Object::H5Object() : H5Location() {} // been moved to the sub-classes. It will be removed in 1.10 release. If its // removal does not raise any problems in 1.10, it will be removed from 1.8 in // subsequent releases. +// Removed in 1.10.1 - Aug 2016 //-------------------------------------------------------------------------- -H5Object::H5Object(const hid_t object_id) : H5Location() {} +//H5Object::H5Object(const hid_t object_id) : H5Location() {} //-------------------------------------------------------------------------- // Function: H5Object copy constructor diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index f8ac792..193e5d1 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -48,7 +48,7 @@ class H5_DLLCPP H5Object : public H5Location { public: #ifndef DOXYGEN_SHOULD_SKIP_THIS // Gets the name of this HDF5 object, i.e., Group, DataSet, or - // DataType. + // DataType. These should have const but are retiring anyway. ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; H5std_string getObjName() const; |