diff options
Diffstat (limited to 'c++/src')
47 files changed, 405 insertions, 260 deletions
diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index eaa9d14..f0859c8 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -91,6 +91,8 @@ class H5_DLLCPP AbstractDs { private: // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; -}; -} + +}; // end of AbstractDs +} // namespace H5 + #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 3cdcc0a..c8bd0fc 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -77,11 +77,12 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) // Function: ArrayType overloaded constructor ///\brief Creates an ArrayType instance by opening an HDF5 array datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Array type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -94,12 +95,13 @@ ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType() //-------------------------------------------------------------------------- // Function: ArrayType overloaded constructor ///\brief Creates an ArrayType instance by opening an HDF5 array datatype -/// given its name, provided as an \c H5std_string. +/// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Array type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 15b6bb3..dd9db51 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -60,6 +60,8 @@ class H5_DLLCPP ArrayType : public DataType { // Default constructor ArrayType(); -}; -} + +}; // end of ArrayType +} // namespace H5 + #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index a1e0262..f4c70fd 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -78,6 +78,8 @@ class H5_DLLCPP AtomType : public DataType { // Constructor that takes an existing id AtomType(const hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of AtomType +} // namespace H5 + #endif // __H5AtomType_H diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 0243cd9..6d6df2c 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -101,6 +101,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // Friend function to set Attribute id. For library use only. friend void f_Attribute_setId(Attribute* attr, hid_t new_id); -}; -} +}; // end of Attribute +} // namespace H5 + #endif // __H5Attribute_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5c01055..f3390aa 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -381,4 +381,4 @@ void f_DataSet_setId(DataSet* dset, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS -} +} // end namespace diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 588d49a..0c7b799 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -84,10 +84,8 @@ class H5_DLLCPP CommonFG { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; // end of CommonFG declaration +}; // end of CommonFG +} // namespace H5 -#ifndef H5_NO_NAMESPACE -} -#endif #endif // __CommonFG_H diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 037527f..7db2cfe 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -91,11 +91,12 @@ CompType::CompType(const DataSet& dataset) : DataType() // Function: CompType overloaded constructor ///\brief Creates an CompType instance by opening an HDF5 compound /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Compound type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openCompType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -109,11 +110,12 @@ CompType::CompType(const H5Location& loc, const char *dtype_name) : DataType() // Function: CompType overloaded constructor ///\brief Creates an CompType instance by opening an HDF5 compound /// datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Compound type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openCompType(const H5Location&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 222044d..042b59f 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -115,6 +115,8 @@ class H5_DLLCPP CompType : public DataType { // Contains common code that is used by the member functions // getMemberXxxType hid_t p_get_member_type(unsigned member_num) const; -}; -} + +}; // end of CompType +} // namespace H5 + #endif // __H5CompType_H diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 93f9782..f9e29ff 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -130,6 +130,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Friend function to set DataSet id. For library use only. friend void f_DataSet_setId(DataSet* dset, hid_t new_id); -}; -} +}; // end of DataSet +} // namespace H5 + #endif // __H5DataSet_H diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 969e146..281e865 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -149,6 +149,8 @@ class H5_DLLCPP DataSpace : public IdComponent { friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DataSpace +} // namespace H5 + #endif // __H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 1cfc259..2795485 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -109,13 +109,13 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, //-------------------------------------------------------------------------- // Function: DataType overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a -/// DataType object -///\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 +// brief Given a reference, ref, to an hdf5 group, creates a +// DataType object +// 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 // Jul, 2008 @@ -162,11 +162,12 @@ DataType::DataType(const PredType& pred_type) : H5Object() // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given /// its name as a char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openDataType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -180,11 +181,12 @@ DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object() // Function: DataType overloaded constructor ///\brief Creates a DataType instance by opening an HDF5 datatype given /// its name as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openDataType(const H5std_string&) to // improve usability. // -BMR, Dec 2016 @@ -300,27 +302,6 @@ bool DataType::operator==(const DataType& compared_type) const } //-------------------------------------------------------------------------- -// Function: DataType::p_opentype (private) -///\brief Opens an HDF5 datatype given its name -///\param dtype_name - IN: Datatype name -///\exception H5::DataTypeIException -// Programmer Binh-Minh Ribler - Dec 2016 -// Description -// This function was introduced in 1.10.1 to be used by the new -// XxxType constructors that were introduced to replace the -// existing functions CommonFG::openXxxType(), which is awkward -// to use. -BMR, Dec 2016 -//-------------------------------------------------------------------------- -hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const -{ - // Call C function to open the named datatype at this location - hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); - if (ret_value < 0) - throw DataTypeIException("DataType constructor", "H5Topen2 failed"); - return(ret_value); -} - -//-------------------------------------------------------------------------- // Function: DataType::p_commit (private) //\brief Commits a transient datatype to a file, creating a new // named datatype @@ -787,6 +768,26 @@ hid_t DataType::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- +// Function: DataType::p_opentype (private) +///\brief Opens an HDF5 datatype given its name +///\param loc - IN: Location of the type +///\param dtype_name - IN: Datatype name +///\exception H5::DataTypeIException +// Programmer Binh-Minh Ribler - Dec 2016 +// Description +// This function was introduced in 1.10.1 to be used by the new +// XxxType constructors that open a datatype. -BMR, Dec 2016 +//-------------------------------------------------------------------------- +hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const +{ + // Call C function to open the named datatype at this location + hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); + if (ret_value < 0) + throw DataTypeIException("DataType constructor", "H5Topen2 failed"); + return(ret_value); +} + +//-------------------------------------------------------------------------- // Function: DataType::p_setId ///\brief Sets the identifier of this object to a new value. /// @@ -861,4 +862,5 @@ DataType::~DataType() cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } + } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 6501bb9..c2ea2a3 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -155,6 +155,8 @@ class H5_DLLCPP DataType : public H5Object { friend void f_DataType_setId(DataType* dtype, hid_t new_id); void p_commit(hid_t loc_id, const char* name); -}; -} + +}; // end of DataType +} // namespace H5 + #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index e1be3c4..966ca16 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -744,13 +744,13 @@ void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, // Function: DSetCreatPropList::setVirtual ///\brief Maps elements of a virtual dataset to elements of the source /// dataset. -///\param vspace - IN: Dataspace the virtual dataset, possibly an +///\param vspace - IN: Dataspace the virtual dataset, possibly an /// unlimited selection -///\param src_fname - IN: Name of the HDF5 file where the source dataset +///\param src_fname - IN: Name of the HDF5 file where the source dataset /// is located (\a char*) -///\param src_fname - IN: Path to the dataset in the file specified by +///\param src_dsname - IN: Path to the dataset in the file specified by /// \a src_file_name (\a char*) -///\param sspace - IN: Dataspace with a selection applied, possibly +///\param sspace - IN: Dataspace with a selection applied, possibly /// an unlimited selection ///\exception H5::PropListIException ///\par Description @@ -771,13 +771,13 @@ void DSetCreatPropList::setVirtual(const DataSpace& vspace, const char *src_fnam // Function: DSetCreatPropList::setVirtual ///\brief Maps elements of a virtual dataset to elements of the source /// dataset. -///\param vspace - IN: Dataspace the virtual dataset, possibly an +///\param vspace - IN: Dataspace the virtual dataset, possibly an /// unlimited selection -///\param src_fname - IN: Name of the HDF5 file where the source dataset +///\param src_fname - IN: Name of the HDF5 file where the source dataset /// is located (\a H5std_string) -///\param src_fname - IN: Path to the dataset in the file specified by +///\param src_dsname - IN: Path to the dataset in the file specified by /// \a src_file_name (\a H5std_string) -///\param sspace - IN: Dataspace with a selection applied, possibly +///\param sspace - IN: Dataspace with a selection applied, possibly /// an unlimited selection ///\exception H5::PropListIException ///\par Description diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 5371e03..f0475eb 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -146,6 +146,8 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { static DSetCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetCreatPropList +} // namespace H5 + #endif // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index f1c363f..39d3ba8 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -127,6 +127,8 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static DSetMemXferPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetMemXferPropList +} // namespace H5 + #endif // __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 49f60e6..9072aab 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -114,10 +114,11 @@ EnumType::EnumType(const IntType& data_type) : DataType() ///\brief Creates an EnumType instance by opening an HDF5 enum datatype /// given its name, provided as a C character string. ///\param dtype_name - IN: Enum datatype name +///\param loc - IN: Location of the type ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openEnumType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -131,11 +132,12 @@ EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType() // Function: EnumType overloaded constructor ///\brief Creates an EnumType instance by opening an HDF5 enum datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Enum datatype name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openEnumType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 2fbe2cd..cd93eb5 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -78,6 +78,8 @@ class H5_DLLCPP EnumType : public DataType { EnumType(const EnumType& original); virtual ~EnumType(); -}; -} + +}; // end of EnumType +} // namespace H5 + #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 1f85711..2e68cf0 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -174,8 +174,8 @@ class H5_DLLCPP IdComponentException : public Exception { IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); IdComponentException(); virtual ~IdComponentException() throw(); -}; -} +}; // end of IdComponentException +} // namespace H5 #endif // __H5Exception_H diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 586dcf8..8e488e5 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -162,6 +162,7 @@ class H5_DLLCPP FileAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileAccPropList +} // namespace H5 + #endif // __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index ea69049..b3e6b7b 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -294,12 +294,12 @@ unsigned FileCreatPropList::getIstorek() const return(ik); } -#ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- -// Function: FileCreatPropList::setFileSpace +// Function: FileCreatPropList::setFileSpaceStrategy ///\brief Sets the strategy and the threshold value that the library /// will employ in managing file space. -///\param strategy - IN: Strategy for file space management +///\param strategy - IN: Strategy for file space management +///\param persist - IN: Whether to persist free-space ///\param threshold - IN: Free-space section threshold. The library /// default is 1, which is to track all free-space sections. ///\exception H5::PropListIException @@ -308,64 +308,76 @@ unsigned FileCreatPropList::getIstorek() const /// changed and the existing strategy will be retained. /// If the given threshold value is zero, the property will not be /// changed and the existing threshold will be retained. -/// Valid values of \a libver_low are as follows: -/// \li \c H5F_FILE_SPACE_ALL (Default) -/// \li \c H5F_FILE_SPACE_ALL_PERSIST -/// \li \c H5F_FILE_SPACE_AGGR_VFD -/// \li \c H5F_FILE_SPACE_VFD /// For information, please see the C layer Reference Manual at: /// https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFileSpace // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -void FileCreatPropList::setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const +void FileCreatPropList::setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const { - herr_t ret_value = H5Pset_file_space(id, strategy, threshold); + herr_t ret_value = H5Pset_file_space_strategy(id, strategy, persist, threshold); if (ret_value < 0) { - throw PropListIException("FileCreatPropList::setFileSpace", - "H5Pset_file_space failed"); + throw PropListIException("FileCreatPropList::setFileSpaceStrategy", + "H5Pset_file_space_strategy failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getFileSpaceStrategy -///\brief Returns the strategy that the library uses in managing file space. -///\return The strategy value +///\brief Retrieves the strategy, persist, and threshold that the library +/// uses in managing file space. +///\param strategy - OUT: Strategy for file space management +///\param persist - OUT: Whether to persist free-space +///\param threshold - OUT: Free-space section threshold ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -H5F_file_space_type_t FileCreatPropList::getFileSpaceStrategy() const +void FileCreatPropList::getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const { - H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL; - herr_t ret_value = H5Pget_file_space(id, &strategy, NULL); + herr_t ret_value = H5Pget_file_space_strategy(id, &strategy, &persist, &threshold); if (ret_value < 0) { throw PropListIException("FileCreatPropList::getFileSpaceStrategy", - "H5Pget_file_space for strategy failed"); + "H5Pget_file_space_strategy failed"); } - return(strategy); } //-------------------------------------------------------------------------- -// Function: FileCreatPropList::getFileSpaceThreshold -///\brief Returns the threshold value that the library uses in tracking -/// free space sections. -///\return The threshold value +// Function: FileCreatPropList::setFileSpacePagesize +///\brief Sets the file space page size for paged aggregation. +///\param fsp_psize - IN: Filespace's page size ///\exception H5::PropListIException // Programmer Binh-Minh Ribler - Feb, 2017 //-------------------------------------------------------------------------- -hsize_t FileCreatPropList::getFileSpaceThreshold() const +void FileCreatPropList::setFileSpacePagesize(hsize_t fsp_psize) const { - hsize_t threshold = 0; - herr_t ret_value = H5Pget_file_space(id, NULL, &threshold); + herr_t ret_value = H5Pset_file_space_page_size(id, fsp_psize); if (ret_value < 0) { - throw PropListIException("FileCreatPropList::getFileSpaceThreshold", - "H5Pget_file_space for threshold failed"); + throw PropListIException("FileCreatPropList::setFileSpacePagesize", + "H5Pset_file_space_page_size failed"); } - return(threshold); } -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + +//-------------------------------------------------------------------------- +// Function: FileCreatPropList::getFileSpacePagesize +///\brief Returns the file space page size for aggregating small +/// metadata or raw data. +///\return File space page size +///\exception H5::PropListIException +// Programmer Binh-Minh Ribler - Feb, 2017 +//-------------------------------------------------------------------------- +hsize_t FileCreatPropList::getFileSpacePagesize() const +{ + hsize_t fsp_psize = 0; + herr_t ret_value = H5Pget_file_space_page_size(id, &fsp_psize); + if (ret_value < 0) + { + throw PropListIException("FileCreatPropList::getFileSpacePagesize", + "H5Pget_file_space_page_size failed"); + } + return(fsp_psize); +} //-------------------------------------------------------------------------- // Function: FileCreatPropList destructor diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 1d999cb..6beac02 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -65,18 +65,19 @@ class H5_DLLCPP FileCreatPropList : public PropList { // indexing chunked datasets. void setIstorek(unsigned ik) const; -#ifndef H5_NO_DEPRECATED_SYMBOLS // Sets the strategy and the threshold value that the library will // will employ in managing file space. - void setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const; + void setFileSpaceStrategy(H5F_fspace_strategy_t strategy, hbool_t persist, hsize_t threshold) const; // Returns the strategy that the library uses in managing file space. - H5F_file_space_type_t getFileSpaceStrategy() const; + void getFileSpaceStrategy(H5F_fspace_strategy_t& strategy, hbool_t& persist, hsize_t& threshold) const; + + // Sets the file space page size for paged aggregation. + void setFileSpacePagesize(hsize_t fsp_psize) const; // Returns the threshold value that the library uses in tracking free // space sections. - hsize_t getFileSpaceThreshold() const; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + hsize_t getFileSpacePagesize() const; ///\brief Returns this class name. virtual H5std_string fromClass() const { return("FileCreatPropList"); } @@ -104,6 +105,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileCreatPropList +} // namespace H5 + #endif // __H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index cdb5837..bea4612 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -45,7 +45,7 @@ namespace H5 { using std::endl; //-------------------------------------------------------------------------- -// Function H5File default constructor +// Function H5File default constructor ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -64,30 +64,30 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} ///\par Description /// Valid values of \a flags include: /// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. +/// erasing all data previously stored in +/// the file. /// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive /// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise /// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name, flags, create_plist, access_plist); + p_get_file(name, flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -102,17 +102,17 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name.c_str(), flags, create_plist, access_plist); + p_get_file(name.c_str(), flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -131,23 +131,23 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // create the file. if (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate(name, flags, create_plist_id, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate(name, flags, create_plist_id, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen(name, flags, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen(name, flags, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } @@ -157,7 +157,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro ///\param existing_id - IN: Id of an existing file // Programmer Binh-Minh Ribler - 2015 // Description -// Mar 29, 2015 +// Mar 29, 2015 // Added in responding to a request from user Jason Newton. // However, it is not recommended to use the private member "id" // in applications. Unlike other situations, where similar @@ -230,9 +230,9 @@ bool H5File::isHdf5(const H5std_string& name) ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// /// H5F_ACC_RDONLY: Open with read only access. - default /// @@ -251,7 +251,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis id = H5Fopen (name, flags, access_plist_id); if (id < 0) // throw an exception when open fails { - throw FileIException("H5File::openFile", "H5Fopen failed"); + throw FileIException("H5File::openFile", "H5Fopen failed"); } } @@ -397,14 +397,14 @@ hssize_t H5File::getFreeSpace() const ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -425,19 +425,19 @@ ssize_t H5File::getObjCount(unsigned types) const /// groups and datatypes) in the same file. ///\param types - Type of object to retrieve the count ///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. +/// into obj_id_list. ///\param oid_list - List of open object identifiers ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -459,7 +459,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const /// driver. ///\param fapl - File access property list ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException ///\par Description /// For the \c FAMILY or \c MULTI drivers, \a fapl should be @@ -487,10 +487,10 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const // 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 +// 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 @@ -508,7 +508,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const /// It differs from the above function only in what arguments it /// accepts. ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- @@ -547,7 +547,7 @@ hsize_t H5File::getFileSize() const ///\brief Get the id of this file ///\return File identifier // Modification -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -562,8 +562,8 @@ hid_t H5File::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5File::reopen -// Purpose Reopens this file. -// Exception H5::FileIException +// Purpose Reopens this file. +// Exception H5::FileIException // Description // This function is replaced by the above function reOpen. // Programmer Binh-Minh Ribler - 2000 @@ -575,14 +575,15 @@ void H5File::reopen() //-------------------------------------------------------------------------- // Function: H5File::getLocId -// Purpose Get the id of this file +// Purpose Get the id of this file // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Programmer Binh-Minh Ribler - 2000 // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { @@ -626,13 +627,13 @@ void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose(id); - if (ret_value < 0) - { - throw FileIException("H5File::close", "H5Fclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Fclose(id); + if (ret_value < 0) + { + throw FileIException("H5File::close", "H5Fclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -643,7 +644,7 @@ void H5File::close() ///\param msg - Message describing the failure ///\exception H5::FileIException // Description -// This function is also used in H5Location implementation so that +// This function is also used in H5Location implementation so that // proper exception can be thrown for file or group. The // "H5File::" will be inserted to indicate the function called is // an implementation of H5File. @@ -669,9 +670,9 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m H5File::~H5File() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; + cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 5ac9118..df5cca6 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -17,7 +17,6 @@ #ifndef __H5File_H #define __H5File_H - namespace H5 { /*! \class H5File @@ -123,7 +122,8 @@ class H5_DLLCPP H5File : public Group { // constructors taking a string or a char* void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); -}; -} +}; // end of H5File +} // namespace H5 + #endif // __H5File_H diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 5902cbe..f573add 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -95,11 +95,12 @@ FloatType::FloatType(const DataSet& dataset) : AtomType() // Function: FloatType overloaded constructor ///\brief Creates an FloatType instance by opening an HDF5 float datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Float type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openFloatType(const char*) // to improve usability. // -BMR, Dec 2016 @@ -113,11 +114,12 @@ FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: FloatType overloaded constructor ///\brief Creates an FloatType instance by opening an HDF5 float datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Float type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openFloatType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 2c925de..8affa1a 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -75,6 +75,8 @@ class H5_DLLCPP FloatType : public AtomType { // Noop destructor. virtual ~FloatType(); -}; -} + +}; // end of FloatType +} // namespace H5 + #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 6e5cdaa..66e2339 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -66,6 +66,9 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id) //-------------------------------------------------------------------------- // Function: Group::getObjId ///\brief Opens an object via object header. +///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object ///\exception H5::FileIException or H5::GroupIException ///\par Description /// This function opens an object in a group or file, using @@ -88,6 +91,8 @@ hid_t Group::getObjId(const char* obj_name, const PropList& plist) const ///\brief This is an overloaded member function, provided for convenience. /// It takes a reference to a \c H5std_string for the object's name. ///\param obj_name - IN: Path to the object +///\param plist - IN: Access property list for the link pointing to +/// the object ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - March, 2017 //-------------------------------------------------------------------------- @@ -113,14 +118,15 @@ void Group::closeObjId(hid_t obj_id) const //-------------------------------------------------------------------------- // Function: Group::getLocId -// Purpose: Get the id of this group +// Purpose: Get the id of this group // Programmer Binh-Minh Ribler - 2000 // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t Group::getLocId() const { @@ -158,15 +164,19 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const //-------------------------------------------------------------------------- // Function: Group overload constructor - dereference -///\brief Given a reference, ref, to an hdf5 group, creates a Group object -///\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 +// brief Given a reference, ref, to an hdf5 group, creates a Group objec +// param attr - IN: Specifying location where the referenced object is i +// 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 +// Mar, 2017 +// Removed in 1.10.1 because H5Location is Attribute's baseclass +// now. -BMR //-------------------------------------------------------------------------- - /* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) +/* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID) { id = H5Location::p_dereference(attr.getId(), ref, ref_type, plist, "constructor - by dereference"); } @@ -227,13 +237,13 @@ void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose(id); - if (ret_value < 0) - { - throwException("Group::close", "H5Gclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Gclose(id); + if (ret_value < 0) + { + throwException("Group::close", "H5Gclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -270,10 +280,10 @@ void Group::throwException(const H5std_string& func_name, const H5std_string& ms Group::~Group() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; + cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 3118aa7..c8b2961 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -52,6 +52,7 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Creates a group by way of dereference. Group(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Removed in 1.10.1, because H5Location is baseclass // Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // Opens an object within a group or a file, i.e., root group. @@ -84,7 +85,8 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { private: hid_t id; // HDF5 group id -}; -} +}; // end of Group +} // namespace H5 + #endif // __Group_H diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 0bcc67a..122479f 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -24,6 +24,7 @@ namespace H5 { +#ifndef DOXYGEN_SHOULD_SKIP_THIS // This flag indicates whether H5Library::initH5cpp has been called to register // the terminating functions with atexit() bool IdComponent::H5cppinit = false; @@ -32,6 +33,7 @@ bool IdComponent::H5cppinit = false; // Subclasses that have global constants use it. This is a temporary // work-around in 1.8.16. It will be removed after HDFFV-9540 is fixed. bool IdComponent::H5dontAtexit_called = false; +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: IdComponent::incRefCount @@ -165,7 +167,7 @@ H5I_type_t IdComponent::getHDFObjType() const // Function: getNumMembers (static) ///\brief Returns the number of members of the given type. ///\return Number of members -///\Description +///\par Description /// If there is no member of the given type, getNumMembers will /// return 0. Valid types are: /// \li \c H5I_FILE (= 1) @@ -197,9 +199,9 @@ hsize_t IdComponent::getNumMembers(H5I_type_t type) // Function: isValid (static) ///\brief Checks if the given ID is valid. ///\return true if the given identifier is valid, and false, otherwise. -///\Description +///\par Description /// A valid ID is one that is in use and has an application -/// reference count of at least 1. +/// reference count of at least 1. // Programmer Binh-Minh Ribler - Mar 1, 2017 //-------------------------------------------------------------------------- bool IdComponent::isValid(hid_t an_id) @@ -219,7 +221,7 @@ bool IdComponent::isValid(hid_t an_id) ///\brief Queries if a given type is currently registered with the /// library. ///\return true if the given type exists, and false, otherwise. -///\Description +///\par Description /// Valid types are: /// \li \c H5I_FILE (= 1) /// \li \c H5I_GROUP diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index b449d4a..0603e5c 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -123,6 +123,6 @@ class H5_DLLCPP IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent +} // namespace H5 -} #endif // __IdComponent_H diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index c64dae9..3aadcab 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -94,11 +94,12 @@ IntType::IntType(const DataSet& dataset) : AtomType() // Function: IntType overloaded constructor ///\brief Creates a IntType instance by opening an HDF5 integer datatype /// given its name as a char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Integer type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openIntType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -112,11 +113,12 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: IntType overloaded constructor ///\brief Creates a IntType instance by opening an HDF5 integer datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Integer type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openArrayType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ae4b3df..1ce05c8 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -57,6 +57,8 @@ class H5_DLLCPP IntType : public AtomType { // Noop destructor. virtual ~IntType(); -}; -} + +}; // end of IntType +} // namespace H5 + #endif // __H5IntType_H diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 1cb80f7..f31c3fc 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -69,6 +69,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of LinkAccPropList +} // namespace H5 + #endif // __H5LinkAccPropList_H diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 018ba38..76b5f82 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -69,6 +69,7 @@ class H5_DLLCPP H5Library { ~H5Library(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of H5Library +} // namespace H5 + #endif // __H5Library_H diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 5a0bb73..79b353a 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -524,16 +524,19 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t //-------------------------------------------------------------------------- // Function: H5Location::dereference -///\brief Dereferences a reference into an HDF5 object, given an attribute. -///\param attr - IN: Attribute specifying the location of the referenced object -///\param ref - IN: Reference pointer -///\param ref_type - IN: Reference type -///\param plist - IN: Property list - default to PropList::DEFAULT -///\exception H5::ReferenceException +// brief Dereferences a reference into an HDF5 object, given an attribute. +// param attr - IN: Attribute specifying the location of the referenced object +// param ref - IN: Reference pointer +// param ref_type - IN: Reference type +// param plist - IN: Property list - default to PropList::DEFAULT +// exception H5::ReferenceException // Programmer Binh-Minh Ribler - Oct, 2006 // Modification // May, 2008 -// Corrected missing parameters. - BMR +// Corrected missing parameters. -BMR +// Mar, 2017 +// Removed in 1.10.1 because H5Location is Attribute's baseclass +// now. -BMR //-------------------------------------------------------------------------- /* void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) { @@ -865,7 +868,7 @@ DataSet H5Location::createDataSet(const char* name, const DataType& data_type, c //-------------------------------------------------------------------------- DataSet H5Location::createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const { - return(createDataSet( name.c_str(), data_type, data_space, create_plist)); + return(createDataSet(name.c_str(), data_type, data_space, create_plist)); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 337a2b3..48fc2b1 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -86,6 +86,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Open a referenced object whose location is specified by either // a file, an HDF5 object, or an attribute. void dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); + // Removed in 1.10.1, because H5Location is baseclass //void dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // Retrieves a dataspace with the region pointed to selected. @@ -220,7 +221,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Noop destructor. virtual ~H5Location(); -}; /* end class H5Location */ +}; // end of H5Location +} // namespace H5 -} #endif // __H5Location_H diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index b5d0f88..359fab2 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -51,7 +51,6 @@ extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name, myData->op(*myData->location, s_attr_name, myData->opData); return 0; } -#endif //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) @@ -101,6 +100,7 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id) { attr->p_setId(new_id); } +#endif //-------------------------------------------------------------------------- // Function: H5Object::createAttribute @@ -391,6 +391,8 @@ void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newna { renameAttr (oldname.c_str(), newname.c_str()); } + +#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: getObjName ///\brief Given an id, returns the type of the object. @@ -502,7 +504,6 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const return(name_size); } -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Object destructor ///\brief Noop destructor. diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 866d739..53f183e 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -131,7 +131,7 @@ class H5_DLLCPP H5Object : public H5Location { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; /* end class H5Object */ +}; // end of H5Object +} // namespace H5 -} #endif // __H5Object_H diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp index 6fdd9dc..9a3af7e 100644 --- a/c++/src/H5OcreatProp.cpp +++ b/c++/src/H5OcreatProp.cpp @@ -155,7 +155,7 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d //-------------------------------------------------------------------------- // Function: ObjCreatPropList::setAttrCrtOrder -///\brief Sets tracking and indexing of attribute creation order. +///\brief Set the flags for creation order of attributes on an object ///\param crt_order_flags - IN: Flags specifying whether to track and /// index attribute creation order. Default: No flag set ///\exception H5::PropListIException @@ -183,10 +183,9 @@ void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const //-------------------------------------------------------------------------- // Function: ObjCreatPropList::getAttrCrtOrder -///\brief Gets tracking and indexing settings for attribute -/// creation order. -///\param crt_order_flags - OUT: Flags specifying whether to track and -/// index attribute creation order +///\brief Returns the flags indicating creation order is tracked/indexed +/// for attributes on an object. +///\return The flags ///\exception H5::PropListIException ///\par Description /// When no flag is set, i.e. crt_order_flags = 0, attribute diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 4858e07..c9c245a 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -72,6 +72,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of ObjCreatPropList +} // namespace H5 + #endif // __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index a8d6e37..2fd8a6b 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -438,6 +438,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PredType +} // namespace H5 + #endif // __H5PredType_H diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index c4176c2..0df0a9f 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -565,8 +565,27 @@ size_t PropList::getNumProps() const ///\param name - IN: Name of property to set - \c char pointer ///\param value - IN: Void pointer to the value for the property ///\exception H5::PropListIException +// Description +// Revision svn r29815 changed 'value' to const, hence, deprecated +// the non-const setProperty. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const char* name, const void* value) const +{ + herr_t ret_value = H5Pset(id, name, value); + if (ret_value < 0) + { + throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); + } +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const char* name, void* value) const { herr_t ret_value = H5Pset(id, name, value); @@ -575,6 +594,7 @@ void PropList::setProperty(const char* name, void* value) const throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); } } + //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. @@ -582,11 +602,14 @@ void PropList::setProperty(const char* name, void* value) const /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param charptr - IN: Char pointer to the value for the property +// Description +// Revision svn r29815 changed 'value' to const, hence, deprecated +// the non-const setProperty. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const char* name, const char* charptr) const { - herr_t ret_value = H5Pset(id, name, (void*)charptr); + herr_t ret_value = H5Pset(id, name, (const void*)charptr); if (ret_value < 0) { throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); @@ -601,6 +624,18 @@ void PropList::setProperty(const char* name, const char* charptr) const ///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const char* name, const H5std_string& strg) const +{ + setProperty(name, strg.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const char* name, H5std_string& strg) const { setProperty(name, strg.c_str()); @@ -615,6 +650,18 @@ void PropList::setProperty(const char* name, H5std_string& strg) const ///\param value - IN: Void pointer to the value for the property // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const H5std_string& name, const void* value) const +{ + setProperty(name.c_str(), value); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, void* value) const { setProperty(name.c_str(), value); @@ -629,6 +676,18 @@ void PropList::setProperty(const H5std_string& name, void* value) const ///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- +void PropList::setProperty(const H5std_string& name, const H5std_string& strg) const +{ + setProperty(name.c_str(), strg.c_str()); +} + +//-------------------------------------------------------------------------- +// Function: PropList::setProperty +///\brief Deprecated due to missing const in prototype. (1.10.1) +// Programmer: Binh-Minh Ribler - March, 2017 +// Modification +// Planned for removal. -BMR, 2017/03/17 1.10.1 +//-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const { setProperty(name.c_str(), strg.c_str()); diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 3977774..772e96c 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -78,8 +78,13 @@ class H5_DLLCPP PropList : public IdComponent { H5std_string getProperty(const H5std_string& name) const; // Set a property's value in a property list. - void setProperty(const char* name, void* value) const; void setProperty(const char* name, const char* charptr) const; + void setProperty(const char* name, const void* value) const; + void setProperty(const char* name, const H5std_string& strg) const; + void setProperty(const H5std_string& name, const void* value) const; + void setProperty(const H5std_string& name, const H5std_string& strg) const; + // Deprecated after 1.10.1, missing const + void setProperty(const char* name, void* value) const; void setProperty(const char* name, H5std_string& strg) const; void setProperty(const H5std_string& name, void* value) const; void setProperty(const H5std_string& name, H5std_string& strg) const; @@ -135,7 +140,8 @@ class H5_DLLCPP PropList : public IdComponent { friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PropList +} // namespace H5 + #endif // __H5PropList_H diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 54981ab..db1cf04 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -148,11 +148,12 @@ StrType::StrType(const DataSet& dataset) : AtomType () // Function: StrType overloaded constructor ///\brief Creates an StrType instance by opening an HDF5 string datatype /// given its name, provided as a C character string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: String type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openStrType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -166,11 +167,12 @@ StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType() // Function: StrType overloaded constructor ///\brief Creates an StrType instance by opening an HDF5 string datatype /// given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: String type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openStrType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 3272ad3..aa87bba 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -69,6 +69,8 @@ class H5_DLLCPP StrType : public AtomType { // Noop destructor. virtual ~StrType(); -}; -} + +}; // end of StrType +} // namespace H5 + #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 7f50b9a..64029cc 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -76,11 +76,12 @@ VarLenType::VarLenType(const DataType* base_type) : DataType() // Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as a C char*. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Variable length type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openVarLenType(const char*) to // improve usability. // -BMR, Dec 2016 @@ -94,11 +95,12 @@ VarLenType::VarLenType(const H5Location& loc, const char *dtype_name) : DataType // Function: VarLenType overloaded constructor ///\brief Creates an VarLenType instance by opening an HDF5 variable /// length datatype given its name, provided as an \c H5std_string. +///\param loc - IN: Location of the type ///\param dtype_name - IN: Variable length type name ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Dec 2016 // Description -// In 1.10.1, this constructor was introduced and will replace the +// In 1.10.1, this constructor was introduced and may replace the // existing function CommonFG::openVarLenType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index a93f44d..4dc0eb5 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -49,6 +49,8 @@ class H5_DLLCPP VarLenType : public DataType { // Default constructor VarLenType(); -}; -} + +}; // end of VarLenType +} // namespace H5 + #endif // __H5VarLenType_H |
