summaryrefslogtreecommitdiffstats
path: root/c++/src
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src')
-rw-r--r--c++/src/H5AbstractDs.cpp436
-rw-r--r--c++/src/H5AbstractDs.h68
-rw-r--r--c++/src/H5ArrayType.cpp142
-rw-r--r--c++/src/H5ArrayType.h48
-rw-r--r--c++/src/H5AtomType.cpp360
-rw-r--r--c++/src/H5AtomType.h60
-rw-r--r--c++/src/H5Attribute.cpp500
-rw-r--r--c++/src/H5Attribute.h94
-rw-r--r--c++/src/H5Classes.h52
-rw-r--r--c++/src/H5CommonFG.cpp413
-rw-r--r--c++/src/H5CommonFG.h68
-rw-r--r--c++/src/H5CompType.cpp582
-rw-r--r--c++/src/H5CompType.h126
-rw-r--r--c++/src/H5CppDoc.h18
-rw-r--r--c++/src/H5DataSet.cpp820
-rw-r--r--c++/src/H5DataSet.h120
-rw-r--r--c++/src/H5DataSpace.cpp793
-rw-r--r--c++/src/H5DataSpace.h152
-rw-r--r--c++/src/H5DataType.cpp928
-rw-r--r--c++/src/H5DataType.h156
-rw-r--r--c++/src/H5DcreatProp.cpp902
-rw-r--r--c++/src/H5DcreatProp.h138
-rw-r--r--c++/src/H5DxferProp.cpp578
-rw-r--r--c++/src/H5DxferProp.h126
-rw-r--r--c++/src/H5EnumType.cpp354
-rw-r--r--c++/src/H5EnumType.h72
-rw-r--r--c++/src/H5Exception.cpp650
-rw-r--r--c++/src/H5Exception.h154
-rw-r--r--c++/src/H5FaccProp.cpp862
-rw-r--r--c++/src/H5FaccProp.h164
-rw-r--r--c++/src/H5FcreatProp.cpp396
-rw-r--r--c++/src/H5FcreatProp.h94
-rw-r--r--c++/src/H5File.cpp662
-rw-r--r--c++/src/H5File.h126
-rw-r--r--c++/src/H5FloatType.cpp402
-rw-r--r--c++/src/H5FloatType.h66
-rw-r--r--c++/src/H5Group.cpp146
-rw-r--r--c++/src/H5Group.h58
-rw-r--r--c++/src/H5IdComponent.cpp408
-rw-r--r--c++/src/H5IdComponent.h112
-rw-r--r--c++/src/H5Include.h4
-rw-r--r--c++/src/H5IntType.cpp168
-rw-r--r--c++/src/H5IntType.h42
-rw-r--r--c++/src/H5LaccProp.cpp34
-rw-r--r--c++/src/H5LaccProp.h26
-rw-r--r--c++/src/H5Library.cpp200
-rw-r--r--c++/src/H5Library.h36
-rw-r--r--c++/src/H5Location.cpp1921
-rw-r--r--c++/src/H5Location.h298
-rw-r--r--c++/src/H5Object.cpp419
-rw-r--r--c++/src/H5Object.h136
-rw-r--r--c++/src/H5OcreatProp.cpp124
-rw-r--r--c++/src/H5OcreatProp.h42
-rw-r--r--c++/src/H5PredType.cpp453
-rw-r--r--c++/src/H5PredType.h328
-rw-r--r--c++/src/H5PropList.cpp769
-rw-r--r--c++/src/H5PropList.h142
-rw-r--r--c++/src/H5StrType.cpp326
-rw-r--r--c++/src/H5StrType.h56
-rw-r--r--c++/src/H5VarLenType.cpp96
-rw-r--r--c++/src/H5VarLenType.h32
61 files changed, 9024 insertions, 9034 deletions
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 9e76b55..621578e 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -34,16 +34,16 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: AbstractDs default constructor
-///\brief Default constructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs default constructor
+///\brief Default constructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AbstractDs::AbstractDs(){}
//--------------------------------------------------------------------------
-// Function: AbstractDs default constructor
-///\brief Creates an AbstractDs instance using an existing id.
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs default constructor
+///\brief Creates an AbstractDs instance using an existing id.
+// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
@@ -54,275 +54,275 @@ AbstractDs::AbstractDs(){}
// Mar 2016 -BMR, AbstractDs::AbstractDs(const hid_t ds_id){}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getTypeClass
-///\brief Returns the class of the datatype that is used by this
-/// object, which can be a dataset or an attribute.
-///\return Datatype class identifier
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getTypeClass
+///\brief Returns the class of the datatype that is used by this
+/// object, which can be a dataset or an attribute.
+///\return Datatype class identifier
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_class_t AbstractDs::getTypeClass() const
{
- // Gets the datatype used by this dataset or attribute.
- // p_get_type calls either H5Dget_type or H5Aget_type depending on
- // which object invokes getTypeClass
- hid_t datatype_id;
- try {
- datatype_id = p_get_type(); // returned value is already validated
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg());
- }
+ // Gets the datatype used by this dataset or attribute.
+ // p_get_type calls either H5Dget_type or H5Aget_type depending on
+ // which object invokes getTypeClass
+ hid_t datatype_id;
+ try {
+ datatype_id = p_get_type(); // returned value is already validated
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getTypeClass", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getTypeClass", E.getDetailMsg());
+ }
- // Gets the class of the datatype and validate it before returning
- H5T_class_t type_class = H5Tget_class(datatype_id);
+ // Gets the class of the datatype and validate it before returning
+ H5T_class_t type_class = H5Tget_class(datatype_id);
- // Close temporary datatype_id
- herr_t ret_value = H5Tclose(datatype_id);
- if (ret_value < 0)
- {
- if (fromClass() == "DataSet")
- throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed");
- else if (fromClass() == "Attribute")
- throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed");
- }
+ // Close temporary datatype_id
+ herr_t ret_value = H5Tclose(datatype_id);
+ if (ret_value < 0)
+ {
+ if (fromClass() == "DataSet")
+ throw DataTypeIException("DataSet::getTypeClass", "H5Tclose failed");
+ else if (fromClass() == "Attribute")
+ throw DataTypeIException("Attribute::getTypeClass", "H5Tclose failed");
+ }
- // Check on the returned type_class
- if (type_class == H5T_NO_CLASS)
- {
- if (fromClass() == "DataSet")
- throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
- else if (fromClass() == "Attribute")
- throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
- }
- return(type_class);
+ // Check on the returned type_class
+ if (type_class == H5T_NO_CLASS)
+ {
+ if (fromClass() == "DataSet")
+ throw DataTypeIException("DataSet::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
+ else if (fromClass() == "Attribute")
+ throw DataTypeIException("Attribute::getTypeClass", "H5Tget_class returns H5T_NO_CLASS");
+ }
+ return(type_class);
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getDataType
-///\brief Returns the generic datatype of this abstract dataset, which
-/// can be a dataset or an attribute.
-///\return DataType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getDataType
+///\brief Returns the generic datatype of this abstract dataset, which
+/// can be a dataset or an attribute.
+///\return DataType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType AbstractDs::getDataType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getDataType. Then, create and
- // return the DataType object
- try {
- DataType datatype;
- f_DataType_setId(&datatype, p_get_type());
- return(datatype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getDataType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getDataType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getDataType. Then, create and
+ // return the DataType object
+ try {
+ DataType datatype;
+ f_DataType_setId(&datatype, p_get_type());
+ return(datatype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getDataType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getDataType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getArrayType
-///\brief Returns the array datatype of this abstract dataset which
-/// can be a dataset or an attribute.
-///\return ArrayType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: AbstractDs::getArrayType
+///\brief Returns the array datatype of this abstract dataset which
+/// can be a dataset or an attribute.
+///\return ArrayType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
ArrayType AbstractDs::getArrayType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getArrayType. Then, create and
- // return the ArrayType object
- try {
- // Create ArrayType and set values this way to work around the
- // problem described in the JIRA issue HDFFV-7947
- ArrayType arraytype;
- f_DataType_setId(&arraytype, p_get_type());
- return(arraytype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getArrayType. Then, create and
+ // return the ArrayType object
+ try {
+ // Create ArrayType and set values this way to work around the
+ // problem described in the JIRA issue HDFFV-7947
+ ArrayType arraytype;
+ f_DataType_setId(&arraytype, p_get_type());
+ return(arraytype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getArrayType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getArrayType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getCompType
-///\brief Returns the compound datatype of this abstract dataset which
-/// can be a dataset or an attribute.
-///\return CompType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getCompType
+///\brief Returns the compound datatype of this abstract dataset which
+/// can be a dataset or an attribute.
+///\return CompType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
CompType AbstractDs::getCompType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getCompType. Then, create and
- // return the CompType object
- try {
- CompType comptype;
- f_DataType_setId(&comptype, p_get_type());
- return(comptype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getCompType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getCompType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getCompType. Then, create and
+ // return the CompType object
+ try {
+ CompType comptype;
+ f_DataType_setId(&comptype, p_get_type());
+ return(comptype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getCompType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getCompType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getEnumType
-///\brief Returns the enumeration datatype of this abstract dataset which
-/// can be a dataset or an attribute.
-///\return EnumType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getEnumType
+///\brief Returns the enumeration datatype of this abstract dataset which
+/// can be a dataset or an attribute.
+///\return EnumType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType AbstractDs::getEnumType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getEnumType. Then, create and
- // return the EnumType object
- try {
- EnumType enumtype;
- f_DataType_setId(&enumtype, p_get_type());
- return(enumtype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getEnumType. Then, create and
+ // return the EnumType object
+ try {
+ EnumType enumtype;
+ f_DataType_setId(&enumtype, p_get_type());
+ return(enumtype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getEnumType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getEnumType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getIntType
-///\brief Returns the integer datatype of this abstract dataset which
-/// can be a dataset or an attribute.
-///\return IntType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getIntType
+///\brief Returns the integer datatype of this abstract dataset which
+/// can be a dataset or an attribute.
+///\return IntType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType AbstractDs::getIntType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getIntType. Then, create and
- // return the IntType object
- try {
- IntType inttype;
- f_DataType_setId(&inttype, p_get_type());
- return(inttype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getIntType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getIntType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getIntType. Then, create and
+ // return the IntType object
+ try {
+ IntType inttype;
+ f_DataType_setId(&inttype, p_get_type());
+ return(inttype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getIntType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getIntType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getFloatType
-///\brief Returns the floating-point datatype of this abstract dataset,
-/// which can be a dataset or an attribute.
-///\return FloatType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getFloatType
+///\brief Returns the floating-point datatype of this abstract dataset,
+/// which can be a dataset or an attribute.
+///\return FloatType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType AbstractDs::getFloatType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getFloatType. Then, create and
- // return the FloatType object
- try {
- FloatType floatype;
- f_DataType_setId(&floatype, p_get_type());
- return(floatype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getFloatType. Then, create and
+ // return the FloatType object
+ try {
+ FloatType floatype;
+ f_DataType_setId(&floatype, p_get_type());
+ return(floatype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getFloatType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getFloatType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getStrType
-///\brief Returns the string datatype of this abstract dataset which
-/// can be a dataset or an attribute.
-///\return StrType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs::getStrType
+///\brief Returns the string datatype of this abstract dataset which
+/// can be a dataset or an attribute.
+///\return StrType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType AbstractDs::getStrType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getStrType. Then, create and
- // return the StrType object
- try {
- StrType strtype;
- f_DataType_setId(&strtype, p_get_type());
- return(strtype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getStrType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getStrType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getStrType. Then, create and
+ // return the StrType object
+ try {
+ StrType strtype;
+ f_DataType_setId(&strtype, p_get_type());
+ return(strtype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getStrType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getStrType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs::getVarLenType
-///\brief Returns the floating-point datatype of this abstract dataset,
-/// which can be a dataset or an attribute.
-///\return VarLenType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: AbstractDs::getVarLenType
+///\brief Returns the floating-point datatype of this abstract dataset,
+/// which can be a dataset or an attribute.
+///\return VarLenType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
VarLenType AbstractDs::getVarLenType() const
{
- // Gets the id of the datatype used by this dataset or attribute using
- // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
- // depending on which object invokes getVarLenType. Then, create and
- // return the VarLenType object
- try {
- VarLenType varlentype;
- f_DataType_setId(&varlentype, p_get_type());
- return(varlentype);
- }
- catch (DataSetIException& E) {
- throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg());
- }
- catch (AttributeIException& E) {
- throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg());
- }
+ // Gets the id of the datatype used by this dataset or attribute using
+ // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type
+ // depending on which object invokes getVarLenType. Then, create and
+ // return the VarLenType object
+ try {
+ VarLenType varlentype;
+ f_DataType_setId(&varlentype, p_get_type());
+ return(varlentype);
+ }
+ catch (DataSetIException& E) {
+ throw DataTypeIException("DataSet::getVarLenType", E.getDetailMsg());
+ }
+ catch (AttributeIException& E) {
+ throw DataTypeIException("Attribute::getVarLenType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: AbstractDs destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: AbstractDs destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AbstractDs::~AbstractDs() {}
diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h
index 1b4775c..eaa9d14 100644
--- a/c++/src/H5AbstractDs.h
+++ b/c++/src/H5AbstractDs.h
@@ -37,44 +37,44 @@ class DataSpace;
*/
class H5_DLLCPP AbstractDs {
public:
- // Gets a copy the datatype of that this abstract dataset uses.
- // Note that this datatype is a generic one and can only be accessed
- // via generic member functions, i.e., member functions belong
- // to DataType. To get specific datatype, i.e. EnumType, FloatType,
- // etc..., use the specific functions, that follow, instead.
- DataType getDataType() const;
+ // Gets a copy the datatype of that this abstract dataset uses.
+ // Note that this datatype is a generic one and can only be accessed
+ // via generic member functions, i.e., member functions belong
+ // to DataType. To get specific datatype, i.e. EnumType, FloatType,
+ // etc..., use the specific functions, that follow, instead.
+ DataType getDataType() const;
- // Gets a copy of the specific datatype of this abstract dataset.
- ArrayType getArrayType() const;
- CompType getCompType() const;
- EnumType getEnumType() const;
- IntType getIntType() const;
- FloatType getFloatType() const;
- StrType getStrType() const;
- VarLenType getVarLenType() const;
+ // Gets a copy of the specific datatype of this abstract dataset.
+ ArrayType getArrayType() const;
+ CompType getCompType() const;
+ EnumType getEnumType() const;
+ IntType getIntType() const;
+ FloatType getFloatType() const;
+ StrType getStrType() const;
+ VarLenType getVarLenType() const;
- ///\brief Gets the size in memory of this abstract dataset.
- virtual size_t getInMemDataSize() const = 0;
+ ///\brief Gets the size in memory of this abstract dataset.
+ virtual size_t getInMemDataSize() const = 0;
- ///\brief Gets the dataspace of this abstract dataset - pure virtual.
- virtual DataSpace getSpace() const = 0;
+ ///\brief Gets the dataspace of this abstract dataset - pure virtual.
+ virtual DataSpace getSpace() const = 0;
- // Gets the class of the datatype that is used by this abstract
- // dataset.
- H5T_class_t getTypeClass() const;
+ // Gets the class of the datatype that is used by this abstract
+ // dataset.
+ H5T_class_t getTypeClass() const;
- ///\brief Returns the amount of storage size required - pure virtual.
- virtual hsize_t getStorageSize() const = 0;
+ ///\brief Returns the amount of storage size required - pure virtual.
+ virtual hsize_t getStorageSize() const = 0;
- // Returns this class name - pure virtual.
- virtual H5std_string fromClass() const = 0;
+ // Returns this class name - pure virtual.
+ virtual H5std_string fromClass() const = 0;
- // Destructor
- virtual ~AbstractDs();
+ // Destructor
+ virtual ~AbstractDs();
protected:
- // Default constructor
- AbstractDs();
+ // Default constructor
+ AbstractDs();
// *** Deprecation warning ***
// The following two constructors are no longer appropriate after the
@@ -83,14 +83,14 @@ class H5_DLLCPP AbstractDs {
// other will be removed from 1.10 release, and then from 1.8 if its
// removal does not raise any problems in two 1.10 releases.
- // Mar 2016 -BMR, AbstractDs(const hid_t h5_id);
+ // Mar 2016 -BMR, AbstractDs(const hid_t h5_id);
- // Copy constructor
- // AbstractDs( const AbstractDs& original );
+ // Copy constructor
+ // AbstractDs( const AbstractDs& original );
private:
- // This member function is implemented by DataSet and Attribute - pure virtual.
- virtual hid_t p_get_type() const = 0;
+ // This member function is implemented by DataSet and Attribute - pure virtual.
+ virtual hid_t p_get_type() const = 0;
};
}
#endif // __AbstractDs_H
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index ecce591..3cdcc0a 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -30,95 +30,95 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: ArrayType default constructor
-///\brief Default constructor: Creates a stub ArrayType
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType default constructor
+///\brief Default constructor: Creates a stub ArrayType
+// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: ArrayType overloaded constructor
-///\brief Creates an ArrayType object using an existing id.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType overloaded constructor
+///\brief Creates an ArrayType object using an existing id.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) {}
+ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {}
//--------------------------------------------------------------------------
-// Function: ArrayType copy constructor
-///\brief Copy constructor: makes a copy of the original ArrayType object.
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType copy constructor
+///\brief Copy constructor: makes a copy of the original ArrayType object.
+// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const ArrayType& original) : DataType(original) {}
//--------------------------------------------------------------------------
-// Function: ArrayType overloaded constructor
-///\brief Creates a new array data type based on the specified
-/// \a base_type.
-///\param base_type - IN: Existing datatype
-///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK]
-///\param dims - IN: Size of each array dimension
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType overloaded constructor
+///\brief Creates a new array data type based on the specified
+/// \a base_type.
+///\param base_type - IN: Existing datatype
+///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK]
+///\param dims - IN: Size of each array dimension
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
{
// Call C API to create an array data type
hid_t new_type_id = H5Tarray_create2(base_type.getId(), ndims, dims);
if (new_type_id < 0)
- throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed");
+ throw DataTypeIException("ArrayType constructor", "H5Tarray_create2 failed");
// Set the id for this object
id = new_type_id;
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Array type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openArrayType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openArrayType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name);
+ id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
-// Function: ArrayType overloaded constructor
-///\brief Creates an ArrayType instance by opening an HDF5 array datatype
-/// given its name, provided as an \c H5std_string.
-///\param dtype_name - IN: Array type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// Function: ArrayType overloaded constructor
+///\brief Creates an ArrayType instance by opening an HDF5 array datatype
+/// given its name, provided as an \c H5std_string.
+///\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
-// existing function CommonFG::openArrayType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openArrayType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: ArrayType::operator=
-///\brief Assignment operator
-///\param rhs - IN: Reference to the existing array datatype
-///\return Reference to ArrayType instance
-///\exception H5::DataTypeIException
+// Function: ArrayType::operator=
+///\brief Assignment operator
+///\param rhs - IN: Reference to the existing array datatype
+///\return Reference to ArrayType instance
+///\exception H5::DataTypeIException
// Description
-// Closes the id on the lhs object first with setId, then copies
-// each data member from the rhs object. (Issue HDFFV-9562)
-// Programmer Binh-Minh Ribler - Mar 2016
+// Closes the id on the lhs object first with setId, then copies
+// each data member from the rhs object. (Issue HDFFV-9562)
+// Programmer Binh-Minh Ribler - Mar 2016
// Modification
//--------------------------------------------------------------------------
ArrayType& ArrayType::operator=(const ArrayType& rhs)
@@ -139,14 +139,14 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs)
}
//--------------------------------------------------------------------------
-// Function: ArrayType::getArrayNDims
-///\brief Returns the number of dimensions for an array datatype.
-///\return Number of dimensions
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType::getArrayNDims
+///\brief Returns the number of dimensions for an array datatype.
+///\return Number of dimensions
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May 2004
// Modification
-// Apr, 2016
-// Became const.
+// Apr, 2016
+// Became const.
//--------------------------------------------------------------------------
int ArrayType::getArrayNDims() const
{
@@ -154,38 +154,38 @@ int ArrayType::getArrayNDims() const
int ndims = H5Tget_array_ndims(id);
if (ndims < 0)
{
- throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed");
+ throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed");
}
return(ndims);
}
//--------------------------------------------------------------------------
-// Function: ArrayType::getArrayDims
-///\brief Retrieves the size of all dimensions of an array datatype.
-///\param dims - OUT: Sizes of dimensions
-///\return Number of dimensions
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType::getArrayDims
+///\brief Retrieves the size of all dimensions of an array datatype.
+///\param dims - OUT: Sizes of dimensions
+///\return Number of dimensions
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May 2004
// Modification
-// Apr, 2016
-// Became const.
+// Apr, 2016
+// Became const.
//--------------------------------------------------------------------------
int ArrayType::getArrayDims(hsize_t* dims) const
{
// Get the dimensions
int ndims = H5Tget_array_dims2(id, dims);
if (ndims < 0)
- throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
+ throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
// Return the number of dimensions
return(ndims);
}
//--------------------------------------------------------------------------
-// Function: ArrayType destructor
-///\brief Properly terminates access to this array datatype.
-// Programmer Binh-Minh Ribler - May 2004
+// Function: ArrayType destructor
+///\brief Properly terminates access to this array datatype.
+// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::~ArrayType() {}
diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h
index 65917ae..15b6bb3 100644
--- a/c++/src/H5ArrayType.h
+++ b/c++/src/H5ArrayType.h
@@ -27,39 +27,39 @@ namespace H5 {
*/
class H5_DLLCPP ArrayType : public DataType {
public:
- // Constructor that creates a new array data type based on the
- // specified base type.
- ArrayType(const DataType& base_type, int ndims, const hsize_t* dims);
+ // Constructor that creates a new array data type based on the
+ // specified base type.
+ ArrayType(const DataType& base_type, int ndims, const hsize_t* dims);
- // Assignment operator
- ArrayType& operator=(const ArrayType& rhs);
+ // Assignment operator
+ ArrayType& operator=(const ArrayType& rhs);
- // Constructors that open an array datatype, given a location.
- ArrayType(const H5Location& loc, const char* name);
- ArrayType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open an array datatype, given a location.
+ ArrayType(const H5Location& loc, const char* name);
+ ArrayType(const H5Location& loc, const H5std_string& name);
- // Returns the number of dimensions of this array datatype.
- int getArrayNDims() const;
- //int getArrayNDims(); // removed 1.8.18 and 1.10.1
+ // Returns the number of dimensions of this array datatype.
+ int getArrayNDims() const;
+ //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); // 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); // removed 1.8.18 and 1.10.1
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("ArrayType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("ArrayType"); }
- // Copy constructor: makes copy of the original object.
- ArrayType( const ArrayType& original );
+ // Copy constructor: makes copy of the original object.
+ ArrayType(const ArrayType& original);
- // Constructor that takes an existing id
- ArrayType( const hid_t existing_id );
+ // Constructor that takes an existing id
+ ArrayType(const hid_t existing_id);
- // Noop destructor
- virtual ~ArrayType();
+ // Noop destructor
+ virtual ~ArrayType();
- // Default constructor
- ArrayType();
+ // Default constructor
+ ArrayType();
};
}
#endif // __H5ArrayType_H
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp
index 22b163a..0dc2b1e 100644
--- a/c++/src/H5AtomType.cpp
+++ b/c++/src/H5AtomType.cpp
@@ -31,265 +31,265 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: AtomType default constructor [protected]
-// Purpose Default constructor: creates a stub atomic datatype.
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType default constructor [protected]
+// Purpose Default constructor: creates a stub atomic datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::AtomType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: AtomType overloaded constructor [protected]
-// Purpose Creates an AtomType object using an existing id.
-// Parameter existing_id - IN: Id of an existing datatype
-// Exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType overloaded constructor [protected]
+// Purpose Creates an AtomType object using an existing id.
+// Parameter existing_id - IN: Id of an existing datatype
+// Exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::AtomType( const hid_t existing_id ) : DataType( existing_id ) {}
+AtomType::AtomType(const hid_t existing_id) : DataType(existing_id) {}
//--------------------------------------------------------------------------
-// Function: AtomType copy constructor
-///\brief Copy constructor: makes a copy of the original AtomType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType copy constructor
+///\brief Copy constructor: makes a copy of the original AtomType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-AtomType::AtomType( const AtomType& original ) : DataType( original ) {}
+AtomType::AtomType(const AtomType& original) : DataType(original) {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: AtomType::setSize
-///\brief Sets the total size for an atomic datatype.
-///\param size - IN: Size to set
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType::setSize
+///\brief Sets the total size for an atomic datatype.
+///\param size - IN: Size to set
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::setSize( size_t size ) const
+void AtomType::setSize(size_t size) const
{
- // Call C routine H5Tset_size to set the total size
- herr_t ret_value = H5Tset_size( id, size );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed");
- }
+ // Call C routine H5Tset_size to set the total size
+ herr_t ret_value = H5Tset_size(id, size);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setSize"), "H5Tset_size failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: AtomType::getOrder
-///\brief Returns the byte order of an atomic datatype.
-///\return Byte order, which can be:
-/// \li \c H5T_ORDER_LE
-/// \li \c H5T_ORDER_BE
-/// \li \c H5T_ORDER_VAX
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Mar, 2005
+// Function: AtomType::getOrder
+///\brief Returns the byte order of an atomic datatype.
+///\return Byte order, which can be:
+/// \li \c H5T_ORDER_LE
+/// \li \c H5T_ORDER_BE
+/// \li \c H5T_ORDER_VAX
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
H5T_order_t AtomType::getOrder() const
{
- // Call C routine to get the byte ordering
- H5T_order_t type_order = H5Tget_order( id );
+ // Call C routine to get the byte ordering
+ H5T_order_t type_order = H5Tget_order(id);
- // return a byte order constant if successful
- if( type_order == H5T_ORDER_ERROR )
- {
- throw DataTypeIException(inMemFunc("getOrder"),
- "H5Tget_order returns H5T_ORDER_ERROR");
- }
- return( type_order );
+ // return a byte order constant if successful
+ if (type_order == H5T_ORDER_ERROR)
+ {
+ throw DataTypeIException(inMemFunc("getOrder"),
+ "H5Tget_order returns H5T_ORDER_ERROR");
+ }
+ return(type_order);
}
//--------------------------------------------------------------------------
-// Function: AtomType::getOrder
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes a reference to a \c H5std_string for the buffer that
-/// provide the text description of the returned byte order.
-/// The text description can be either of the following:
-/// "Little endian byte ordering (0)";
-/// "Big endian byte ordering (1)";
-/// "VAX mixed byte ordering (2)";
-///\param order_string - OUT: Text description of the returned byte order
-///\return Byte order, which can be:
-/// \li \c H5T_ORDER_LE
-/// \li \c H5T_ORDER_BE
-/// \li \c H5T_ORDER_VAX
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType::getOrder
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes a reference to a \c H5std_string for the buffer that
+/// provide the text description of the returned byte order.
+/// The text description can be either of the following:
+/// "Little endian byte ordering (0)";
+/// "Big endian byte ordering (1)";
+/// "VAX mixed byte ordering (2)";
+///\param order_string - OUT: Text description of the returned byte order
+///\return Byte order, which can be:
+/// \li \c H5T_ORDER_LE
+/// \li \c H5T_ORDER_BE
+/// \li \c H5T_ORDER_VAX
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_order_t AtomType::getOrder( H5std_string& order_string ) const
+H5T_order_t AtomType::getOrder(H5std_string& order_string) const
{
- // Call the overloaded to get the type order without text
- H5T_order_t type_order = getOrder();
+ // Call the overloaded to get the type order without text
+ H5T_order_t type_order = getOrder();
- // Then provide the text and return the type order
- if( type_order == H5T_ORDER_LE )
- order_string = "Little endian byte ordering (0)";
- else if( type_order == H5T_ORDER_BE )
- order_string = "Big endian byte ordering (1)";
- else if( type_order == H5T_ORDER_VAX )
- order_string = "VAX mixed byte ordering (2)";
- return( type_order );
+ // Then provide the text and return the type order
+ if (type_order == H5T_ORDER_LE)
+ order_string = "Little endian byte ordering (0)";
+ else if (type_order == H5T_ORDER_BE)
+ order_string = "Big endian byte ordering (1)";
+ else if (type_order == H5T_ORDER_VAX)
+ order_string = "VAX mixed byte ordering (2)";
+ return(type_order);
}
//--------------------------------------------------------------------------
-// Function: AtomType::setOrder
-///\brief Sets the byte ordering of an atomic datatype.
-///\param order - IN: Byte ordering constant, which can be:
-/// \li \c H5T_ORDER_LE
-/// \li \c H5T_ORDER_BE
-/// \li \c H5T_ORDER_VAX
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType::setOrder
+///\brief Sets the byte ordering of an atomic datatype.
+///\param order - IN: Byte ordering constant, which can be:
+/// \li \c H5T_ORDER_LE
+/// \li \c H5T_ORDER_BE
+/// \li \c H5T_ORDER_VAX
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::setOrder( H5T_order_t order ) const
+void AtomType::setOrder(H5T_order_t order) const
{
- // Call C routine to set the byte ordering
- herr_t ret_value = H5Tset_order( id, order );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed");
- }
+ // Call C routine to set the byte ordering
+ herr_t ret_value = H5Tset_order(id, order);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setOrder"), "H5Tset_order failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: AtomType::getPrecision
-///\brief Returns the precision of an atomic datatype.
-///\return Number of significant bits
-///\exception H5::DataTypeIException
+// Function: AtomType::getPrecision
+///\brief Returns the precision of an atomic datatype.
+///\return Number of significant bits
+///\exception H5::DataTypeIException
///\par Description
-/// The precision is the number of significant bits which,
-/// unless padding is present, is 8 times larger than the
-/// value returned by \c DataType::getSize().
-// Programmer Binh-Minh Ribler - 2000
+/// The precision is the number of significant bits which,
+/// unless padding is present, is 8 times larger than the
+/// value returned by \c DataType::getSize().
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
size_t AtomType::getPrecision() const
{
- size_t num_signi_bits = H5Tget_precision( id ); // C routine
+ size_t num_signi_bits = H5Tget_precision(id); // C routine
- // returns number of significant bits if successful
- if( num_signi_bits == 0 )
- {
- throw DataTypeIException(inMemFunc("getPrecision"),
- "H5Tget_precision returns invalid number of significant bits");
- }
- return( num_signi_bits );
+ // returns number of significant bits if successful
+ if (num_signi_bits == 0)
+ {
+ throw DataTypeIException(inMemFunc("getPrecision"),
+ "H5Tget_precision returns invalid number of significant bits");
+ }
+ return(num_signi_bits);
}
//--------------------------------------------------------------------------
-// Function: AtomType::setPrecision
-///\brief Sets the precision of an atomic datatype.
-///\param precision - IN: Number of bits of precision
-///\exception H5::DataTypeIException
+// Function: AtomType::setPrecision
+///\brief Sets the precision of an atomic datatype.
+///\param precision - IN: Number of bits of precision
+///\exception H5::DataTypeIException
///\par Description
-/// For information, please see C layer Reference Manuat at:
+/// For information, please see C layer Reference Manuat at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::setPrecision( size_t precision ) const
+void AtomType::setPrecision(size_t precision) const
{
- // Call C routine to set the datatype precision
- herr_t ret_value = H5Tset_precision( id, precision );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed");
- }
+ // Call C routine to set the datatype precision
+ herr_t ret_value = H5Tset_precision(id, precision);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setPrecision"), "H5Tset_precision failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: AtomType::getOffset
-///\brief Retrieves the bit offset of the first significant bit.
-///\return Offset value
-///\exception H5::DataTypeIException
+// Function: AtomType::getOffset
+///\brief Retrieves the bit offset of the first significant bit.
+///\return Offset value
+///\exception H5::DataTypeIException
///\par Description
-/// For information, please see C layer Reference Manuat at:
+/// For information, please see C layer Reference Manuat at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// 12/05/00: due to C API change
-// - return type changed from size_t to int
-// - offset = -1 when failure occurs vs. 0
+// 12/05/00: due to C API change
+// - return type changed from size_t to int
+// - offset = -1 when failure occurs vs. 0
//--------------------------------------------------------------------------
int AtomType::getOffset() const
{
- int offset = H5Tget_offset( id ); // C routine
+ int offset = H5Tget_offset(id); // C routine
- // returns a non-negative offset value if successful
- if( offset == -1 )
- {
- throw DataTypeIException(inMemFunc("getOffset"),
- "H5Tget_offset returns a negative offset value");
- }
- return( offset );
+ // returns a non-negative offset value if successful
+ if (offset == -1)
+ {
+ throw DataTypeIException(inMemFunc("getOffset"),
+ "H5Tget_offset returns a negative offset value");
+ }
+ return(offset);
}
//--------------------------------------------------------------------------
-// Function: AtomType::setOffset
-///\brief Sets the bit offset of the first significant bit.
-///\param offset - IN: Offset of first significant bit
-///\exception H5::DataTypeIException
+// Function: AtomType::setOffset
+///\brief Sets the bit offset of the first significant bit.
+///\param offset - IN: Offset of first significant bit
+///\exception H5::DataTypeIException
///\par Description
-/// For information, please see C layer Reference Manuat at:
+/// For information, please see C layer Reference Manuat at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::setOffset( size_t offset ) const
+void AtomType::setOffset(size_t offset) const
{
- // Call C routine to set the bit offset
- herr_t ret_value = H5Tset_offset( id, offset );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed");
- }
+ // Call C routine to set the bit offset
+ herr_t ret_value = H5Tset_offset(id, offset);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setOffset"), "H5Tset_offset failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: AtomType::getPad
-///\brief Retrieves the padding type of the least and most-significant
-/// bit padding.
-///\param lsb - OUT: Least-significant bit padding type
-///\param msb - OUT: Most-significant bit padding type
-///\exception H5::DataTypeIException
+// Function: AtomType::getPad
+///\brief Retrieves the padding type of the least and most-significant
+/// bit padding.
+///\param lsb - OUT: Least-significant bit padding type
+///\param msb - OUT: Most-significant bit padding type
+///\exception H5::DataTypeIException
///\par Description
-/// Possible values for \a lsb and \a msb include:
-/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
-/// \li \c H5T_PAD_ONE (1) - Set background to ones.
-/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
-// Programmer Binh-Minh Ribler - 2000
+/// Possible values for \a lsb and \a msb include:
+/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
+/// \li \c H5T_PAD_ONE (1) - Set background to ones.
+/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
+void AtomType::getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const
{
- // Call C routine to get the padding type
- herr_t ret_value = H5Tget_pad( id, &lsb, &msb );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed");
- }
+ // Call C routine to get the padding type
+ herr_t ret_value = H5Tget_pad(id, &lsb, &msb);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("getPad"), "H5Tget_pad failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: AtomType::setPad
-///\brief Sets the least and most-significant bits padding types.
-///\param lsb - IN: Least-significant bit padding type
-///\param msb - IN: Most-significant bit padding type
-///\exception H5::DataTypeIException
+// Function: AtomType::setPad
+///\brief Sets the least and most-significant bits padding types.
+///\param lsb - IN: Least-significant bit padding type
+///\param msb - IN: Most-significant bit padding type
+///\exception H5::DataTypeIException
///\par Description
-/// Valid values for \a lsb and \a msb include:
-/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
-/// \li \c H5T_PAD_ONE (1) - Set background to ones.
-/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for \a lsb and \a msb include:
+/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
+/// \li \c H5T_PAD_ONE (1) - Set background to ones.
+/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const
+void AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
{
- // Call C routine to set the padding type
- herr_t ret_value = H5Tset_pad( id, lsb, msb );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed");
- }
+ // Call C routine to set the padding type
+ herr_t ret_value = H5Tset_pad(id, lsb, msb);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setPad"), "H5Tset_pad failed");
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: AtomType destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: AtomType destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
AtomType::~AtomType() {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h
index d84b53f..a1e0262 100644
--- a/c++/src/H5AtomType.h
+++ b/c++/src/H5AtomType.h
@@ -30,53 +30,53 @@ namespace H5 {
*/
class H5_DLLCPP AtomType : public DataType {
public:
- // Returns the byte order of an atomic datatype.
- H5T_order_t getOrder() const;
- H5T_order_t getOrder( H5std_string& order_string ) const;
+ // Returns the byte order of an atomic datatype.
+ H5T_order_t getOrder() const;
+ H5T_order_t getOrder(H5std_string& order_string) const;
- // Sets the byte ordering of an atomic datatype.
- void setOrder( H5T_order_t order ) const;
+ // Sets the byte ordering of an atomic datatype.
+ void setOrder(H5T_order_t order) const;
- // Retrieves the bit offset of the first significant bit.
- // 12/05/00 - changed return type to int from size_t - C API
- int getOffset() const;
+ // Retrieves the bit offset of the first significant bit.
+ // 12/05/00 - changed return type to int from size_t - C API
+ int getOffset() const;
- // Sets the bit offset of the first significant bit.
- void setOffset( size_t offset ) const;
+ // Sets the bit offset of the first significant bit.
+ void setOffset(size_t offset) const;
- // Retrieves the padding type of the least and most-significant bit padding.
- void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const;
+ // Retrieves the padding type of the least and most-significant bit padding.
+ void getPad(H5T_pad_t& lsb, H5T_pad_t& msb) const;
- // Sets the least and most-significant bits padding types
- void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const;
+ // Sets the least and most-significant bits padding types
+ void setPad(H5T_pad_t lsb, H5T_pad_t msb) const;
- // Returns the precision of an atomic datatype.
- size_t getPrecision() const;
+ // Returns the precision of an atomic datatype.
+ size_t getPrecision() const;
- // Sets the precision of an atomic datatype.
- void setPrecision( size_t precision ) const;
+ // Sets the precision of an atomic datatype.
+ void setPrecision(size_t precision) const;
- // Sets the total size for an atomic datatype.
- void setSize( size_t size ) const;
+ // Sets the total size for an atomic datatype.
+ void setSize(size_t size) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("AtomType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("AtomType"); }
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Copy constructor - makes copy of the original object
- AtomType( const AtomType& original );
+ // Copy constructor - makes copy of the original object
+ AtomType(const AtomType& original);
- // Noop destructor
- virtual ~AtomType();
+ // Noop destructor
+ virtual ~AtomType();
#endif // DOXYGEN_SHOULD_SKIP_THIS
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Default constructor
- AtomType();
+ // Default constructor
+ AtomType();
- // Constructor that takes an existing id
- AtomType( const hid_t existing_id );
+ // Constructor that takes an existing id
+ AtomType(const hid_t existing_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
};
}
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index dfd2b28..6701f6e 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -1,7 +1,7 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
+/* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
@@ -20,7 +20,7 @@
#endif
#include <string>
-#include "H5private.h" // for HDfree
+#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -44,17 +44,17 @@ using std::endl;
class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
//--------------------------------------------------------------------------
-// Function: Attribute default constructor
-///\brief Default constructor: Creates a stub attribute
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: Attribute default constructor
+///\brief Default constructor: Creates a stub attribute
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
Attribute::Attribute() : AbstractDs(), H5Location(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: Attribute copy constructor
-///\brief Copy constructor: makes a copy of the original Attribute object.
-///\param original - IN: Original Attribute object to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute copy constructor
+///\brief Copy constructor: makes a copy of the original Attribute object.
+///\param original - IN: Original Attribute object to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id(original.id)
{
@@ -62,12 +62,12 @@ Attribute::Attribute(const Attribute& original) : AbstractDs(), H5Location(), id
}
//--------------------------------------------------------------------------
-// Function: Attribute overloaded constructor
-///\brief Creates an Attribute object using the id of an existing
-/// attribute.
-///\param existing_id - IN: Id of an existing attribute
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute overloaded constructor
+///\brief Creates an Attribute object using the id of an existing
+/// attribute.
+///\param existing_id - IN: Id of an existing attribute
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(existing_id)
{
@@ -75,30 +75,30 @@ Attribute::Attribute(const hid_t existing_id) : AbstractDs(), H5Location(), id(e
}
//--------------------------------------------------------------------------
-// Function: Attribute::write
-///\brief Writes data to this attribute.
-///\param mem_type - IN: Attribute datatype (in memory)
-///\param buf - IN: Data to be written
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute::write
+///\brief Writes data to this attribute.
+///\param mem_type - IN: Attribute datatype (in memory)
+///\param buf - IN: Data to be written
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void Attribute::write( const DataType& mem_type, const void *buf ) const
+void Attribute::write(const DataType& mem_type, const void *buf) const
{
- herr_t ret_value = H5Awrite( id, mem_type.getId(), buf );
- if( ret_value < 0 )
- {
- throw AttributeIException("Attribute::write", "H5Awrite failed");
- }
+ herr_t ret_value = H5Awrite(id, mem_type.getId(), buf);
+ if (ret_value < 0)
+ {
+ throw AttributeIException("Attribute::write", "H5Awrite failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: Attribute::write
-///\brief This is an overloaded member function, provided for convenience.
-/// It writes a \a H5std_string to this attribute.
-///\param mem_type - IN: Attribute datatype (in memory)
-///\param strg - IN: Data to be written
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Apr, 2003
+// Function: Attribute::write
+///\brief This is an overloaded member function, provided for convenience.
+/// It writes a \a H5std_string to this attribute.
+///\param mem_type - IN: Attribute datatype (in memory)
+///\param strg - IN: Data to be written
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Apr, 2003
//--------------------------------------------------------------------------
void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
{
@@ -107,7 +107,7 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
htri_t is_variable_len = H5Tis_variable_str(mem_type.getId());
if (is_variable_len < 0)
{
- throw AttributeIException("Attribute::write", "H5Tis_variable_str failed");
+ throw AttributeIException("Attribute::write", "H5Tis_variable_str failed");
}
// Convert string to C-string
const char* strg_C;
@@ -117,55 +117,55 @@ void Attribute::write(const DataType& mem_type, const H5std_string& strg) const
// Pass string in differently depends on variable or fixed length
if (!is_variable_len)
{
- ret_value = H5Awrite(id, mem_type.getId(), strg_C);
+ ret_value = H5Awrite(id, mem_type.getId(), strg_C);
}
else
{
- // passing third argument by address
- ret_value = H5Awrite(id, mem_type.getId(), &strg_C);
+ // passing third argument by address
+ ret_value = H5Awrite(id, mem_type.getId(), &strg_C);
}
if (ret_value < 0)
{
- throw AttributeIException("Attribute::write", "H5Awrite failed");
+ throw AttributeIException("Attribute::write", "H5Awrite failed");
}
}
//--------------------------------------------------------------------------
-// Function: Attribute::read
-///\brief Reads data from this attribute.
-///\param mem_type - IN: Attribute datatype (in memory)
-///\param buf - OUT: Buffer for read data
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute::read
+///\brief Reads data from this attribute.
+///\param mem_type - IN: Attribute datatype (in memory)
+///\param buf - OUT: Buffer for read data
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void Attribute::read( const DataType& mem_type, void *buf ) const
+void Attribute::read(const DataType& mem_type, void *buf) const
{
- herr_t ret_value = H5Aread( id, mem_type.getId(), buf );
- if( ret_value < 0 )
- {
- throw AttributeIException("Attribute::read", "H5Aread failed");
- }
+ herr_t ret_value = H5Aread(id, mem_type.getId(), buf);
+ if (ret_value < 0)
+ {
+ throw AttributeIException("Attribute::read", "H5Aread failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: Attribute::read
-///\brief This is an overloaded member function, provided for convenience.
-/// It reads a \a H5std_string from this attribute.
-///\param mem_type - IN: Attribute datatype (in memory)
-///\param strg - IN: Buffer for read string
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Apr, 2003
+// Function: Attribute::read
+///\brief This is an overloaded member function, provided for convenience.
+/// It reads a \a H5std_string from this attribute.
+///\param mem_type - IN: Attribute datatype (in memory)
+///\param strg - IN: Buffer for read string
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Apr, 2003
// Modification
-// Mar 2008
-// Corrected a misunderstanding that H5Aread would allocate
-// space for the buffer. Obtained the attribute size and
-// allocated memory properly. -BMR
-// Apr 2009
-// Used getInMemDataSize to get attribute data size. -BMR
-// Jul 2009
-// Divided into specific private functions for fixed- and
-// variable-len string data: p_read_fixed_len and
-// p_read_variable_len. This should improve readability. -BMR
+// Mar 2008
+// Corrected a misunderstanding that H5Aread would allocate
+// space for the buffer. Obtained the attribute size and
+// allocated memory properly. -BMR
+// Apr 2009
+// Used getInMemDataSize to get attribute data size. -BMR
+// Jul 2009
+// Divided into specific private functions for fixed- and
+// variable-len string data: p_read_fixed_len and
+// p_read_variable_len. This should improve readability. -BMR
//--------------------------------------------------------------------------
void Attribute::read(const DataType& mem_type, H5std_string& strg) const
{
@@ -188,11 +188,11 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getInMemDataSize
-///\brief Gets the size in memory of the attribute's data.
-///\return Size of data (in memory)
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Apr 2009
+// Function: Attribute::getInMemDataSize
+///\brief Gets the size in memory of the attribute's data.
+///\return Size of data (in memory)
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Apr 2009
//--------------------------------------------------------------------------
size_t Attribute::getInMemDataSize() const
{
@@ -200,9 +200,9 @@ size_t Attribute::getInMemDataSize() const
// Get the data type of this attribute
hid_t mem_type_id = H5Aget_type(id);
- if( mem_type_id < 0 )
+ if (mem_type_id < 0)
{
- throw AttributeIException(func, "H5Aget_type failed");
+ throw AttributeIException(func, "H5Aget_type failed");
}
// Get the data type's size by first getting its native type then getting
@@ -210,22 +210,22 @@ size_t Attribute::getInMemDataSize() const
hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
if (native_type < 0)
{
- throw AttributeIException(func, "H5Tget_native_type failed");
+ throw AttributeIException(func, "H5Tget_native_type failed");
}
size_t type_size = H5Tget_size(native_type);
if (type_size == 0)
{
- throw AttributeIException(func, "H5Tget_size failed");
+ throw AttributeIException(func, "H5Tget_size failed");
}
// Close the native type and the datatype of this attribute.
if (H5Tclose(native_type) < 0)
{
- throw DataSetIException(func, "H5Tclose(native_type) failed");
+ throw DataSetIException(func, "H5Tclose(native_type) failed");
}
if (H5Tclose(mem_type_id) < 0)
{
- throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
+ throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
}
// Get number of elements of the attribute by first getting its dataspace
@@ -233,18 +233,18 @@ size_t Attribute::getInMemDataSize() const
hid_t space_id = H5Aget_space(id);
if (space_id < 0)
{
- throw AttributeIException(func, "H5Aget_space failed");
+ throw AttributeIException(func, "H5Aget_space failed");
}
hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
if (num_elements < 0)
{
- throw AttributeIException(func, "H5Sget_simple_extent_npoints failed");
+ throw AttributeIException(func, "H5Sget_simple_extent_npoints failed");
}
// Close the dataspace
if (H5Sclose(space_id) < 0)
{
- throw DataSetIException(func, "H5Sclose failed");
+ throw DataSetIException(func, "H5Sclose failed");
}
// Calculate and return the size of the data
@@ -253,46 +253,46 @@ size_t Attribute::getInMemDataSize() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getSpace
-///\brief Gets a copy of the dataspace for this attribute.
-///\return Dataspace instance
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute::getSpace
+///\brief Gets a copy of the dataspace for this attribute.
+///\return Dataspace instance
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace Attribute::getSpace() const
{
// Calls C function H5Aget_space to get the id of the dataspace
- hid_t dataspace_id = H5Aget_space( id );
+ hid_t dataspace_id = H5Aget_space(id);
// If the dataspace id is valid, create and return the DataSpace object
- if( dataspace_id > 0 )
- {
- DataSpace dataspace;
- f_DataSpace_setId(&dataspace, dataspace_id);
- return(dataspace);
- }
+ if (dataspace_id > 0)
+ {
+ DataSpace dataspace;
+ f_DataSpace_setId(&dataspace, dataspace_id);
+ return(dataspace);
+ }
else
- {
- throw AttributeIException("Attribute::getSpace", "H5Aget_space failed");
- }
+ {
+ throw AttributeIException("Attribute::getSpace", "H5Aget_space failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: Attribute::getName
-///\brief Gets the name of this attribute, returning its length.
-///\param attr_name - OUT: Buffer for the name string as char*
-///\param buf_size - IN: Length of the buffer, default to 0
-///\return Actual length of the attribute name
-///\exception H5::AttributeIException
+// Function: Attribute::getName
+///\brief Gets the name of this attribute, returning its length.
+///\param attr_name - OUT: Buffer for the name string as char*
+///\param buf_size - IN: Length of the buffer, default to 0
+///\return Actual length of the attribute name
+///\exception H5::AttributeIException
///\par Description
-/// This function retrieves \a buf_size chars of the attribute's
-/// name including null termination. Thus, if the actual length
-/// of the name is more than buf_size-1, the retrieved name will
-/// be truncated to accommodate the null terminator.
-/// To get length of the attribute's name for buffer allocation,
-/// an application can call this function passing in NULL for the
-/// first argument and ignore the second argument.
-// Programmer Binh-Minh Ribler - Mar, 2014
+/// This function retrieves \a buf_size chars of the attribute's
+/// name including null termination. Thus, if the actual length
+/// of the name is more than buf_size-1, the retrieved name will
+/// be truncated to accommodate the null terminator.
+/// To get length of the attribute's name for buffer allocation,
+/// an application can call this function passing in NULL for the
+/// first argument and ignore the second argument.
+// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
ssize_t Attribute::getName(char* attr_name, size_t buf_size) const
{
@@ -302,25 +302,25 @@ ssize_t Attribute::getName(char* attr_name, size_t buf_size) const
// If H5Aget_name returns a negative value, raise an exception
if (name_size < 0)
{
- throw AttributeIException("Attribute::getName", "H5Aget_name failed");
+ throw AttributeIException("Attribute::getName", "H5Aget_name failed");
}
else if (name_size == 0)
{
- throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
+ throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
}
// Return length of the name
return(name_size);
}
//--------------------------------------------------------------------------
-// Function: Attribute::getName
-///\brief Returns the name of this attribute as an \a H5std_string.
-///\return Name of the attribute
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: Attribute::getName
+///\brief Returns the name of this attribute as an \a H5std_string.
+///\return Name of the attribute
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - May, 2004
// Modification
-// Mar 2014 - BMR
-// Revised to use the modified getName() above
+// Mar 2014 - BMR
+// Revised to use the modified getName() above
//--------------------------------------------------------------------------
H5std_string Attribute::getName() const
{
@@ -332,11 +332,11 @@ H5std_string Attribute::getName() const
// If H5Aget_name failed, throw exception
if (name_size < 0)
{
- throw AttributeIException("Attribute::getName", "H5Aget_name failed");
+ throw AttributeIException("Attribute::getName", "H5Aget_name failed");
}
else if (name_size == 0)
{
- throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
+ throw AttributeIException("Attribute::getName", "Attribute must have a name, name length is 0");
}
// Attribute's name exists, retrieve it
else if (name_size > 0)
@@ -359,44 +359,44 @@ H5std_string Attribute::getName() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getName
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an integer
-/// specifying a desired length to be retrieved of the name.
-///\return Name (or part of name) of the attribute
-///\param len - IN: Desired length of the name
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute::getName
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an integer
+/// specifying a desired length to be retrieved of the name.
+///\return Name (or part of name) of the attribute
+///\param len - IN: Desired length of the name
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Mar 2014 - BMR
-// Revised to use the new getName() below
+// Mar 2014 - BMR
+// Revised to use the new getName() below
//--------------------------------------------------------------------------
H5std_string Attribute::getName(size_t len) const
{
H5std_string attr_name;
ssize_t name_size = getName(attr_name, len);
if (name_size < 0)
- return("");
+ return("");
else
- return(attr_name);
+ return(attr_name);
}
//--------------------------------------------------------------------------
-// Function: Attribute::getName
-///\brief Gets the name of this attribute, returning its length.
-///\param attr_name - OUT: Buffer for the name string as \a H5std_string
-///\param len - IN: Desired length of the name, default to 0
-///\return Actual length of the attribute name
-///\exception H5::AttributeIException
+// Function: Attribute::getName
+///\brief Gets the name of this attribute, returning its length.
+///\param attr_name - OUT: Buffer for the name string as \a H5std_string
+///\param len - IN: Desired length of the name, default to 0
+///\return Actual length of the attribute name
+///\exception H5::AttributeIException
///\par Description
-/// This function retrieves the attribute's name as a string. The
-/// buf_size can specify a specific length or default to 0, in
-/// which case the entire name will be retrieved.
-// Programmer Binh-Minh Ribler - Nov, 2001
+/// This function retrieves the attribute's name as a string. The
+/// buf_size can specify a specific length or default to 0, in
+/// which case the entire name will be retrieved.
+// Programmer Binh-Minh Ribler - Nov, 2001
// Modification
-// Mar 2014 - BMR
-// Added to replace getName(size_t, H5std_string&) so that it'll
-// allow the argument "len" to be skipped.
+// Mar 2014 - BMR
+// Added to replace getName(size_t, H5std_string&) so that it'll
+// allow the argument "len" to be skipped.
//--------------------------------------------------------------------------
ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
{
@@ -406,7 +406,7 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
if (len == 0)
{
attr_name = getName();
- name_size = attr_name.length();
+ name_size = attr_name.length();
}
// If length is provided, get that number of characters in name
else
@@ -430,33 +430,33 @@ ssize_t Attribute::getName(H5std_string& attr_name, size_t len) const
}
//--------------------------------------------------------------------------
-// Function: Attribute::getName
-// Purpose This function is replaced by the previous function, which
-// provides more convenient prototype. It will be removed
-// in future release.
-// Param len - IN: Desired length of the name
-// Param attr_name - OUT: Buffer for the name string
-// Return Actual length of the attribute name
-// Exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Nov, 2001
+// Function: Attribute::getName
+// Purpose This function is replaced by the previous function, which
+// provides more convenient prototype. It will be removed
+// in future release.
+// Param len - IN: Desired length of the name
+// Param attr_name - OUT: Buffer for the name string
+// Return Actual length of the attribute name
+// Exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Nov, 2001
// 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
+// 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
//--------------------------------------------------------------------------
-//ssize_t Attribute::getName( size_t len, H5std_string& attr_name ) const
+//ssize_t Attribute::getName(size_t len, H5std_string& attr_name) const
//{
// return (getName(attr_name, len));
//}
//--------------------------------------------------------------------------
-// Function: Attribute::getStorageSize
-///\brief Returns the amount of storage size required for this attribute.
-///\return Size of the storage or 0, for no data
-///\exception H5::AttributeIException
-// Note: H5Dget_storage_size returns 0 when there is no data. This
-// function should have no failure. (from SLU)
-// Programmer Binh-Minh Ribler - Mar, 2005
+// Function: Attribute::getStorageSize
+///\brief Returns the amount of storage size required for this attribute.
+///\return Size of the storage or 0, for no data
+///\exception H5::AttributeIException
+// Note: H5Dget_storage_size returns 0 when there is no data. This
+// function should have no failure. (from SLU)
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
hsize_t Attribute::getStorageSize() const
{
@@ -466,19 +466,19 @@ hsize_t Attribute::getStorageSize() const
//--------------------------------------------------------------------------
// Function: Attribute::getId
-///\brief Get the id of this attribute
-///\return Attribute identifier
+///\brief Get the id of this attribute
+///\return Attribute identifier
// Description:
-// 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
-// IdComponent::getId now becomes pure virtual function.
+// 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
+// IdComponent::getId now becomes pure virtual function.
// Programmer Binh-Minh Ribler - May, 2008
// Modification
-// Aug 2016 - BMR
-// Note that Attribute is now inheriting from H5Location, because
-// an attribute id can be used to specify a location in HDF5
-// library.
+// Aug 2016 - BMR
+// Note that Attribute is now inheriting from H5Location, because
+// an attribute id can be used to specify a location in HDF5
+// library.
//--------------------------------------------------------------------------
hid_t Attribute::getId() const
{
@@ -486,36 +486,36 @@ hid_t Attribute::getId() const
}
//--------------------------------------------------------------------------
-// Function: Attribute::p_get_type (private)
-// Purpose Gets the datatype of this attribute.
-// Return Id of the datatype
-// Exception H5::AttributeIException
+// Function: Attribute::p_get_type (private)
+// Purpose Gets the datatype of this attribute.
+// Return Id of the datatype
+// Exception H5::AttributeIException
// Description
-// This private function is used in AbstractDs.
-// Programmer Binh-Minh Ribler - 2000
+// This private function is used in AbstractDs.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hid_t Attribute::p_get_type() const
{
- hid_t type_id = H5Aget_type( id );
- if( type_id > 0 )
- return( type_id );
- else
- {
- throw AttributeIException("", "H5Aget_type failed");
- }
+ hid_t type_id = H5Aget_type(id);
+ if (type_id > 0)
+ return(type_id);
+ else
+ {
+ throw AttributeIException("", "H5Aget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: Attribute::p_read_fixed_len (private)
-// brief Reads a fixed length \a H5std_string from an attribute.
-// param mem_type - IN: Attribute datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// Function: Attribute::p_read_fixed_len (private)
+// brief Reads a fixed length \a H5std_string from an attribute.
+// param mem_type - IN: Attribute datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Jul, 2009
// Modification
-// Jul 2009
-// Separated the fixed length case from the original
-// Attribute::read
+// Jul 2009
+// Separated the fixed length case from the original
+// Attribute::read
//--------------------------------------------------------------------------
void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const
{
@@ -527,31 +527,31 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c
// If there is data, allocate buffer and read it.
if (attr_size > 0)
{
- char *strg_C = new char[attr_size+1];
- herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C);
- if( ret_value < 0 )
- {
- delete []strg_C; // de-allocate for fixed-len string
- throw AttributeIException("Attribute::read", "H5Aread failed");
- }
- // Get string from the C char* and release resource allocated locally
- strg_C[attr_size] = '\0';
- strg = strg_C;
- delete []strg_C;
+ char *strg_C = new char[attr_size+1];
+ herr_t ret_value = H5Aread(id, mem_type.getId(), strg_C);
+ if (ret_value < 0)
+ {
+ delete []strg_C; // de-allocate for fixed-len string
+ throw AttributeIException("Attribute::read", "H5Aread failed");
+ }
+ // Get string from the C char* and release resource allocated locally
+ strg_C[attr_size] = '\0';
+ strg = strg_C;
+ delete []strg_C;
}
}
//--------------------------------------------------------------------------
-// Function: Attribute::p_read_variable_len (private)
-// brief Reads a variable length \a H5std_string from an attribute.
-// param mem_type - IN: Attribute datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// Function: Attribute::p_read_variable_len (private)
+// brief Reads a variable length \a H5std_string from an attribute.
+// param mem_type - IN: Attribute datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Jul, 2009
// Modification
-// Jul 2009
-// Separated the variable length case from the original
-// Attribute::read. -BMR
+// Jul 2009
+// Separated the variable length case from the original
+// Attribute::read. -BMR
//--------------------------------------------------------------------------
void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const
{
@@ -561,9 +561,9 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg
// Read attribute, no allocation for variable-len string; C library will
herr_t ret_value = H5Aread(id, mem_type.getId(), &strg_C);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw AttributeIException("Attribute::read", "H5Aread failed");
+ throw AttributeIException("Attribute::read", "H5Aread failed");
}
// Get string from the C char* and release resource allocated by C API
@@ -577,65 +577,65 @@ void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg
///\brief Sets the identifier of this object to a new value.
///
///\exception H5::IdComponentException when the attempt to close the HDF5
-/// object fails
+/// object fails
// Description:
-// The underlaying reference counting in the C library ensures
-// that the current valid id of this object is properly closed.
-// Then the object's id is reset to the new id.
+// The underlaying reference counting in the C library ensures
+// that the current valid id of this object is properly closed.
+// Then the object's id is reset to the new id.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Attribute::p_setId(const hid_t new_id)
{
// handling references to this old id
try {
- close();
+ close();
}
catch (Exception& close_error) {
- throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
+ throw AttributeIException("Attribute::p_setId", close_error.getDetailMsg());
}
- // reset object's id to the given id
- id = new_id;
+ // reset object's id to the given id
+ id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: Attribute::close
-///\brief Closes this attribute.
+// Function: Attribute::close
+///\brief Closes this attribute.
///
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void Attribute::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Aclose(id);
- if( ret_value < 0 )
- {
- throw AttributeIException("Attribute::close", "H5Aclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Aclose(id);
+ if (ret_value < 0)
+ {
+ throw AttributeIException("Attribute::close", "H5Aclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: Attribute destructor
-///\brief Properly terminates access to this attribute.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Attribute destructor
+///\brief Properly terminates access to this attribute.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
Attribute::~Attribute()
{
try {
- close();
+ close();
}
catch (Exception& close_error) {
- cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl;
+ cerr << "Attribute::~Attribute - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h
index c27bbdf..0243cd9 100644
--- a/c++/src/H5Attribute.h
+++ b/c++/src/H5Attribute.h
@@ -32,74 +32,74 @@ namespace H5 {
class H5_DLLCPP Attribute : public AbstractDs, public H5Location {
public:
- // Copy constructor: makes a copy of an existing Attribute object.
- Attribute( const Attribute& original );
+ // Copy constructor: makes a copy of an existing Attribute object.
+ Attribute(const Attribute& original);
- // Default constructor
- Attribute();
+ // Default constructor
+ Attribute();
- // Creates a copy of an existing attribute using the attribute id
- Attribute( const hid_t attr_id );
+ // Creates a copy of an existing attribute using the attribute id
+ Attribute(const hid_t attr_id);
- // Closes this attribute.
- virtual void close();
+ // Closes this attribute.
+ virtual void close();
- // Gets the name of this attribute.
- ssize_t getName(char* attr_name, size_t buf_size = 0) const;
- H5std_string getName(size_t len) const;
- H5std_string getName() const;
- ssize_t getName(H5std_string& attr_name, size_t len = 0) const;
- // The overloaded function below is replaced by the one above and it
- // is kept for backward compatibility purpose.
- ssize_t getName( size_t buf_size, H5std_string& attr_name ) const;
+ // Gets the name of this attribute.
+ ssize_t getName(char* attr_name, size_t buf_size = 0) const;
+ H5std_string getName(size_t len) const;
+ H5std_string getName() const;
+ ssize_t getName(H5std_string& attr_name, size_t len = 0) const;
+ // The overloaded function below is replaced by the one above and it
+ // is kept for backward compatibility purpose.
+ ssize_t getName(size_t buf_size, H5std_string& attr_name) const;
- // Gets a copy of the dataspace for this attribute.
- virtual DataSpace getSpace() const;
+ // Gets a copy of the dataspace for this attribute.
+ virtual DataSpace getSpace() const;
- // Returns the amount of storage size required for this attribute.
- virtual hsize_t getStorageSize() const;
+ // Returns the amount of storage size required for this attribute.
+ virtual hsize_t getStorageSize() const;
- // Returns the in memory size of this attribute's data.
- virtual size_t getInMemDataSize() const;
+ // Returns the in memory size of this attribute's data.
+ virtual size_t getInMemDataSize() const;
- // Reads data from this attribute.
- void read( const DataType& mem_type, void *buf ) const;
- void read( const DataType& mem_type, H5std_string& strg ) const;
+ // Reads data from this attribute.
+ void read(const DataType& mem_type, void *buf) const;
+ void read(const DataType& mem_type, H5std_string& strg) const;
- // Writes data to this attribute.
- void write(const DataType& mem_type, const void *buf ) const;
- void write(const DataType& mem_type, const H5std_string& strg ) const;
+ // Writes data to this attribute.
+ void write(const DataType& mem_type, const void *buf) const;
+ void write(const DataType& mem_type, const H5std_string& strg) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("Attribute"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("Attribute"); }
- // Gets the attribute id.
- virtual hid_t getId() const;
+ // Gets the attribute id.
+ virtual hid_t getId() const;
- // Destructor: properly terminates access to this attribute.
- virtual ~Attribute();
+ // Destructor: properly terminates access to this attribute.
+ virtual ~Attribute();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
protected:
- // Sets the attribute id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the attribute id.
+ virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- hid_t id; // HDF5 attribute id
+ hid_t id; // HDF5 attribute id
- // This function contains the common code that is used by
- // getTypeClass and various API functions getXxxType
- // defined in AbstractDs for generic datatype and specific
- // sub-types
- virtual hid_t p_get_type() const;
+ // This function contains the common code that is used by
+ // getTypeClass and various API functions getXxxType
+ // defined in AbstractDs for generic datatype and specific
+ // sub-types
+ virtual hid_t p_get_type() const;
- // Reads variable or fixed len strings from this attribute.
- void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const;
- void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const;
+ // Reads variable or fixed len strings from this attribute.
+ void p_read_variable_len(const DataType& mem_type, H5std_string& strg) const;
+ void p_read_fixed_len(const DataType& mem_type, H5std_string& strg) const;
- // Friend function to set Attribute id. For library use only.
- friend void f_Attribute_setId(Attribute* attr, hid_t new_id);
+ // Friend function to set Attribute id. For library use only.
+ friend void f_Attribute_setId(Attribute* attr, hid_t new_id);
};
}
diff --git a/c++/src/H5Classes.h b/c++/src/H5Classes.h
index 03faa1a..00066fe 100644
--- a/c++/src/H5Classes.h
+++ b/c++/src/H5Classes.h
@@ -18,31 +18,31 @@
#define __H5Classes_H
namespace H5 {
- class Exception;
- class IdComponent;
- class H5Location;
- class H5Object;
- class PropList;
- class FileCreatPropList;
- class FileAccPropList;
- class LinkAccPropList;
- class DSetCreatPropList;
- class DSetMemXferPropList;
- class DTypePropList;
- class DataType;
- class DataSpace;
- class AtomType;
- class PredType;
- class EnumType;
- class IntType;
- class FloatType;
- class StrType;
- class CompType;
- class AbstractDs;
- class DataSet;
- class Group;
- class H5File;
- class Attribute;
- class H5Library;
+ class Exception;
+ class IdComponent;
+ class H5Location;
+ class H5Object;
+ class PropList;
+ class FileCreatPropList;
+ class FileAccPropList;
+ class LinkAccPropList;
+ class DSetCreatPropList;
+ class DSetMemXferPropList;
+ class DTypePropList;
+ class DataType;
+ class DataSpace;
+ class AtomType;
+ class PredType;
+ class EnumType;
+ class IntType;
+ class FloatType;
+ class StrType;
+ class CompType;
+ class AbstractDs;
+ class DataSet;
+ class Group;
+ class H5File;
+ class Attribute;
+ class H5Library;
}
#endif // __H5Classes_H
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index 5f7971f..5c01055 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -16,7 +16,7 @@
#include <string>
#include "H5Include.h"
-#include "H5private.h" // for HDstrcpy
+#include "H5private.h" // for HDstrcpy
#include "H5Exception.h"
#include "H5IdComponent.h"
#include "H5DataSpace.h"
@@ -46,293 +46,292 @@
// December 2000
namespace H5 {
-using namespace std;
//--------------------------------------------------------------------------
-// Function: CommonFG::openDataType
-///\brief Opens the named generic datatype at this location.
-///\param name - IN: Name of the datatype to open
-///\return DataType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openDataType
+///\brief Opens the named generic datatype at this location.
+///\param name - IN: Name of the datatype to open
+///\return DataType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType CommonFG::openDataType( const char* name ) const
+DataType CommonFG::openDataType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openDataType", "H5Topen2 failed");
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openDataType", "H5Topen2 failed");
- // No failure, create and return the DataType object
- DataType data_type(type_id);
- return(data_type);
+ // No failure, create and return the DataType object
+ DataType data_type(type_id);
+ return(data_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openDataType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openDataType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType CommonFG::openDataType( const H5std_string& name ) const
+DataType CommonFG::openDataType(const H5std_string& name) const
{
- return( openDataType( name.c_str()) );
+ return(openDataType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openArrayType
-///\brief Opens the named array datatype at this location.
-///\param name - IN: Name of the array datatype to open
-///\return ArrayType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CommonFG::openArrayType
+///\brief Opens the named array datatype at this location.
+///\param name - IN: Name of the array datatype to open
+///\return ArrayType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-ArrayType CommonFG::openArrayType( const char* name ) const
+ArrayType CommonFG::openArrayType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openArrayType", "H5Topen2 failed");
-
- // No failure, create and return the ArrayType object
- ArrayType array_type;
- f_DataType_setId(&array_type, type_id);
- return(array_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openArrayType", "H5Topen2 failed");
+
+ // No failure, create and return the ArrayType object
+ ArrayType array_type;
+ f_DataType_setId(&array_type, type_id);
+ return(array_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openArrayType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CommonFG::openArrayType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-ArrayType CommonFG::openArrayType( const H5std_string& name ) const
+ArrayType CommonFG::openArrayType(const H5std_string& name) const
{
- return( openArrayType( name.c_str()) );
+ return(openArrayType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openCompType
-///\brief Opens the named compound datatype at this location.
-///\param name - IN: Name of the compound datatype to open
-///\return CompType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openCompType
+///\brief Opens the named compound datatype at this location.
+///\param name - IN: Name of the compound datatype to open
+///\return CompType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType CommonFG::openCompType( const char* name ) const
+CompType CommonFG::openCompType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openCompType", "H5Topen2 failed");
-
- // No failure, create and return the CompType object
- CompType comp_type;
- f_DataType_setId(&comp_type, type_id);
- return(comp_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openCompType", "H5Topen2 failed");
+
+ // No failure, create and return the CompType object
+ CompType comp_type;
+ f_DataType_setId(&comp_type, type_id);
+ return(comp_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openCompType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openCompType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType CommonFG::openCompType( const H5std_string& name ) const
+CompType CommonFG::openCompType(const H5std_string& name) const
{
- return( openCompType( name.c_str()) );
+ return(openCompType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openEnumType
-///\brief Opens the named enumeration datatype at this location.
-///\param name - IN: Name of the enumeration datatype to open
-///\return EnumType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openEnumType
+///\brief Opens the named enumeration datatype at this location.
+///\param name - IN: Name of the enumeration datatype to open
+///\return EnumType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType CommonFG::openEnumType( const char* name ) const
+EnumType CommonFG::openEnumType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openEnumType", "H5Topen2 failed");
-
- // No failure, create and return the EnumType object
- EnumType enum_type;
- f_DataType_setId(&enum_type, type_id);
- return(enum_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openEnumType", "H5Topen2 failed");
+
+ // No failure, create and return the EnumType object
+ EnumType enum_type;
+ f_DataType_setId(&enum_type, type_id);
+ return(enum_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openEnumType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openEnumType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType CommonFG::openEnumType( const H5std_string& name ) const
+EnumType CommonFG::openEnumType(const H5std_string& name) const
{
- return( openEnumType( name.c_str()) );
+ return(openEnumType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openIntType
-///\brief Opens the named integer datatype at this location.
-///\param name - IN: Name of the integer datatype to open
-///\return IntType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openIntType
+///\brief Opens the named integer datatype at this location.
+///\param name - IN: Name of the integer datatype to open
+///\return IntType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType CommonFG::openIntType( const char* name ) const
+IntType CommonFG::openIntType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openIntType", "H5Topen2 failed");
-
- // No failure, create and return the IntType object
- IntType int_type;
- f_DataType_setId(&int_type, type_id);
- return(int_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openIntType", "H5Topen2 failed");
+
+ // No failure, create and return the IntType object
+ IntType int_type;
+ f_DataType_setId(&int_type, type_id);
+ return(int_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openIntType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openIntType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType CommonFG::openIntType( const H5std_string& name ) const
+IntType CommonFG::openIntType(const H5std_string& name) const
{
- return( openIntType( name.c_str()) );
+ return(openIntType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openFloatType
-///\brief Opens the named floating-point datatype at this location.
-///\param name - IN: Name of the floating-point datatype to open
-///\return FloatType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openFloatType
+///\brief Opens the named floating-point datatype at this location.
+///\param name - IN: Name of the floating-point datatype to open
+///\return FloatType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType CommonFG::openFloatType( const char* name ) const
+FloatType CommonFG::openFloatType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openFloatType", "H5Topen2 failed");
-
- // No failure, create and return the FloatType object
- FloatType float_type;
- f_DataType_setId(&float_type, type_id);
- return(float_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openFloatType", "H5Topen2 failed");
+
+ // No failure, create and return the FloatType object
+ FloatType float_type;
+ f_DataType_setId(&float_type, type_id);
+ return(float_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openFloatType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openFloatType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType CommonFG::openFloatType( const H5std_string& name ) const
+FloatType CommonFG::openFloatType(const H5std_string& name) const
{
- return( openFloatType( name.c_str()) );
+ return(openFloatType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openStrType
-///\brief Opens the named string datatype at this location.
-///\param name - IN: Name of the string datatype to open
-///\return StrType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openStrType
+///\brief Opens the named string datatype at this location.
+///\param name - IN: Name of the string datatype to open
+///\return StrType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType CommonFG::openStrType( const char* name ) const
+StrType CommonFG::openStrType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openStrType", "H5Topen2 failed");
-
- // No failure, create and return the StrType object
- StrType str_type;
- f_DataType_setId(&str_type, type_id);
- return(str_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openStrType", "H5Topen2 failed");
+
+ // No failure, create and return the StrType object
+ StrType str_type;
+ f_DataType_setId(&str_type, type_id);
+ return(str_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openStrType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: CommonFG::openStrType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType CommonFG::openStrType( const H5std_string& name ) const
+StrType CommonFG::openStrType(const H5std_string& name) const
{
- return( openStrType( name.c_str()) );
+ return(openStrType(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openVarLenType
-///\brief Opens the named variable length datatype at this location.
-///\param name - IN: Name of the variable length datatype to open
-///\return VarLenType instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CommonFG::openVarLenType
+///\brief Opens the named variable length datatype at this location.
+///\param name - IN: Name of the variable length datatype to open
+///\return VarLenType instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-VarLenType CommonFG::openVarLenType( const char* name ) const
+VarLenType CommonFG::openVarLenType(const char* name) const
{
- // Call C function H5Topen2 to open the named datatype in this group,
- // given either the file or group id
- hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
-
- // If the datatype's opening failed, throw an exception
- if( type_id < 0 )
- throwException("openVarLenType", "H5Topen2 failed");
-
- // No failure, create and return the VarLenType object
- VarLenType varlen_type;
- f_DataType_setId(&varlen_type, type_id);
- return(varlen_type);
+ // Call C function H5Topen2 to open the named datatype in this group,
+ // given either the file or group id
+ hid_t type_id = H5Topen2(getLocId(), name, H5P_DEFAULT);
+
+ // If the datatype's opening failed, throw an exception
+ if (type_id < 0)
+ throwException("openVarLenType", "H5Topen2 failed");
+
+ // No failure, create and return the VarLenType object
+ VarLenType varlen_type;
+ f_DataType_setId(&varlen_type, type_id);
+ return(varlen_type);
}
//--------------------------------------------------------------------------
-// Function: CommonFG::openVarLenType
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CommonFG::openVarLenType
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-VarLenType CommonFG::openVarLenType( const H5std_string& name ) const
+VarLenType CommonFG::openVarLenType(const H5std_string& name) const
{
- return( openVarLenType( name.c_str()) );
+ return(openVarLenType(name.c_str()));
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h
index 59f425c..588d49a 100644
--- a/c++/src/H5CommonFG.h
+++ b/c++/src/H5CommonFG.h
@@ -32,55 +32,55 @@ class VarLenType;
*/
class H5_DLLCPP CommonFG {
public:
- // Opens a generic named datatype in this location.
- DataType openDataType(const char* name) const;
- DataType openDataType(const H5std_string& name) const;
+ // Opens a generic named datatype in this location.
+ DataType openDataType(const char* name) const;
+ DataType openDataType(const H5std_string& name) const;
- // Opens a named array datatype in this location.
- ArrayType openArrayType(const char* name) const;
- ArrayType openArrayType(const H5std_string& name) const;
+ // Opens a named array datatype in this location.
+ ArrayType openArrayType(const char* name) const;
+ ArrayType openArrayType(const H5std_string& name) const;
- // Opens a named compound datatype in this location.
- CompType openCompType(const char* name) const;
- CompType openCompType(const H5std_string& name) const;
+ // Opens a named compound datatype in this location.
+ CompType openCompType(const char* name) const;
+ CompType openCompType(const H5std_string& name) const;
- // Opens a named enumeration datatype in this location.
- EnumType openEnumType(const char* name) const;
- EnumType openEnumType(const H5std_string& name) const;
+ // Opens a named enumeration datatype in this location.
+ EnumType openEnumType(const char* name) const;
+ EnumType openEnumType(const H5std_string& name) const;
- // Opens a named integer datatype in this location.
- IntType openIntType(const char* name) const;
- IntType openIntType(const H5std_string& name) const;
+ // Opens a named integer datatype in this location.
+ IntType openIntType(const char* name) const;
+ IntType openIntType(const H5std_string& name) const;
- // Opens a named floating-point datatype in this location.
- FloatType openFloatType(const char* name) const;
- FloatType openFloatType(const H5std_string& name) const;
+ // Opens a named floating-point datatype in this location.
+ FloatType openFloatType(const char* name) const;
+ FloatType openFloatType(const H5std_string& name) const;
- // Opens a named string datatype in this location.
- StrType openStrType(const char* name) const;
- StrType openStrType(const H5std_string& name) const;
+ // Opens a named string datatype in this location.
+ StrType openStrType(const char* name) const;
+ StrType openStrType(const H5std_string& name) const;
- // Opens a named variable length datatype in this location.
- VarLenType openVarLenType(const char* name) const;
- VarLenType openVarLenType(const H5std_string& name) const;
+ // Opens a named variable length datatype in this location.
+ VarLenType openVarLenType(const char* name) const;
+ VarLenType openVarLenType(const H5std_string& name) const;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- /// For subclasses, H5File and Group, to return the correct
- /// object id, i.e. file or group id.
- virtual hid_t getLocId() const = 0;
+ /// For subclasses, H5File and Group, to return the correct
+ /// object id, i.e. file or group id.
+ virtual hid_t getLocId() const = 0;
- /// For subclasses, H5File and Group, to throw appropriate exception.
- virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0;
+ /// For subclasses, H5File and Group, to throw appropriate exception.
+ virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const = 0;
- // Default constructor.
- CommonFG();
+ // Default constructor.
+ CommonFG();
- // Noop destructor.
- virtual ~CommonFG();
+ // Noop destructor.
+ virtual ~CommonFG();
protected:
- virtual void p_setId(const hid_t new_id) = 0;
+ virtual void p_setId(const hid_t new_id) = 0;
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp
index babda34..037527f 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -33,203 +33,203 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: CompType default constructor
-///\brief Default constructor: Creates a stub compound datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType default constructor
+///\brief Default constructor: Creates a stub compound datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
CompType::CompType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: CompType copy constructor
-///\brief Copy constructor: makes copy of the original CompType object
-///\param original - IN: Original CompType instance
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType copy constructor
+///\brief Copy constructor: makes copy of the original CompType object
+///\param original - IN: Original CompType instance
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType( const CompType& original ) : DataType( original ) {}
+CompType::CompType(const CompType& original) : DataType(original) {}
//--------------------------------------------------------------------------
-// Function: CompType overloaded constructor
-///\brief Creates a CompType object using the id of an existing datatype.
-///\param existing_id - IN: Id of an existing compound datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType overloaded constructor
+///\brief Creates a CompType object using the id of an existing datatype.
+///\param existing_id - IN: Id of an existing compound datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType( const hid_t existing_id ) : DataType( existing_id ) {}
+CompType::CompType(const hid_t existing_id) : DataType(existing_id) {}
//--------------------------------------------------------------------------
-// Function: CompType overloaded constructor
-///\brief Creates an empty compound datatype given a size, in bytes.
-///\param size - IN: Number of bytes in the datatype to create
-///\exception H5::DataTypeIException
+// Function: CompType overloaded constructor
+///\brief Creates an empty compound datatype given a size, in bytes.
+///\param size - IN: Number of bytes in the datatype to create
+///\exception H5::DataTypeIException
// Description
-// The DataType constructor calls the C API H5Tcreate to create
-// the compound datatype.
-// Programmer Binh-Minh Ribler - 2000
+// The DataType constructor calls the C API H5Tcreate to create
+// the compound datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType( size_t size ) : DataType( H5T_COMPOUND, size ) {}
+CompType::CompType(size_t size) : DataType(H5T_COMPOUND, size) {}
//--------------------------------------------------------------------------
-// Function: CompType overloaded constructor
-///\brief Gets the compound datatype of the specified dataset.
-///\param dataset - IN: Dataset that this enum datatype associates with
-///\return CompType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType overloaded constructor
+///\brief Gets the compound datatype of the specified dataset.
+///\param dataset - IN: Dataset that this enum datatype associates with
+///\return CompType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType::CompType( const DataSet& dataset ) : DataType()
+CompType::CompType(const DataSet& dataset) : DataType()
{
- // Calls C function H5Dget_type to get the id of the datatype
- id = H5Dget_type( dataset.getId() );
-
- // If the datatype id is invalid, throw exception
- if( id < 0 )
- {
- throw DataSetIException("CompType constructor", "H5Dget_type failed");
- }
+ // Calls C function H5Dget_type to get the id of the datatype
+ id = H5Dget_type(dataset.getId());
+
+ // If the datatype id is invalid, throw exception
+ if (id < 0)
+ {
+ throw DataSetIException("CompType constructor", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType overloaded constructor
-///\brief Creates an CompType instance by opening an HDF5 compound
-/// given its name, provided as a C character string.
-///\param dtype_name - IN: Compound type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// Function: CompType overloaded constructor
+///\brief Creates an CompType instance by opening an HDF5 compound
+/// given its name, provided as a C character string.
+///\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
-// existing function CommonFG::openCompType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openCompType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
CompType::CompType(const H5Location& loc, const char *dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name);
+ id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Compound type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openCompType(const H5Location&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openCompType(const H5Location&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: CompType::getNmembers
-///\brief Returns the number of members in this compound datatype.
-///\return Number of members
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getNmembers
+///\brief Returns the number of members in this compound datatype.
+///\return Number of members
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int CompType::getNmembers() const
{
- int num_members = H5Tget_nmembers( id );
- if( num_members < 0 )
- {
- throw DataTypeIException("CompType::getNmembers",
- "H5Tget_nmembers returns negative number of members");
- }
- return( num_members );
+ int num_members = H5Tget_nmembers(id);
+ if (num_members < 0)
+ {
+ throw DataTypeIException("CompType::getNmembers",
+ "H5Tget_nmembers returns negative number of members");
+ }
+ return(num_members);
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberName
-///\brief Returns the name of a member in this compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return Name of member
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberName
+///\brief Returns the name of a member in this compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return Name of member
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string CompType::getMemberName( unsigned member_num ) const
+H5std_string CompType::getMemberName(unsigned member_num) const
{
- char* member_name_C = H5Tget_member_name( id, member_num );
- if( member_name_C == NULL ) // NULL means failure
+ char* member_name_C = H5Tget_member_name(id, member_num);
+ if (member_name_C == NULL) // NULL means failure
{
- throw DataTypeIException("CompType::getMemberName",
- "H5Tget_member_name returns NULL for member name");
+ throw DataTypeIException("CompType::getMemberName",
+ "H5Tget_member_name returns NULL for member name");
}
H5std_string member_name = H5std_string(member_name_C); // convert C string to string
H5free_memory(member_name_C); // free the C string
- return( member_name ); // return the member name string
+ return(member_name); // return the member name string
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberIndex
-///\brief Returns the index of a member in this compound datatype.
-///\param name - IN: Name of the member
-///\return Index of member
-///\exception H5::DataTypeIException
+// Function: CompType::getMemberIndex
+///\brief Returns the index of a member in this compound datatype.
+///\param name - IN: Name of the member
+///\return Index of member
+///\exception H5::DataTypeIException
///\par Description
-/// Members are stored in no particular order with numbers 0
-/// through N-1, where N is the value returned by the member
-/// function \c CompType::getNmembers.
-// Programmer Binh-Minh Ribler - May 16, 2002
+/// Members are stored in no particular order with numbers 0
+/// through N-1, where N is the value returned by the member
+/// function \c CompType::getNmembers.
+// Programmer Binh-Minh Ribler - May 16, 2002
//--------------------------------------------------------------------------
int CompType::getMemberIndex(const char* name) const
{
- int member_index = H5Tget_member_index(id, name);
- if( member_index < 0 )
- {
- throw DataTypeIException("CompType::getMemberIndex",
- "H5Tget_member_index returns negative value");
- }
- return( member_index );
+ int member_index = H5Tget_member_index(id, name);
+ if (member_index < 0)
+ {
+ throw DataTypeIException("CompType::getMemberIndex",
+ "H5Tget_member_index returns negative value");
+ }
+ return(member_index);
}
int CompType::getMemberIndex(const H5std_string& name) const
{
- return(getMemberIndex(name.c_str()));
+ return(getMemberIndex(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberOffset
-///\brief Returns the byte offset of the beginning of a member with
-/// respect to the beginning of the compound data type datum.
-///\param member_num - IN: Zero-based index of the member
-///\return Byte offset
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberOffset
+///\brief Returns the byte offset of the beginning of a member with
+/// respect to the beginning of the compound data type datum.
+///\param member_num - IN: Zero-based index of the member
+///\return Byte offset
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
// Description
-/// Members are stored in no particular order with numbers 0
-/// through N-1, where N is the value returned by the member
-/// function \c CompType::getNmembers.
+/// Members are stored in no particular order with numbers 0
+/// through N-1, where N is the value returned by the member
+/// function \c CompType::getNmembers.
//
-// Note that byte offset being returned as 0 doesn't indicate
-// a failure. (According to Quincey)
+// Note that byte offset being returned as 0 doesn't indicate
+// a failure. (According to Quincey)
//--------------------------------------------------------------------------
-size_t CompType::getMemberOffset( unsigned member_num ) const
+size_t CompType::getMemberOffset(unsigned member_num) const
{
- size_t offset = H5Tget_member_offset( id, member_num );
- return( offset );
+ size_t offset = H5Tget_member_offset(id, member_num);
+ return(offset);
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberClass
-///\brief Gets the type class of the specified member.
-///\param member_num - IN: Zero-based index of the member
-///\return Type class of the member
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberClass
+///\brief Gets the type class of the specified member.
+///\param member_num - IN: Zero-based index of the member
+///\return Type class of the member
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Modified to use H5Tget_member_class instead. - Jul, 2005
+// Modified to use H5Tget_member_class instead. - Jul, 2005
//--------------------------------------------------------------------------
-H5T_class_t CompType::getMemberClass( unsigned member_num ) const
+H5T_class_t CompType::getMemberClass(unsigned member_num) const
{
- H5T_class_t member_class = H5Tget_member_class(id, member_num);
- if( member_class == H5T_NO_CLASS )
- {
- throw DataTypeIException("CompType::getMemberClass",
- "H5Tget_member_class returns H5T_NO_CLASS");
- }
- return(member_class);
+ H5T_class_t member_class = H5Tget_member_class(id, member_num);
+ if (member_class == H5T_NO_CLASS)
+ {
+ throw DataTypeIException("CompType::getMemberClass",
+ "H5Tget_member_class returns H5T_NO_CLASS");
+ }
+ return(member_class);
}
// This private member function calls the C API to get the identifier
@@ -238,184 +238,184 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const
// the sub-types.
hid_t CompType::p_get_member_type(unsigned member_num) const
{
- // get the id of the specified member first
- hid_t member_type_id = H5Tget_member_type( id, member_num );
- if( member_type_id > 0 )
- return( member_type_id );
- else
- {
- // p_get_member_type is private, caller will catch this exception
- // then throw another with appropriate API name
- throw DataTypeIException("", "H5Tget_member_type failed");
- }
+ // get the id of the specified member first
+ hid_t member_type_id = H5Tget_member_type(id, member_num);
+ if (member_type_id > 0)
+ return(member_type_id);
+ else
+ {
+ // p_get_member_type is private, caller will catch this exception
+ // then throw another with appropriate API name
+ throw DataTypeIException("", "H5Tget_member_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberDataType
-///\brief Returns the generic datatype of the specified member in this
-/// compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return DataType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberDataType
+///\brief Returns the generic datatype of the specified member in this
+/// compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return DataType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType CompType::getMemberDataType( unsigned member_num ) const
+DataType CompType::getMemberDataType(unsigned member_num) const
{
- try {
- DataType datatype;
- f_DataType_setId(&datatype, p_get_member_type(member_num));
- return(datatype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg());
- }
+ try {
+ DataType datatype;
+ f_DataType_setId(&datatype, p_get_member_type(member_num));
+ return(datatype);
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberDataType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberArrayType
-///\brief Returns the array datatype of the specified member in this
-/// compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return ArrayType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CompType::getMemberArrayType
+///\brief Returns the array datatype of the specified member in this
+/// compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return ArrayType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-ArrayType CompType::getMemberArrayType( unsigned member_num ) const
+ArrayType CompType::getMemberArrayType(unsigned member_num) const
{
- try {
- ArrayType arraytype(p_get_member_type(member_num));
- f_DataType_setId(&arraytype, p_get_member_type(member_num));
- return(arraytype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg());
- }
+ try {
+ ArrayType arraytype(p_get_member_type(member_num));
+ f_DataType_setId(&arraytype, p_get_member_type(member_num));
+ return(arraytype);
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberArrayType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberCompType
-///\brief Returns the compound datatype of the specified member in this
-/// compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return CompType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberCompType
+///\brief Returns the compound datatype of the specified member in this
+/// compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return CompType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-CompType CompType::getMemberCompType( unsigned member_num ) const
+CompType CompType::getMemberCompType(unsigned member_num) const
{
try {
CompType comptype(p_get_member_type(member_num));
- f_DataType_setId(&comptype, p_get_member_type(member_num));
+ f_DataType_setId(&comptype, p_get_member_type(member_num));
return(comptype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberCompType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberEnumType
-///\brief Returns the enumeration datatype of the specified member in
-/// this compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return EnumType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberEnumType
+///\brief Returns the enumeration datatype of the specified member in
+/// this compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return EnumType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType CompType::getMemberEnumType( unsigned member_num ) const
+EnumType CompType::getMemberEnumType(unsigned member_num) const
{
try {
EnumType enumtype(p_get_member_type(member_num));
- f_DataType_setId(&enumtype, p_get_member_type(member_num));
+ f_DataType_setId(&enumtype, p_get_member_type(member_num));
return(enumtype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberEnumType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberIntType
-///\brief Returns the integer datatype of the specified member in this
-/// compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return IntType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberIntType
+///\brief Returns the integer datatype of the specified member in this
+/// compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return IntType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType CompType::getMemberIntType( unsigned member_num ) const
+IntType CompType::getMemberIntType(unsigned member_num) const
{
try {
IntType inttype(p_get_member_type(member_num));
- f_DataType_setId(&inttype, p_get_member_type(member_num));
+ f_DataType_setId(&inttype, p_get_member_type(member_num));
return(inttype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberIntType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberFloatType
-///\brief Returns the floating-point datatype of the specified member
-/// in this compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return FloatType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberFloatType
+///\brief Returns the floating-point datatype of the specified member
+/// in this compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return FloatType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType CompType::getMemberFloatType( unsigned member_num ) const
+FloatType CompType::getMemberFloatType(unsigned member_num) const
{
try {
FloatType floatype(p_get_member_type(member_num));
- f_DataType_setId(&floatype, p_get_member_type(member_num));
+ f_DataType_setId(&floatype, p_get_member_type(member_num));
return(floatype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberFloatType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberStrType
-///\brief Returns the string datatype of the specified member in this
-/// compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return StrType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::getMemberStrType
+///\brief Returns the string datatype of the specified member in this
+/// compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return StrType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType CompType::getMemberStrType( unsigned member_num ) const
+StrType CompType::getMemberStrType(unsigned member_num) const
{
try {
StrType strtype(p_get_member_type(member_num));
- f_DataType_setId(&strtype, p_get_member_type(member_num));
+ f_DataType_setId(&strtype, p_get_member_type(member_num));
return(strtype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::getMemberVarLenType
-///\brief Returns the variable length datatype of the specified member
-/// in this compound datatype.
-///\param member_num - IN: Zero-based index of the member
-///\return VarLenType instance
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: CompType::getMemberVarLenType
+///\brief Returns the variable length datatype of the specified member
+/// in this compound datatype.
+///\param member_num - IN: Zero-based index of the member
+///\return VarLenType instance
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-VarLenType CompType::getMemberVarLenType( unsigned member_num ) const
+VarLenType CompType::getMemberVarLenType(unsigned member_num) const
{
try {
VarLenType varlentype(p_get_member_type(member_num));
- f_DataType_setId(&varlentype, p_get_member_type(member_num));
+ f_DataType_setId(&varlentype, p_get_member_type(member_num));
return(varlentype);
- }
- catch (DataTypeIException& E) {
- throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg());
- }
+ }
+ catch (DataTypeIException& E) {
+ throw DataTypeIException("CompType::getMemberVarLenType", E.getDetailMsg());
+ }
}
/* old style of getMemberType - using overloads; new style above
@@ -424,27 +424,27 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const
May, 2004: These should be reconsidered to provide more convenience.
// Returns the datatype of the specified member in this compound datatype.
// Several overloading of getMemberType are for different datatypes
-void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const
+void CompType::getMemberType(unsigned member_num, EnumType& enumtype) const
{
p_get_member_type(member_num, enumtype);
}
-void CompType::getMemberType( unsigned member_num, CompType& comptype ) const
+void CompType::getMemberType(unsigned member_num, CompType& comptype) const
{
p_get_member_type(member_num, comptype);
}
-void CompType::getMemberType( unsigned member_num, IntType& inttype ) const
+void CompType::getMemberType(unsigned member_num, IntType& inttype) const
{
p_get_member_type(member_num, inttype);
}
-void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const
+void CompType::getMemberType(unsigned member_num, FloatType& floatype) const
{
p_get_member_type(member_num, floatype);
}
-void CompType::getMemberType( unsigned member_num, StrType& strtype ) const
+void CompType::getMemberType(unsigned member_num, StrType& strtype) const
{
p_get_member_type(member_num, strtype);
}
@@ -452,55 +452,55 @@ void CompType::getMemberType( unsigned member_num, StrType& strtype ) const
*/
//--------------------------------------------------------------------------
-// Function: CompType::insertMember
-///\brief Inserts a new member to this compound datatype.
-///\param name - IN: Name of the new member
-///\param offset - IN: Offset in memory structure of the field to insert
-///\param new_member - IN: New member to be inserted
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: CompType::insertMember
+///\brief Inserts a new member to this compound datatype.
+///\param name - IN: Name of the new member
+///\param offset - IN: Offset in memory structure of the field to insert
+///\param new_member - IN: New member to be inserted
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void CompType::insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const
+void CompType::insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const
{
- // Convert string to C-string
- const char* name_C;
- name_C = name.c_str(); // name_C refers to the contents of name as a C-str
-
- hid_t new_member_id = new_member.getId(); // get new_member id for C API
-
- // Call C routine H5Tinsert to add the new member
- herr_t ret_value = H5Tinsert( id, name_C, offset, new_member_id );
- if( ret_value < 0 )
- {
- throw DataTypeIException("CompType::insertMember", "H5Tinsert failed");
- }
+ // Convert string to C-string
+ const char* name_C;
+ name_C = name.c_str(); // name_C refers to the contents of name as a C-str
+
+ hid_t new_member_id = new_member.getId(); // get new_member id for C API
+
+ // Call C routine H5Tinsert to add the new member
+ herr_t ret_value = H5Tinsert(id, name_C, offset, new_member_id);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("CompType::insertMember", "H5Tinsert failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::pack
-///\brief Recursively removes padding from within a compound datatype.
+// Function: CompType::pack
+///\brief Recursively removes padding from within a compound datatype.
///
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void CompType::pack() const
{
- // Calls C routine H5Tpack to remove padding
- herr_t ret_value = H5Tpack( id );
- if( ret_value < 0 )
- {
- throw DataTypeIException("CompType::pack", "H5Tpack failed");
- }
+ // Calls C routine H5Tpack to remove padding
+ herr_t ret_value = H5Tpack(id);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("CompType::pack", "H5Tpack failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: CompType::setSize
-///\brief Sets the total size for this compound datatype.
-///\param size - IN: Size to set
-///\exception H5::DataTypeIException
+// Function: CompType::setSize
+///\brief Sets the total size for this compound datatype.
+///\param size - IN: Size to set
+///\exception H5::DataTypeIException
// Note
-// H5Tset_size works on atom datatypes and compound datatypes only
-// Programmer Binh-Minh Ribler - 2014
+// H5Tset_size works on atom datatypes and compound datatypes only
+// Programmer Binh-Minh Ribler - 2014
//--------------------------------------------------------------------------
void CompType::setSize(size_t size) const
{
@@ -508,7 +508,7 @@ void CompType::setSize(size_t size) const
herr_t ret_value = H5Tset_size(id, size);
if (ret_value < 0)
{
- throw DataTypeIException("CompType::setSize", "H5Tset_size failed");
+ throw DataTypeIException("CompType::setSize", "H5Tset_size failed");
}
}
diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h
index 3337df7..222044d 100644
--- a/c++/src/H5CompType.h
+++ b/c++/src/H5CompType.h
@@ -27,94 +27,94 @@ namespace H5 {
*/
class H5_DLLCPP CompType : public DataType {
public:
- // Default constructor
- CompType();
+ // Default constructor
+ CompType();
- // Creates a compound datatype using an existing id
- CompType( const hid_t existing_id );
+ // Creates a compound datatype using an existing id
+ CompType(const hid_t existing_id);
- // Creates a new compound datatype, given the type's size
- CompType( size_t size ); // H5Tcreate
+ // Creates a new compound datatype, given the type's size
+ CompType(size_t size); // H5Tcreate
- // Gets the compound datatype of the specified dataset
- CompType( const DataSet& dataset ); // H5Dget_type
+ // Gets the compound datatype of the specified dataset
+ CompType(const DataSet& dataset); // H5Dget_type
- // Copy constructor - makes a copy of original object
- CompType( const CompType& original );
+ // Copy constructor - makes a copy of original object
+ CompType(const CompType& original);
- // Constructors that open a compound datatype, given a location.
- CompType(const H5Location& loc, const char* name);
- CompType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open a compound datatype, given a location.
+ CompType(const H5Location& loc, const char* name);
+ CompType(const H5Location& loc, const H5std_string& name);
- // Returns the type class of the specified member of this compound
- // datatype. It provides to the user a way of knowing what type
- // to create another datatype of the same class
- H5T_class_t getMemberClass( unsigned member_num ) const;
+ // Returns the type class of the specified member of this compound
+ // datatype. It provides to the user a way of knowing what type
+ // to create another datatype of the same class
+ H5T_class_t getMemberClass(unsigned member_num) const;
- // Returns the index of a member in this compound data type.
- int getMemberIndex(const char* name) const;
- int getMemberIndex(const H5std_string& name) const;
+ // Returns the index of a member in this compound data type.
+ int getMemberIndex(const char* name) const;
+ int getMemberIndex(const H5std_string& name) const;
- // Returns the offset of a member of this compound datatype.
- size_t getMemberOffset( unsigned memb_no ) const;
+ // Returns the offset of a member of this compound datatype.
+ size_t getMemberOffset(unsigned memb_no) const;
- // Returns the name of a member of this compound datatype.
- H5std_string getMemberName( unsigned member_num ) const;
+ // Returns the name of a member of this compound datatype.
+ H5std_string getMemberName(unsigned member_num) const;
- // Returns the generic datatype of the specified member in
- // this compound datatype.
- DataType getMemberDataType( unsigned member_num ) const;
+ // Returns the generic datatype of the specified member in
+ // this compound datatype.
+ DataType getMemberDataType(unsigned member_num) const;
- // Returns the array datatype of the specified member in
- // this compound datatype.
- ArrayType getMemberArrayType( unsigned member_num ) const;
+ // Returns the array datatype of the specified member in
+ // this compound datatype.
+ ArrayType getMemberArrayType(unsigned member_num) const;
- // Returns the compound datatype of the specified member in
- // this compound datatype.
- CompType getMemberCompType( unsigned member_num ) const;
+ // Returns the compound datatype of the specified member in
+ // this compound datatype.
+ CompType getMemberCompType(unsigned member_num) const;
- // Returns the enumeration datatype of the specified member in
- // this compound datatype.
- EnumType getMemberEnumType( unsigned member_num ) const;
+ // Returns the enumeration datatype of the specified member in
+ // this compound datatype.
+ EnumType getMemberEnumType(unsigned member_num) const;
- // Returns the integer datatype of the specified member in
- // this compound datatype.
- IntType getMemberIntType( unsigned member_num ) const;
+ // Returns the integer datatype of the specified member in
+ // this compound datatype.
+ IntType getMemberIntType(unsigned member_num) const;
- // Returns the floating-point datatype of the specified member in
- // this compound datatype.
- FloatType getMemberFloatType( unsigned member_num ) const;
+ // Returns the floating-point datatype of the specified member in
+ // this compound datatype.
+ FloatType getMemberFloatType(unsigned member_num) const;
- // Returns the string datatype of the specified member in
- // this compound datatype.
- StrType getMemberStrType( unsigned member_num ) const;
+ // Returns the string datatype of the specified member in
+ // this compound datatype.
+ StrType getMemberStrType(unsigned member_num) const;
- // Returns the variable length datatype of the specified member in
- // this compound datatype.
- VarLenType getMemberVarLenType( unsigned member_num ) const;
+ // Returns the variable length datatype of the specified member in
+ // this compound datatype.
+ VarLenType getMemberVarLenType(unsigned member_num) const;
- // Returns the number of members in this compound datatype.
- int getNmembers() const;
+ // Returns the number of members in this compound datatype.
+ int getNmembers() const;
- // Adds a new member to this compound datatype.
- void insertMember( const H5std_string& name, size_t offset, const DataType& new_member ) const;
+ // Adds a new member to this compound datatype.
+ void insertMember(const H5std_string& name, size_t offset, const DataType& new_member) const;
- // Recursively removes padding from within this compound datatype.
- void pack() const;
+ // Recursively removes padding from within this compound datatype.
+ void pack() const;
- // Sets the total size for this compound datatype.
- void setSize(size_t size) const;
+ // Sets the total size for this compound datatype.
+ void setSize(size_t size) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("CompType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("CompType"); }
- // Noop destructor.
- virtual ~CompType();
+ // Noop destructor.
+ virtual ~CompType();
private:
- // Contains common code that is used by the member functions
- // getMemberXxxType
- hid_t p_get_member_type(unsigned member_num) const;
+ // Contains common code that is used by the member functions
+ // getMemberXxxType
+ hid_t p_get_member_type(unsigned member_num) const;
};
}
#endif // __H5CompType_H
diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h
index 2420586..afc6ebf 100644
--- a/c++/src/H5CppDoc.h
+++ b/c++/src/H5CppDoc.h
@@ -67,34 +67,34 @@
* <br />
*/
-/// This example shows how to create datasets.
+/// This example shows how to create datasets.
///\par
///\example create.cpp
///\par
-/// This example shows how to write datasets.
+/// This example shows how to write datasets.
///\example writedata.cpp
///\par
-/// This example shows how to read datasets.
+/// This example shows how to read datasets.
///\example readdata.cpp
///\par
-/// This example shows how to create a compound datatype,
-/// write an array which has the compound datatype to the file,
-/// and read back fields' subsets.
+/// This example shows how to create a compound datatype,
+/// write an array which has the compound datatype to the file,
+/// and read back fields' subsets.
///\example compound.cpp
///\par
-/// This example shows how to work with extendible datasets.
+/// This example shows how to work with extendible datasets.
///\example extend_ds.cpp
///\par
-/// This example shows how to read data from a chunked dataset.
+/// This example shows how to read data from a chunked dataset.
///\example chunks.cpp
///\par
-/// This example shows how to work with groups.
+/// This example shows how to work with groups.
///\example h5group.cpp
#endif // __H5CppDoc_H
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 7c5b994..a0db328 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -20,7 +20,7 @@
#endif
#include <string>
-#include "H5private.h" // for HDfree
+#include "H5private.h" // for HDfree
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -44,23 +44,23 @@ using std::cerr;
using std::endl;
//--------------------------------------------------------------------------
-// Function: DataSet default constructor
-///\brief Default constructor: creates a stub DataSet.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet default constructor
+///\brief Default constructor: creates a stub DataSet.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet() : H5Object(), AbstractDs(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: DataSet overloaded constructor
-///\brief Creates an DataSet object using the id of an existing dataset.
-///\param existing_id - IN: Id of an existing dataset
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet overloaded constructor
+///\brief Creates an DataSet object using the id of an existing dataset.
+///\param existing_id - IN: Id of an existing dataset
+// Programmer Binh-Minh Ribler - 2000
// Description
-// incRefCount() is needed here to prevent the id from being closed
-// prematurely. That is, when application uses the id of an
-// existing DataSet object to create another DataSet object. So,
-// when one of those objects is deleted, the id will be closed if
-// the reference counter is only 1.
+// incRefCount() is needed here to prevent the id from being closed
+// prematurely. That is, when application uses the id of an
+// existing DataSet object to create another DataSet object. So,
+// when one of those objects is deleted, the id will be closed if
+// the reference counter is only 1.
//--------------------------------------------------------------------------
DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existing_id)
{
@@ -68,10 +68,10 @@ DataSet::DataSet(const hid_t existing_id) : H5Object(), AbstractDs(), id(existin
}
//--------------------------------------------------------------------------
-// Function: DataSet copy constructor
-///\brief Copy constructor: makes a copy of the original DataSet object.
-///\param original - IN: DataSet instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet copy constructor
+///\brief Copy constructor: makes a copy of the original DataSet object.
+///\param original - IN: DataSet instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(original.id)
{
@@ -79,22 +79,22 @@ DataSet::DataSet(const DataSet& original) : H5Object(), AbstractDs(), id(origina
}
//--------------------------------------------------------------------------
-// Function: DataSet overload constructor - dereference
-///\brief Given a reference, ref, to an hdf5 location, creates a
-/// DataSet object
-///\param loc - IN: Dataset reference object is in or location of
-/// object that the dataset is located within.
-///\param ref - IN: Reference pointer
-///\param ref_type - IN: Reference type - default to H5R_OBJECT
-///\param plist - IN: Property list - default to PropList::DEFAULT
-///\exception H5::DataSetIException
+// Function: DataSet overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 location, creates a
+/// DataSet object
+///\param loc - IN: Dataset reference object is in or location of
+/// object that the dataset is located within.
+///\param ref - IN: Reference pointer
+///\param ref_type - IN: Reference type - default to H5R_OBJECT
+///\param plist - IN: Property list - default to PropList::DEFAULT
+///\exception H5::DataSetIException
///\par Description
-/// \c loc can be DataSet, Group, H5File, or named DataType, that
-/// is a datatype that has been named by DataType::commit.
-// Programmer Binh-Minh Ribler - Oct, 2006
+/// \c loc can be DataSet, Group, H5File, or named DataType, that
+/// is a datatype that has been named by DataType::commit.
+// Programmer Binh-Minh Ribler - Oct, 2006
// Modification
-// Jul, 2008
-// Added for application convenience.
+// Jul, 2008
+// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID)
{
@@ -102,18 +102,18 @@ DataSet::DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type, co
}
//--------------------------------------------------------------------------
-// Function: DataSet overload constructor - dereference
-///\brief Given a reference, ref, to an hdf5 attribute, creates a
-/// DataSet 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
+// Function: DataSet overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 attribute, creates a
+/// DataSet 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
-// Added for application convenience.
+// Jul, 2008
+// Added for application convenience.
//--------------------------------------------------------------------------
DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), AbstractDs(), id(H5I_INVALID_HID)
{
@@ -121,26 +121,26 @@ DataSet::DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type, co
}
//--------------------------------------------------------------------------
-// Function: DataSet::getSpace
-///\brief Gets a copy of the dataspace of this dataset.
-///\return DataSpace instance
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::getSpace
+///\brief Gets a copy of the dataspace of this dataset.
+///\return DataSpace instance
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace DataSet::getSpace() const
{
- // Calls C function H5Dget_space to get the id of the dataspace
- hid_t dataspace_id = H5Dget_space( id );
-
- // If the dataspace id is invalid, throw an exception
- if( dataspace_id < 0 )
- {
- throw DataSetIException("DataSet::getSpace", "H5Dget_space failed");
- }
- //create dataspace object using the existing id then return the object
- DataSpace data_space;
- f_DataSpace_setId(&data_space, dataspace_id);
- return( data_space );
+ // Calls C function H5Dget_space to get the id of the dataspace
+ hid_t dataspace_id = H5Dget_space(id);
+
+ // If the dataspace id is invalid, throw an exception
+ if (dataspace_id < 0)
+ {
+ throw DataSetIException("DataSet::getSpace", "H5Dget_space failed");
+ }
+ //create dataspace object using the existing id then return the object
+ DataSpace data_space;
+ f_DataSpace_setId(&data_space, dataspace_id);
+ return(data_space);
}
// This private member function calls the C API to get the identifier
@@ -148,57 +148,57 @@ DataSpace DataSet::getSpace() const
// by the various AbstractDs functions to get the specific datatype.
hid_t DataSet::p_get_type() const
{
- hid_t type_id = H5Dget_type( id );
- if( type_id > 0 )
- return( type_id );
- else
- {
- throw DataSetIException("", "H5Dget_type failed");
- }
+ hid_t type_id = H5Dget_type(id);
+ if (type_id > 0)
+ return(type_id);
+ else
+ {
+ throw DataSetIException("", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::getCreatePlist
-///\brief Gets the dataset creation property list.
-///\return DSetCreatPropList instance
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::getCreatePlist
+///\brief Gets the dataset creation property list.
+///\return DSetCreatPropList instance
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList DataSet::getCreatePlist() const
{
- hid_t create_plist_id = H5Dget_create_plist( id );
- if( create_plist_id < 0 )
- {
- throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed");
- }
-
- // create and return the DSetCreatPropList object
- DSetCreatPropList create_plist;
- f_PropList_setId(&create_plist, create_plist_id);
- return(create_plist);
+ hid_t create_plist_id = H5Dget_create_plist(id);
+ if (create_plist_id < 0)
+ {
+ throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed");
+ }
+
+ // create and return the DSetCreatPropList object
+ DSetCreatPropList create_plist;
+ f_PropList_setId(&create_plist, create_plist_id);
+ return(create_plist);
}
//--------------------------------------------------------------------------
-// Function: DataSet::getStorageSize
-///\brief Returns the amount of storage required for a dataset.
-///\return Size of the storage or 0, for no data
-///\exception H5::DataSetIException
-// Note: H5Dget_storage_size returns 0 when there is no data. This
-// function should have no failure. (from SLU)
-// Programmer Binh-Minh Ribler - Mar, 2005
+// Function: DataSet::getStorageSize
+///\brief Returns the amount of storage required for a dataset.
+///\return Size of the storage or 0, for no data
+///\exception H5::DataSetIException
+// Note: H5Dget_storage_size returns 0 when there is no data. This
+// function should have no failure. (from SLU)
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
hsize_t DataSet::getStorageSize() const
{
- hsize_t storage_size = H5Dget_storage_size(id);
- return(storage_size);
+ hsize_t storage_size = H5Dget_storage_size(id);
+ return(storage_size);
}
//--------------------------------------------------------------------------
-// Function: DataSet::getInMemDataSize
-///\brief Gets the size in memory of the dataset's data.
-///\return Size of data (in memory)
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Apr 2009
+// Function: DataSet::getInMemDataSize
+///\brief Gets the size in memory of the dataset's data.
+///\return Size of data (in memory)
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Apr 2009
//--------------------------------------------------------------------------
size_t DataSet::getInMemDataSize() const
{
@@ -206,9 +206,9 @@ size_t DataSet::getInMemDataSize() const
// Get the data type of this dataset
hid_t mem_type_id = H5Dget_type(id);
- if( mem_type_id < 0 )
+ if (mem_type_id < 0)
{
- throw DataSetIException(func, "H5Dget_type failed");
+ throw DataSetIException(func, "H5Dget_type failed");
}
// Get the data type's size by first getting its native type then getting
@@ -216,22 +216,22 @@ size_t DataSet::getInMemDataSize() const
hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT);
if (native_type < 0)
{
- throw DataSetIException(func, "H5Tget_native_type failed");
+ throw DataSetIException(func, "H5Tget_native_type failed");
}
size_t type_size = H5Tget_size(native_type);
if (type_size == 0)
{
- throw DataSetIException(func, "H5Tget_size failed");
+ throw DataSetIException(func, "H5Tget_size failed");
}
// Close the native type and the datatype of this dataset.
if (H5Tclose(native_type) < 0)
{
- throw DataSetIException(func, "H5Tclose(native_type) failed");
+ throw DataSetIException(func, "H5Tclose(native_type) failed");
}
if (H5Tclose(mem_type_id) < 0)
{
- throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
+ throw DataSetIException(func, "H5Tclose(mem_type_id) failed");
}
// Get number of elements of the dataset by first getting its dataspace,
@@ -239,18 +239,18 @@ size_t DataSet::getInMemDataSize() const
hid_t space_id = H5Dget_space(id);
if (space_id < 0)
{
- throw DataSetIException(func, "H5Dget_space failed");
+ throw DataSetIException(func, "H5Dget_space failed");
}
hssize_t num_elements = H5Sget_simple_extent_npoints(space_id);
if (num_elements < 0)
{
- throw DataSetIException(func, "H5Sget_simple_extent_npoints failed");
+ throw DataSetIException(func, "H5Sget_simple_extent_npoints failed");
}
// Close the dataspace
if (H5Sclose(space_id) < 0)
{
- throw DataSetIException(func, "H5Sclose failed");
+ throw DataSetIException(func, "H5Sclose failed");
}
// Calculate and return the size of the data
@@ -259,184 +259,184 @@ size_t DataSet::getInMemDataSize() const
}
//--------------------------------------------------------------------------
-// Function: DataSet::getOffset
-///\brief Returns the address of this dataset in the file.
-///\return Address of dataset
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::getOffset
+///\brief Returns the address of this dataset in the file.
+///\return Address of dataset
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
haddr_t DataSet::getOffset() const
{
- haddr_t ds_addr; // for address of dataset
-
- ds_addr = H5Dget_offset(id);
- if( ds_addr == HADDR_UNDEF )
- {
- throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF");
- }
- return(ds_addr);
+ haddr_t ds_addr; // for address of dataset
+
+ ds_addr = H5Dget_offset(id);
+ if (ds_addr == HADDR_UNDEF)
+ {
+ throw DataSetIException("DataSet::getOffset", "H5Dget_offset returned HADDR_UNDEF");
+ }
+ return(ds_addr);
}
//--------------------------------------------------------------------------
-// Function: DataSet::getSpaceStatus
-///\brief Determines whether space has been allocated for a dataset.
-///\param status - OUT: Space allocation status
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::getSpaceStatus
+///\brief Determines whether space has been allocated for a dataset.
+///\param status - OUT: Space allocation status
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSet::getSpaceStatus(H5D_space_status_t& status) const
{
- herr_t ret_value = H5Dget_space_status(id, &status);
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed");
- }
+ herr_t ret_value = H5Dget_space_status(id, &status);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::getSpaceStatus", "H5Dget_space_status failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::getVlenBufSize
-///\brief Returns the number of bytes required to store VL data.
-///\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
+// 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
//--------------------------------------------------------------------------
-hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space ) const
+hsize_t DataSet::getVlenBufSize(const DataType& type, const DataSpace& space) const
{
- // Obtain identifiers for C API
- hid_t type_id = type.getId();
- hid_t space_id = space.getId();
-
- hsize_t size; // for amount of storage
-
- herr_t ret_value = H5Dvlen_get_buf_size( id, type_id, space_id, &size );
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed");
- }
- return( size );
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+
+ hsize_t size; // for amount of storage
+
+ herr_t ret_value = H5Dvlen_get_buf_size(id, type_id, space_id, &size);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::getVlenBufSize", "H5Dvlen_get_buf_size failed");
+ }
+ return(size);
}
//--------------------------------------------------------------------------
-// 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
+// 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
+// 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
+//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
-///\param space - IN: Selection for the memory buffer to free the
-/// VL datatypes within
-///\param xfer_plist - IN: Property list used to create the buffer
-///\param buf - IN: Pointer to the buffer to be reclaimed
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::vlenReclaim
+///\brief Reclaims VL datatype memory buffers.
+///\param type - IN: Datatype, which is the datatype stored in the buffer
+///\param space - IN: Selection for the memory buffer to free the
+/// VL datatypes within
+///\param xfer_plist - IN: Property list used to create the buffer
+///\param buf - IN: Pointer to the buffer to be reclaimed
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf )
+void DataSet::vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf)
{
- // Obtain identifiers for C API
- hid_t type_id = type.getId();
- hid_t space_id = space.getId();
- hid_t xfer_plist_id = xfer_plist.getId();
-
- herr_t ret_value = H5Dvlen_reclaim( type_id, space_id, xfer_plist_id, buf );
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed");
- }
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::vlenReclaim
-///\brief Reclaims VL datatype memory buffers.
-///\param type - IN: Datatype, which is the datatype stored in the buffer
-///\param space - IN: Selection for the memory buffer to free the
-/// VL datatypes within
-///\param xfer_plist - IN: Property list used to create the buffer
-///\param buf - IN: Pointer to the buffer to be reclaimed
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::vlenReclaim
+///\brief Reclaims VL datatype memory buffers.
+///\param type - IN: Datatype, which is the datatype stored in the buffer
+///\param space - IN: Selection for the memory buffer to free the
+/// VL datatypes within
+///\param xfer_plist - IN: Property list used to create the buffer
+///\param buf - IN: Pointer to the buffer to be reclaimed
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//\parDescription
-// This function has better prototype for the users than the
-// other, which might be removed at some point. BMR - 2006/12/20
+// This function has better prototype for the users than the
+// other, which might be removed at some point. BMR - 2006/12/20
//--------------------------------------------------------------------------
void DataSet::vlenReclaim(void* buf, const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist)
{
- // Obtain identifiers for C API
- hid_t type_id = type.getId();
- hid_t space_id = space.getId();
- hid_t xfer_plist_id = xfer_plist.getId();
-
- herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf);
- if (ret_value < 0)
- {
- throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed");
- }
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dvlen_reclaim(type_id, space_id, xfer_plist_id, buf);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::vlenReclaim", "H5Dvlen_reclaim failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::read
-///\brief Reads raw data from the specified dataset.
-///\param buf - IN: Buffer for read data
-///\param mem_type - IN: Memory datatype
-///\param mem_space - IN: Memory dataspace
-///\param file_space - IN: Dataset's dataspace in the file
-///\param xfer_plist - IN: Transfer property list for this I/O operation
-///\exception H5::DataSetIException
+// Function: DataSet::read
+///\brief Reads raw data from the specified dataset.
+///\param buf - IN: Buffer for read data
+///\param mem_type - IN: Memory datatype
+///\param mem_space - IN: Memory dataspace
+///\param file_space - IN: Dataset's dataspace in the file
+///\param xfer_plist - IN: Transfer property list for this I/O operation
+///\exception H5::DataSetIException
///\par Description
-/// This function reads raw data from this dataset into the
-/// buffer \a buf, converting from file datatype and dataspace
-/// to memory datatype \a mem_type and dataspace \a mem_space.
-// Programmer Binh-Minh Ribler - 2000
+/// This function reads raw data from this dataset into the
+/// buffer \a buf, converting from file datatype and dataspace
+/// to memory datatype \a mem_type and dataspace \a mem_space.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+void DataSet::read(void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
{
- // Obtain identifiers for C API
- hid_t mem_type_id = mem_type.getId();
- hid_t mem_space_id = mem_space.getId();
- hid_t file_space_id = file_space.getId();
- hid_t xfer_plist_id = xfer_plist.getId();
-
- herr_t ret_value = H5Dread( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf );
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::read", "H5Dread failed");
- }
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::read", "H5Dread failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::read
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes a reference to a \c H5std_string for the buffer.
-///\param strg - IN: Buffer for read data string
-///\param mem_type - IN: Memory datatype
-///\param mem_space - IN: Memory dataspace
-///\param file_space - IN: Dataset's dataspace in the file
-///\param xfer_plist - IN: Transfer property list for this I/O operation
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::read
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes a reference to a \c H5std_string for the buffer.
+///\param strg - IN: Buffer for read data string
+///\param mem_type - IN: Memory datatype
+///\param mem_space - IN: Memory dataspace
+///\param file_space - IN: Dataset's dataspace in the file
+///\param xfer_plist - IN: Transfer property list for this I/O operation
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Jul 2009
-// Follow the change to Attribute::read and use the following
-// private functions to read datasets with fixed- and
-// variable-length string:
-// DataSet::p_read_fixed_len and
-// DataSet::p_read_variable_len
+// Jul 2009
+// Follow the change to Attribute::read and use the following
+// private functions to read datasets with fixed- and
+// variable-length string:
+// DataSet::p_read_fixed_len and
+// DataSet::p_read_variable_len
//--------------------------------------------------------------------------
void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
{
@@ -465,47 +465,47 @@ void DataSet::read(H5std_string& strg, const DataType& mem_type, const DataSpace
}
//--------------------------------------------------------------------------
-// Function: DataSet::write
-///\brief Writes raw data from an application buffer to a dataset.
-///\param buf - IN: Buffer containing data to be written
-///\param mem_type - IN: Memory datatype
-///\param mem_space - IN: Memory dataspace
-///\param file_space - IN: Dataset's dataspace in the file
-///\param xfer_plist - IN: Transfer property list for this I/O operation
-///\exception H5::DataSetIException
+// Function: DataSet::write
+///\brief Writes raw data from an application buffer to a dataset.
+///\param buf - IN: Buffer containing data to be written
+///\param mem_type - IN: Memory datatype
+///\param mem_space - IN: Memory dataspace
+///\param file_space - IN: Dataset's dataspace in the file
+///\param xfer_plist - IN: Transfer property list for this I/O operation
+///\exception H5::DataSetIException
///\par Description
-/// This function writes raw data from an application buffer
-/// \a buf to a dataset, converting from memory datatype
-/// \a mem_type and dataspace \a mem_space to file datatype
-/// and dataspace.
-// Programmer Binh-Minh Ribler - 2000
+/// This function writes raw data from an application buffer
+/// \a buf to a dataset, converting from memory datatype
+/// \a mem_type and dataspace \a mem_space to file datatype
+/// and dataspace.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+void DataSet::write(const void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
{
- // Obtain identifiers for C API
- hid_t mem_type_id = mem_type.getId();
- hid_t mem_space_id = mem_space.getId();
- hid_t file_space_id = file_space.getId();
- hid_t xfer_plist_id = xfer_plist.getId();
-
- herr_t ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf );
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::write", "H5Dwrite failed");
- }
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
+
+ herr_t ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::write", "H5Dwrite failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::write
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes a reference to a \c H5std_string for the buffer.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::write
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes a reference to a \c H5std_string for the buffer.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Jul 2009
-// Modified to pass the buffer into H5Dwrite properly depending
-// whether the dataset has variable- or fixed-length string.
+// Jul 2009
+// Modified to pass the buffer into H5Dwrite properly depending
+// whether the dataset has variable- or fixed-length string.
//--------------------------------------------------------------------------
-void DataSet::write( const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const
+void DataSet::write(const H5std_string& strg, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist) const
{
// Check if this attribute has variable-len string or fixed-len string and
// proceed appropriately.
@@ -515,11 +515,11 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D
throw DataSetIException("DataSet::write", "H5Tis_variable_str failed");
}
- // Obtain identifiers for C API
- hid_t mem_type_id = mem_type.getId();
- hid_t mem_space_id = mem_space.getId();
- hid_t file_space_id = file_space.getId();
- hid_t xfer_plist_id = xfer_plist.getId();
+ // Obtain identifiers for C API
+ hid_t mem_type_id = mem_type.getId();
+ hid_t mem_space_id = mem_space.getId();
+ hid_t file_space_id = file_space.getId();
+ hid_t xfer_plist_id = xfer_plist.getId();
// Convert string to C-string
const char* strg_C;
@@ -529,12 +529,12 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D
// Pass string in differently depends on variable or fixed length
if (!is_variable_len)
{
- ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C );
+ ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
}
else
{
// passing string argument by address
- ret_value = H5Dwrite( id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C );
+ ret_value = H5Dwrite(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C);
}
if (ret_value < 0)
{
@@ -543,65 +543,65 @@ void DataSet::write( const H5std_string& strg, const DataType& mem_type, const D
}
//--------------------------------------------------------------------------
-// Function: DataSet::iterateElems
-///\brief Iterates over all selected elements in a dataspace.
-///\param buf - IN/OUT: Pointer to the buffer in memory containing the
-/// elements to iterate over
-///\param type - IN: Datatype for the elements stored in \a buf
-///\param space - IN: Dataspace for \a buf. Also contains the selection
-/// to iterate over.
-///\param op - IN: Function pointer to the routine to be called for
-/// each element in \a buf iterated over
-///\param op_data - IN/OUT: Pointer to any user-defined data associated
-/// with the operation
-///\exception H5::DataSetIException
-///\note This function may not work correctly yet - it's still
-/// under development.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data )
+// Function: DataSet::iterateElems
+///\brief Iterates over all selected elements in a dataspace.
+///\param buf - IN/OUT: Pointer to the buffer in memory containing the
+/// elements to iterate over
+///\param type - IN: Datatype for the elements stored in \a buf
+///\param space - IN: Dataspace for \a buf. Also contains the selection
+/// to iterate over.
+///\param op - IN: Function pointer to the routine to be called for
+/// each element in \a buf iterated over
+///\param op_data - IN/OUT: Pointer to any user-defined data associated
+/// with the operation
+///\exception H5::DataSetIException
+///\note This function may not work correctly yet - it's still
+/// under development.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+int DataSet::iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data)
{
- // Obtain identifiers for C API
- hid_t type_id = type.getId();
- hid_t space_id = space.getId();
- herr_t ret_value = H5Diterate( buf, type_id, space_id, op, op_data );
- if( ret_value >= 0 )
- return( ret_value );
- else // raise exception when H5Diterate returns a negative value
- {
- throw DataSetIException("DataSet::iterateElems", "H5Diterate failed");
- }
+ // Obtain identifiers for C API
+ hid_t type_id = type.getId();
+ hid_t space_id = space.getId();
+ herr_t ret_value = H5Diterate(buf, type_id, space_id, op, op_data);
+ if (ret_value >= 0)
+ return(ret_value);
+ else // raise exception when H5Diterate returns a negative value
+ {
+ throw DataSetIException("DataSet::iterateElems", "H5Diterate failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSet::extend
-///\brief Extends a dataset with unlimited dimension.
-///\param size - IN: Array containing the new magnitude of each dimension
-///\exception H5::DataSetIException
+// Function: DataSet::extend
+///\brief Extends a dataset with unlimited dimension.
+///\param size - IN: Array containing the new magnitude of each dimension
+///\exception H5::DataSetIException
///\par Description
-/// For more information, please see the Description section in
-/// C layer Reference Manual at:
+/// For more information, please see the Description section in
+/// C layer Reference Manual at:
///\par
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSet::extend( const hsize_t* size ) const
+void DataSet::extend(const hsize_t* size) const
{
- herr_t ret_value = H5Dset_extent( id, size );
- if( ret_value < 0 ) // raise exception when H5Dset_extent returns a neg value
- throw DataSetIException("DataSet::extend", "H5Dset_extent failed");
+ herr_t ret_value = H5Dset_extent(id, size);
+ if (ret_value < 0) // raise exception when H5Dset_extent returns a neg value
+ throw DataSetIException("DataSet::extend", "H5Dset_extent failed");
}
//--------------------------------------------------------------------------
-// Function: DataSet::fillMemBuf
-///\brief Fills a selection in memory with a value.
-///\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 - 2014
+// Function: DataSet::fillMemBuf
+///\brief Fills a selection in memory with a value.
+///\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 - 2014
// Modification
//--------------------------------------------------------------------------
void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf, const DataType& buf_type, const DataSpace& space) const
@@ -610,28 +610,28 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf,
hid_t buf_type_id = buf_type.getId();
hid_t space_id = space.getId();
herr_t ret_value = H5Dfill(fill, fill_type_id, buf, buf_type_id, space_id);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed");
+ throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed");
}
}
//--------------------------------------------------------------------------
-// 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
+// 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
+// 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)
//{
@@ -639,39 +639,39 @@ void DataSet::fillMemBuf(const void *fill, const DataType& fill_type, void *buf,
//}
//--------------------------------------------------------------------------
-// Function: DataSet::fillMemBuf
-///\brief Fills a selection in memory with 0.
-///\param buf - IN/OUT: Memory buffer to fill selection within
-///\param buf_type - IN: Datatype of the elements in buffer
-///\param space - IN: Dataspace describing memory buffer & containing selection to use
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet::fillMemBuf
+///\brief Fills a selection in memory with 0.
+///\param buf - IN/OUT: Memory buffer to fill selection within
+///\param buf_type - IN: Datatype of the elements in buffer
+///\param space - IN: Dataspace describing memory buffer & containing selection to use
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& space) const
{
hid_t buf_type_id = buf_type.getId();
hid_t space_id = space.getId();
herr_t ret_value = H5Dfill(NULL, buf_type_id, buf, buf_type_id, space_id);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed");
+ throw DataSetIException("DataSet::fillMemBuf", "H5Dfill failed");
}
}
//--------------------------------------------------------------------------
// 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.
+// 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
+// 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
+// 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)
//{
@@ -680,8 +680,8 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s
//--------------------------------------------------------------------------
// Function: DataSet::getId
-///\brief Get the id of this dataset.
-///\return DataSet identifier
+///\brief Get the id of this dataset.
+///\return DataSet identifier
// Description:
// Class hierarchy is revised to address bugzilla 1068. Class
// AbstractDs and Attribute are moved out of H5Object. In
@@ -691,19 +691,19 @@ void DataSet::fillMemBuf(void *buf, const DataType& buf_type, const DataSpace& s
//--------------------------------------------------------------------------
hid_t DataSet::getId() const
{
- return(id);
+ return(id);
}
//--------------------------------------------------------------------------
-// Function: DataSet::p_read_fixed_len (private)
-// brief Reads a fixed length \a H5std_string from a dataset.
-// param mem_type - IN: DataSet datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// Function: DataSet::p_read_fixed_len (private)
+// brief Reads a fixed length \a H5std_string from a dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Jul, 2009
// Modification
-// Jul 2009
-// Added in follow to the change in Attribute::read
+// Jul 2009
+// Added in follow to the change in Attribute::read
//--------------------------------------------------------------------------
void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
{
@@ -715,33 +715,33 @@ void DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id
// If there is data, allocate buffer and read it.
if (data_size > 0)
{
- char *strg_C = new char [data_size+1];
- HDmemset(strg_C, 0, data_size+1); // clear buffer
+ char *strg_C = new char [data_size+1];
+ HDmemset(strg_C, 0, data_size+1); // clear buffer
- herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
+ herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, strg_C);
- if( ret_value < 0 )
- {
- delete []strg_C; // de-allocate for fixed-len string
- throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string");
- }
+ if (ret_value < 0)
+ {
+ delete []strg_C; // de-allocate for fixed-len string
+ throw DataSetIException("DataSet::read", "H5Dread failed for fixed length string");
+ }
- // Get string from the C char* and release resource allocated locally
- strg = strg_C;
- delete []strg_C;
+ // Get string from the C char* and release resource allocated locally
+ strg = strg_C;
+ delete []strg_C;
}
}
//--------------------------------------------------------------------------
-// Function: DataSet::p_read_variable_len (private)
-// brief Reads a variable length \a H5std_string from an dataset.
-// param mem_type - IN: DataSet datatype (in memory)
-// param strg - IN: Buffer for read string
-// exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Jul, 2009
+// Function: DataSet::p_read_variable_len (private)
+// brief Reads a variable length \a H5std_string from an dataset.
+// param mem_type - IN: DataSet datatype (in memory)
+// param strg - IN: Buffer for read string
+// exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Jul, 2009
// Modification
-// Jul 2009
-// Added in follow to the change in Attribute::read
+// Jul 2009
+// Added in follow to the change in Attribute::read
//--------------------------------------------------------------------------
void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const
{
@@ -751,9 +751,9 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space
// Read dataset, no allocation for variable-len string; C library will
herr_t ret_value = H5Dread(id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, &strg_C);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw DataSetIException("DataSet::read", "H5Dread failed for variable length string");
+ throw DataSetIException("DataSet::read", "H5Dread failed for variable length string");
}
// Get string from the C char* and release resource allocated by C API
@@ -805,43 +805,43 @@ void f_PropList_setId(PropList* plist, hid_t new_id)
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DataSet::close
-///\brief Closes this dataset.
+// Function: DataSet::close
+///\brief Closes this dataset.
///
-///\exception H5::DataSetIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::DataSetIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void DataSet::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Dclose( id );
- if( ret_value < 0 )
- {
- throw DataSetIException("DataSet::close", "H5Dclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Dclose(id);
+ if (ret_value < 0)
+ {
+ throw DataSetIException("DataSet::close", "H5Dclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: DataSet destructor
-///\brief Properly terminates access to this dataset.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSet destructor
+///\brief Properly terminates access to this dataset.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
DataSet::~DataSet()
{
try {
- close();
+ close();
}
catch (Exception& close_error) {
- cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl;
+ cerr << "DataSet::~DataSet - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h
index ee9ef28..93f9782 100644
--- a/c++/src/H5DataSet.h
+++ b/c++/src/H5DataSet.h
@@ -31,82 +31,82 @@ namespace H5 {
class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
public:
- // Close this dataset.
- virtual void close();
+ // Close this dataset.
+ virtual void close();
- // Extends the dataset with unlimited dimension.
- void extend( const hsize_t* size ) const;
+ // Extends the dataset with unlimited dimension.
+ void extend(const hsize_t* size) const;
- // 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 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
+ // 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;
+ // Gets the creation property list of this dataset.
+ DSetCreatPropList getCreatePlist() const;
- // Returns the address of this dataset in the file.
- haddr_t getOffset() const;
+ // Returns the address of this dataset in the file.
+ haddr_t getOffset() const;
- // Gets the dataspace of this dataset.
- virtual DataSpace getSpace() const;
+ // Gets the dataspace of this dataset.
+ virtual DataSpace getSpace() const;
- // Determines whether space has been allocated for a dataset.
- void getSpaceStatus(H5D_space_status_t& status) const;
+ // Determines whether space has been allocated for a dataset.
+ void getSpaceStatus(H5D_space_status_t& status) const;
- // Returns the amount of storage size required for this dataset.
- virtual hsize_t getStorageSize() const;
+ // Returns the amount of storage size required for this dataset.
+ virtual hsize_t getStorageSize() const;
- // Returns the in memory size of this attribute's data.
- virtual size_t getInMemDataSize() const;
+ // Returns the in memory size of this attribute's data.
+ virtual size_t getInMemDataSize() const;
- // 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; // removed from 1.8.18 and 1.10.1
+ // 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; // 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 );
- static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT);
+ // Reclaims VL datatype memory buffers.
+ static void vlenReclaim(const DataType& type, const DataSpace& space, const DSetMemXferPropList& xfer_plist, void* buf);
+ static void vlenReclaim(void *buf, const DataType& type, const DataSpace& space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT);
- // Reads the data of this dataset and stores it in the provided buffer.
- // The memory and file dataspaces and the transferring property list
- // can be defaults.
- void read( void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
- void read( H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
+ // Reads the data of this dataset and stores it in the provided buffer.
+ // The memory and file dataspaces and the transferring property list
+ // can be defaults.
+ void read(void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const;
+ void read(H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const;
- // Writes the buffered data to this dataset.
- // The memory and file dataspaces and the transferring property list
- // can be defaults.
- void write( const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
- void write( const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT ) const;
+ // Writes the buffered data to this dataset.
+ // The memory and file dataspaces and the transferring property list
+ // can be defaults.
+ void write(const void* buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const;
+ void write(const H5std_string& buf, const DataType& mem_type, const DataSpace& mem_space = DataSpace::ALL, const DataSpace& file_space = DataSpace::ALL, const DSetMemXferPropList& xfer_plist = DSetMemXferPropList::DEFAULT) const;
- // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet
- int iterateElems( void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL );
+ // Iterates the selected elements in the specified dataspace - not implemented in C++ style yet
+ int iterateElems(void* buf, const DataType& type, const DataSpace& space, H5D_operator_t op, void* op_data = NULL);
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("DataSet"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DataSet"); }
- // Creates a dataset by way of dereference.
- DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
- DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
+ // Creates a dataset by way of dereference.
+ DataSet(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
+ DataSet(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
- // Default constructor.
- DataSet();
+ // Default constructor.
+ DataSet();
- // Copy constructor.
- DataSet( const DataSet& original );
+ // Copy constructor.
+ DataSet(const DataSet& original);
- // Creates a copy of an existing DataSet using its id.
- DataSet(const hid_t existing_id);
+ // Creates a copy of an existing DataSet using its id.
+ DataSet(const hid_t existing_id);
// Gets the dataset id.
virtual hid_t getId() const;
- // Destructor: properly terminates access to this dataset.
- virtual ~DataSet();
+ // Destructor: properly terminates access to this dataset.
+ virtual ~DataSet();
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -115,20 +115,20 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs {
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- hid_t id; // HDF5 dataset id
+ hid_t id; // HDF5 dataset id
// This function contains the common code that is used by
// getTypeClass and various API functions getXxxType
// defined in AbstractDs for generic datatype and specific
// sub-types
- virtual hid_t p_get_type() const;
+ virtual hid_t p_get_type() const;
- // Reads variable or fixed len strings from this dataset.
- void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
- void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
+ // Reads variable or fixed len strings from this dataset.
+ void p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
+ void p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space_id, const hid_t file_space_id, const hid_t xfer_plist_id, H5std_string& strg) const;
- // Friend function to set DataSet id. For library use only.
- friend void f_DataSet_setId(DataSet* dset, hid_t new_id);
+ // Friend function to set DataSet id. For library use only.
+ friend void f_DataSet_setId(DataSet* dset, hid_t new_id);
};
}
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index cb479e1..2587a72 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -38,14 +38,14 @@ using std::endl;
DataSpace* DataSpace::ALL_ = 0;
//--------------------------------------------------------------------------
-// Function: DataSpace::getConstant
-// Creates a DataSpace object representing the HDF5 constant
-// H5S_ALL, pointed to by DataSpace::ALL_
-// Exception H5::DataSpaceIException
+// Function: DataSpace::getConstant
+// Creates a DataSpace object representing the HDF5 constant
+// H5S_ALL, pointed to by DataSpace::ALL_
+// Exception H5::DataSpaceIException
// Description
-// If DataSpace::ALL_ already points to an allocated object, throw
-// a DataSpaceIException. This scenario should not happen.
-// Programmer Binh-Minh Ribler - 2015
+// If DataSpace::ALL_ already points to an allocated object, throw
+// a DataSpaceIException. This scenario should not happen.
+// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
DataSpace* DataSpace::getConstant()
{
@@ -78,55 +78,55 @@ void DataSpace::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose Constant for default dataspace.
+// Purpose Constant for default dataspace.
//--------------------------------------------------------------------------
const DataSpace& DataSpace::ALL = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DataSpace constructor
-///\brief Creates a new dataspace given a dataspace type.
-///\param type - IN: Type of the dataspace to be created, which
-/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE;
-/// default to \c H5S_SCALAR.
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace constructor
+///\brief Creates a new dataspace given a dataspace type.
+///\param type - IN: Type of the dataspace to be created, which
+/// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE;
+/// default to \c H5S_SCALAR.
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace::DataSpace(H5S_class_t type) : IdComponent()
{
- id = H5Screate( type );
- if( id < 0 )
- {
- throw DataSpaceIException("DataSpace constructor", "H5Screate failed");
- }
+ id = H5Screate(type);
+ if (id < 0)
+ {
+ throw DataSpaceIException("DataSpace constructor", "H5Screate failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace overloaded constructor
-///\brief Creates a new simple dataspace.
-///\param rank - IN: Number of dimensions of dataspace.
-///\param dims - IN: An array of the size of each dimension.
-///\param maxdims - IN: An array of the maximum size of each dimension.
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace overloaded constructor
+///\brief Creates a new simple dataspace.
+///\param rank - IN: Number of dimensions of dataspace.
+///\param dims - IN: An array of the size of each dimension.
+///\param maxdims - IN: An array of the maximum size of each dimension.
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent()
+DataSpace::DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims) : IdComponent()
{
- id = H5Screate_simple( rank, dims, maxdims );
- if( id < 0 )
- {
- throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed");
- }
+ id = H5Screate_simple(rank, dims, maxdims);
+ if (id < 0)
+ {
+ throw DataSpaceIException("DataSpace constructor", "H5Screate_simple failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace overloaded constructor
-///\brief Creates a DataSpace object using the id of an existing
-/// dataspace.
-///\param existing_id - IN: Id of an existing dataspace
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace overloaded constructor
+///\brief Creates a DataSpace object using the id of an existing
+/// dataspace.
+///\param existing_id - IN: Id of an existing dataspace
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id)
{
@@ -134,10 +134,10 @@ DataSpace::DataSpace(const hid_t existing_id) : IdComponent(), id(existing_id)
}
//--------------------------------------------------------------------------
-// Function: DataSpace copy constructor
-///\brief Copy constructor: makes a copy of the original DataSpace object.
-///\param original - IN: DataSpace object to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace copy constructor
+///\brief Copy constructor: makes a copy of the original DataSpace object.
+///\param original - IN: DataSpace object to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id)
{
@@ -145,48 +145,48 @@ DataSpace::DataSpace(const DataSpace& original) : IdComponent(), id(original.id)
}
//--------------------------------------------------------------------------
-// Function: DataSpace::copy
-///\brief Makes a copy of an existing dataspace.
-///\param like_space - IN: Dataspace to be copied
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::copy
+///\brief Makes a copy of an existing dataspace.
+///\param like_space - IN: Dataspace to be copied
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
-//--------------------------------------------------------------------------
-void DataSpace::copy( const DataSpace& like_space )
-{
- // If this object has an hdf5 valid id, close it
- if( id != H5S_ALL ) {
- try {
- close();
- }
- catch (Exception& close_error) {
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
+//--------------------------------------------------------------------------
+void DataSpace::copy(const DataSpace& like_space)
+{
+ // If this object has an hdf5 valid id, close it
+ if (id != H5S_ALL) {
+ try {
+ close();
+ }
+ catch (Exception& close_error) {
throw DataSpaceIException("DataSpace::copy", close_error.getDetailMsg());
- }
- } // end if
+ }
+ } // end if
- // call C routine to copy the dataspace
- id = H5Scopy( like_space.getId() );
+ // call C routine to copy the dataspace
+ id = H5Scopy(like_space.getId());
- if( id < 0 )
- throw DataSpaceIException("DataSpace::copy", "H5Scopy failed");
+ if (id < 0)
+ throw DataSpaceIException("DataSpace::copy", "H5Scopy failed");
}
//--------------------------------------------------------------------------
-// Function: DataSpace::operator=
-///\brief Assignment operator.
-///\param rhs - IN: Reference to the existing dataspace
-///\return Reference to DataSpace instance
-///\exception H5::DataSpaceIException
+// Function: DataSpace::operator=
+///\brief Assignment operator.
+///\param rhs - IN: Reference to the existing dataspace
+///\return Reference to DataSpace instance
+///\exception H5::DataSpaceIException
// Description
-// Makes a copy of the type on the right hand side and stores
-// the new id in the left hand side object.
-// Programmer Binh-Minh Ribler - 2000
+// Makes a copy of the type on the right hand side and stores
+// the new id in the left hand side object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSpace& DataSpace::operator=( const DataSpace& rhs )
+DataSpace& DataSpace::operator=(const DataSpace& rhs)
{
if (this != &rhs)
copy(rhs);
@@ -194,435 +194,434 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs )
}
//--------------------------------------------------------------------------
-// Function: DataSpace::isSimple
-///\brief Determines whether this dataspace is a simple dataspace.
-///\return \c true if the dataspace is a simple dataspace, and \c false,
-/// otherwise
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::isSimple
+///\brief Determines whether this dataspace is a simple dataspace.
+///\return \c true if the dataspace is a simple dataspace, and \c false,
+/// otherwise
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DataSpace::isSimple () const
{
- htri_t simple = H5Sis_simple( id );
- if( simple > 0 )
- return true;
- else if( simple == 0 )
- return false;
- else
- {
- throw DataSpaceIException("DataSpace::isSimple",
- "H5Sis_simple returns negative value");
- }
+ htri_t simple = H5Sis_simple(id);
+ if (simple > 0)
+ return true;
+ else if (simple == 0)
+ return false;
+ else
+ {
+ throw DataSpaceIException("DataSpace::isSimple",
+ "H5Sis_simple returns negative value");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::offsetSimple
-///\brief Sets the offset of this simple dataspace.
-///\param offset - IN: Offset to position the selection at
-///\exception H5::DataSpaceIException
+// Function: DataSpace::offsetSimple
+///\brief Sets the offset of this simple dataspace.
+///\param offset - IN: Offset to position the selection at
+///\exception H5::DataSpaceIException
///\par Description
-/// This function creates an offset for the selection within
-/// an extent, allowing the same shaped selection to be moved
-/// to different locations within a dataspace without requiring
-/// it to be re-defined.
-// Programmer Binh-Minh Ribler - 2000
+/// This function creates an offset for the selection within
+/// an extent, allowing the same shaped selection to be moved
+/// to different locations within a dataspace without requiring
+/// it to be re-defined.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::offsetSimple ( const hssize_t* offset ) const
+void DataSpace::offsetSimple (const hssize_t* offset) const
{
- herr_t ret_value = H5Soffset_simple( id, offset );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed");
- }
+ herr_t ret_value = H5Soffset_simple(id, offset);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::offsetSimple", "H5Soffset_simple failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSimpleExtentDims
-///\brief Retrieves dataspace dimension size and maximum size.
-///\param dims - IN: Name of the new member
-///\param maxdims - IN: Pointer to the value of the new member
-///\return Number of dimensions, the same value as returned by
-/// \c DataSpace::getSimpleExtentNdims()
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSimpleExtentDims
+///\brief Retrieves dataspace dimension size and maximum size.
+///\param dims - IN: Name of the new member
+///\param maxdims - IN: Pointer to the value of the new member
+///\return Number of dimensions, the same value as returned by
+/// \c DataSpace::getSimpleExtentNdims()
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const
+int DataSpace::getSimpleExtentDims (hsize_t *dims, hsize_t *maxdims) const
{
- int ndims = H5Sget_simple_extent_dims( id, dims, maxdims );
- if( ndims < 0 )
- {
- throw DataSpaceIException("DataSpace::getSimpleExtentDims",
- "H5Sget_simple_extent_dims returns negative number of dimensions");
- }
- return( ndims );
+ int ndims = H5Sget_simple_extent_dims(id, dims, maxdims);
+ if (ndims < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSimpleExtentDims",
+ "H5Sget_simple_extent_dims returns negative number of dimensions");
+ }
+ return(ndims);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSimpleExtentNdims
-///\brief Returns the dimensionality of a dataspace.
-///\return Number of dimensions
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSimpleExtentNdims
+///\brief Returns the dimensionality of a dataspace.
+///\return Number of dimensions
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DataSpace::getSimpleExtentNdims () const
{
- int ndims = H5Sget_simple_extent_ndims( id );
- if( ndims < 0 )
- {
- throw DataSpaceIException("DataSpace::getSimpleExtentNdims",
- "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace");
- }
- return( ndims );
+ int ndims = H5Sget_simple_extent_ndims(id);
+ if (ndims < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSimpleExtentNdims",
+ "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace");
+ }
+ return(ndims);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSimpleExtentNpoints
-///\brief Returns the number of elements in a dataspace.
-///\return Number of elements
-///\exception H5::DataSpaceIException
+// Function: DataSpace::getSimpleExtentNpoints
+///\brief Returns the number of elements in a dataspace.
+///\return Number of elements
+///\exception H5::DataSpaceIException
// Modification
-// 12/05/00: due to C API change
-// return type hssize_t vs. hsize_t
-// num_elements = -1 when failure occurs vs. 0
-// Programmer Binh-Minh Ribler - 2000
+// 12/05/00: due to C API change
+// return type hssize_t vs. hsize_t
+// num_elements = -1 when failure occurs vs. 0
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hssize_t DataSpace::getSimpleExtentNpoints () const
{
- hssize_t num_elements = H5Sget_simple_extent_npoints( id );
-
- if( num_elements > -1 )
- return( num_elements );
- else
- {
- throw DataSpaceIException("DataSpace::getSimpleExtentNpoints",
- "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace");
- }
+ hssize_t num_elements = H5Sget_simple_extent_npoints(id);
+ if (num_elements > -1)
+ return(num_elements);
+ else
+ {
+ throw DataSpaceIException("DataSpace::getSimpleExtentNpoints",
+ "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSimpleExtentType
-///\brief Returns the current class of a dataspace.
-///\return Class of the dataspace
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSimpleExtentType
+///\brief Returns the current class of a dataspace.
+///\return Class of the dataspace
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5S_class_t DataSpace::getSimpleExtentType () const
{
- H5S_class_t class_name = H5Sget_simple_extent_type( id );
- if( class_name == H5S_NO_CLASS )
- {
- throw DataSpaceIException("DataSpace::getSimpleExtentType",
- "H5Sget_simple_extent_type returns H5S_NO_CLASS");
- }
- return( class_name );
+ H5S_class_t class_name = H5Sget_simple_extent_type(id);
+ if (class_name == H5S_NO_CLASS)
+ {
+ throw DataSpaceIException("DataSpace::getSimpleExtentType",
+ "H5Sget_simple_extent_type returns H5S_NO_CLASS");
+ }
+ return(class_name);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::extentCopy
-///\brief Copies the extent of a dataspace.
-///\param dest_space - IN: Dataspace to copy from
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::extentCopy
+///\brief Copies the extent of a dataspace.
+///\param dest_space - IN: Dataspace to copy from
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSpace::extentCopy (const DataSpace& dest_space) const
{
- hid_t dest_space_id = dest_space.getId();
- herr_t ret_value = H5Sextent_copy( dest_space_id, id );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed");
- }
+ hid_t dest_space_id = dest_space.getId();
+ herr_t ret_value = H5Sextent_copy(dest_space_id, id);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::extentCopy", "H5Sextent_copy failed");
+ }
}
//--------------------------------------------------------------------------
-// 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
+// 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
+// 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
+//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
-///\param current_size - IN: Array containing current size of dataspace
-///\param maximum_size - IN: Array containing maximum size of dataspace
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::setExtentSimple
+///\brief Sets or resets the size of an existing dataspace.
+///\param rank - IN: Rank of the dataspace
+///\param current_size - IN: Array containing current size of dataspace
+///\param maximum_size - IN: Array containing maximum size of dataspace
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size ) const
+void DataSpace::setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size) const
{
- herr_t ret_value;
- ret_value = H5Sset_extent_simple( id, rank, current_size, maximum_size );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed");
- }
+ herr_t ret_value;
+ ret_value = H5Sset_extent_simple(id, rank, current_size, maximum_size);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::setExtentSimple", "H5Sset_extent_simple failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::setExtentNone
-///\brief Removes the extent from a dataspace.
+// Function: DataSpace::setExtentNone
+///\brief Removes the extent from a dataspace.
///
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSpace::setExtentNone () const
{
- herr_t ret_value = H5Sset_extent_none( id );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed");
- }
+ herr_t ret_value = H5Sset_extent_none(id);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::setExtentNone", "H5Sset_extent_none failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectNpoints
-///\brief Returns the number of elements in a dataspace selection.
-///\return Number of elements
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSelectNpoints
+///\brief Returns the number of elements in a dataspace selection.
+///\return Number of elements
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hssize_t DataSpace::getSelectNpoints () const
{
- hssize_t num_elements = H5Sget_select_npoints( id );
- if( num_elements < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectNpoints",
- "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection");
- }
- return( num_elements );
+ hssize_t num_elements = H5Sget_select_npoints(id);
+ if (num_elements < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectNpoints",
+ "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection");
+ }
+ return(num_elements);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectHyperNblocks
-///\brief Returns number of hyperslab blocks.
-///\return Number of hyperslab blocks
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSelectHyperNblocks
+///\brief Returns number of hyperslab blocks.
+///\return Number of hyperslab blocks
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hssize_t DataSpace::getSelectHyperNblocks () const
{
- hssize_t num_blocks = H5Sget_select_hyper_nblocks( id );
- if( num_blocks < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectHyperNblocks",
- "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks");
- }
- return( num_blocks );
+ hssize_t num_blocks = H5Sget_select_hyper_nblocks(id);
+ if (num_blocks < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectHyperNblocks",
+ "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks");
+ }
+ return(num_blocks);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectHyperBlocklist
-///\brief Gets the list of hyperslab blocks currently selected
-///\param startblock - IN: Hyperslab block to start with
-///\param numblocks - IN: Number of hyperslab blocks to get
-///\param buf - IN: List of hyperslab blocks selected
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSelectHyperBlocklist
+///\brief Gets the list of hyperslab blocks currently selected
+///\param startblock - IN: Hyperslab block to start with
+///\param numblocks - IN: Number of hyperslab blocks to get
+///\param buf - IN: List of hyperslab blocks selected
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const
+void DataSpace::getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const
{
- herr_t ret_value;
- ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectHyperBlocklist",
- "H5Sget_select_hyper_blocklist failed");
- }
+ herr_t ret_value;
+ ret_value = H5Sget_select_hyper_blocklist(id, startblock, numblocks, buf);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectHyperBlocklist",
+ "H5Sget_select_hyper_blocklist failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectElemNpoints
-///\brief Returns the number of element points in the current selection.
-///\return Number of element points
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::getSelectElemNpoints
+///\brief Returns the number of element points in the current selection.
+///\return Number of element points
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hssize_t DataSpace::getSelectElemNpoints () const
{
- hssize_t num_points = H5Sget_select_elem_npoints( id );
- if( num_points < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectElemNpoints",
- "H5Sget_select_elem_npoints failed");
- }
- return( num_points );
+ hssize_t num_points = H5Sget_select_elem_npoints(id);
+ if (num_points < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectElemNpoints",
+ "H5Sget_select_elem_npoints failed");
+ }
+ return(num_points);
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectElemPointlist
-///\brief Gets the list of element points currently selected
-///\param startpoint - IN: Element point to start with
-///\param numpoints - IN: Number of element points to get
-///\param buf - IN: List of element points selected
-///\exception H5::DataSpaceIException
+// Function: DataSpace::getSelectElemPointlist
+///\brief Gets the list of element points currently selected
+///\param startpoint - IN: Element point to start with
+///\param numpoints - IN: Number of element points to get
+///\param buf - IN: List of element points selected
+///\exception H5::DataSpaceIException
///\par Description
-/// For more information, please refer to the C layer Reference
-/// Manual at:
+/// For more information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const
+void DataSpace::getSelectElemPointlist (hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const
{
- herr_t ret_value;
- ret_value = H5Sget_select_elem_pointlist( id, startpoint, numpoints, buf );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectElemPointlist",
- "H5Sget_select_elem_pointlist failed");
- }
+ herr_t ret_value;
+ ret_value = H5Sget_select_elem_pointlist(id, startpoint, numpoints, buf);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectElemPointlist",
+ "H5Sget_select_elem_pointlist failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::getSelectBounds
-///\brief Gets the bounding box containing the current selection.
-///\param start - IN: Starting coordinates of the bounding box
-///\param end - IN: Ending coordinates of the bounding box, i.e.,
-/// the coordinates of the diagonally opposite corner
-///\exception H5::DataSpaceIException
+// Function: DataSpace::getSelectBounds
+///\brief Gets the bounding box containing the current selection.
+///\param start - IN: Starting coordinates of the bounding box
+///\param end - IN: Ending coordinates of the bounding box, i.e.,
+/// the coordinates of the diagonally opposite corner
+///\exception H5::DataSpaceIException
///\par Description
-/// For more information, please refer to the C layer Reference
-/// Manual at:
+/// For more information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
+void DataSpace::getSelectBounds (hsize_t* start, hsize_t* end) const
{
- herr_t ret_value = H5Sget_select_bounds( id, start, end );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::getSelectBounds",
- "H5Sget_select_bounds failed");
- }
+ herr_t ret_value = H5Sget_select_bounds(id, start, end);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::getSelectBounds",
+ "H5Sget_select_bounds failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::selectElements
-///\brief Selects array elements to be included in the selection for
-/// this dataspace.
-///\param op - IN: Operator specifying how the new selection is to be
-/// combined with the existing selection for the dataspace
-///\param num_elements - IN: Number of elements to be selected
-///\param coord - IN: A 2-dimensional array of 0-based values
-/// specifying the coordinates of the elements being selected
-///\exception H5::DataSpaceIException
+// Function: DataSpace::selectElements
+///\brief Selects array elements to be included in the selection for
+/// this dataspace.
+///\param op - IN: Operator specifying how the new selection is to be
+/// combined with the existing selection for the dataspace
+///\param num_elements - IN: Number of elements to be selected
+///\param coord - IN: A 2-dimensional array of 0-based values
+/// specifying the coordinates of the elements being selected
+///\exception H5::DataSpaceIException
///\par Description
-/// For more information, please refer to the C layer Reference
-/// Manual at:
+/// For more information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const
+void DataSpace::selectElements (H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const
{
- herr_t ret_value;
- ret_value = H5Sselect_elements( id, op, num_elements, coord );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::selectElements",
- "H5Sselect_elements failed");
- }
+ herr_t ret_value;
+ ret_value = H5Sselect_elements(id, op, num_elements, coord);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::selectElements",
+ "H5Sselect_elements failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::selectAll
-///\brief Selects the entire dataspace.
+// Function: DataSpace::selectAll
+///\brief Selects the entire dataspace.
///
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSpace::selectAll () const
{
- herr_t ret_value = H5Sselect_all( id );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed");
- }
+ herr_t ret_value = H5Sselect_all(id);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::selectAll", "H5Sselect_all failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::selectNone
-///\brief Resets the selection region to include no elements.
+// Function: DataSpace::selectNone
+///\brief Resets the selection region to include no elements.
///
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataSpace::selectNone () const
{
- herr_t ret_value = H5Sselect_none( id );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::selectNone",
- "H5Sselect_none failed");
- }
+ herr_t ret_value = H5Sselect_none(id);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::selectNone",
+ "H5Sselect_none failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataSpace::selectValid
-///\brief Verifies that the selection is within the extent of the
-/// dataspace.
-///\return \c true if the selection is within the extent of the
-/// dataspace, and \c false, otherwise
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace::selectValid
+///\brief Verifies that the selection is within the extent of the
+/// dataspace.
+///\return \c true if the selection is within the extent of the
+/// dataspace, and \c false, otherwise
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DataSpace::selectValid () const
{
- htri_t ret_value = H5Sselect_valid( id );
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else
- {
- throw DataSpaceIException("DataSpace::selectValid",
- "H5Sselect_valid returns negative value");
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: DataSpace::selectHyperslab
-///\brief Selects a hyperslab region to add to the current selected region.
-///\param op - IN: Operation to perform on current selection
-///\param count - IN: Number of blocks included in the hyperslab
-///\param start - IN: Offset of the start of hyperslab
-///\param stride - IN: Hyperslab stride - default to \c NULL
-///\param block - IN: Size of block in the hyperslab - default to \c NULL
-///\exception H5::DataSpaceIException
+ htri_t ret_value = H5Sselect_valid(id);
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else
+ {
+ throw DataSpaceIException("DataSpace::selectValid",
+ "H5Sselect_valid returns negative value");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DataSpace::selectHyperslab
+///\brief Selects a hyperslab region to add to the current selected region.
+///\param op - IN: Operation to perform on current selection
+///\param count - IN: Number of blocks included in the hyperslab
+///\param start - IN: Offset of the start of hyperslab
+///\param stride - IN: Hyperslab stride - default to \c NULL
+///\param block - IN: Size of block in the hyperslab - default to \c NULL
+///\exception H5::DataSpaceIException
///\par Description
-/// For more information, please refer to the C layer Reference
-/// Manual at:
+/// For more information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const
+void DataSpace::selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block) const
{
- herr_t ret_value;
- ret_value = H5Sselect_hyperslab( id, op, start, stride, count, block );
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::selectHyperslab",
- "H5Sselect_hyperslab failed");
- }
+ herr_t ret_value;
+ ret_value = H5Sselect_hyperslab(id, op, start, stride, count, block);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::selectHyperslab",
+ "H5Sselect_hyperslab failed");
+ }
}
//--------------------------------------------------------------------------
// Function: DataSpace::getId
-///\brief Get the id of this dataspace
-///\return Dataspace identifier
+///\brief Get the id of this dataspace
+///\return Dataspace 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
@@ -631,7 +630,7 @@ void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const h
//--------------------------------------------------------------------------
hid_t DataSpace::getId() const
{
- return(id);
+ return(id);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -656,49 +655,49 @@ void DataSpace::p_setId(const hid_t new_id)
catch (Exception& close_error) {
throw DataSpaceIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
- // reset object's id to the given id
- id = new_id;
+ // reset object's id to the given id
+ id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DataSpace::close
-///\brief Closes this dataspace.
+// Function: DataSpace::close
+///\brief Closes this dataspace.
///
-///\exception H5::DataSpaceIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::DataSpaceIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void DataSpace::close()
{
// check if id is a valid hdf5 object id before trying to close it
if (p_valid_id(id))
{
- herr_t ret_value = H5Sclose(id);
- if( ret_value < 0 )
- {
- throw DataSpaceIException("DataSpace::close", "H5Sclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Sclose(id);
+ if (ret_value < 0)
+ {
+ throw DataSpaceIException("DataSpace::close", "H5Sclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: DataSpace destructor
-///\brief Properly terminates access to this dataspace.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataSpace destructor
+///\brief Properly terminates access to this dataspace.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
DataSpace::~DataSpace()
{
try {
- close();
+ close();
} catch (Exception& close_error) {
- cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
+ cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h
index e76bc72..969e146 100644
--- a/c++/src/H5DataSpace.h
+++ b/c++/src/H5DataSpace.h
@@ -27,126 +27,126 @@ namespace H5 {
*/
class H5_DLLCPP DataSpace : public IdComponent {
public:
- ///\brief Default DataSpace objects
- static const DataSpace& ALL;
+ ///\brief Default DataSpace objects
+ static const DataSpace& ALL;
- // Creates a dataspace object given the space type
- DataSpace(H5S_class_t type = H5S_SCALAR);
+ // Creates a dataspace object given the space type
+ DataSpace(H5S_class_t type = H5S_SCALAR);
- // Creates a simple dataspace
- DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL);
+ // Creates a simple dataspace
+ DataSpace(int rank, const hsize_t * dims, const hsize_t * maxdims = NULL);
- // Creates a DataSpace object using an existing dataspace id.
- DataSpace(const hid_t space_id);
+ // Creates a DataSpace object using an existing dataspace id.
+ DataSpace(const hid_t space_id);
- // Copy constructor: makes a copy of the original DataSpace object.
- DataSpace(const DataSpace& original);
+ // Copy constructor: makes a copy of the original DataSpace object.
+ DataSpace(const DataSpace& original);
- // Assignment operator
- DataSpace& operator=( const DataSpace& rhs );
+ // Assignment operator
+ DataSpace& operator=(const DataSpace& rhs);
- // Closes this dataspace.
- virtual void close();
+ // Closes this dataspace.
+ virtual void close();
- // Makes copy of an existing dataspace.
- void copy(const DataSpace& like_space);
+ // Makes copy of an existing dataspace.
+ void copy(const DataSpace& like_space);
- // 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;
+ // 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;
+ // Gets the bounding box containing the current selection.
+ void getSelectBounds(hsize_t* start, hsize_t* end) const;
- // Gets the number of element points in the current selection.
- hssize_t getSelectElemNpoints() const;
+ // Gets the number of element points in the current selection.
+ hssize_t getSelectElemNpoints() const;
- // Retrieves the list of element points currently selected.
- void getSelectElemPointlist( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const;
+ // Retrieves the list of element points currently selected.
+ void getSelectElemPointlist(hsize_t startpoint, hsize_t numpoints, hsize_t *buf) const;
- // Gets the list of hyperslab blocks currently selected.
- void getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, hsize_t *buf ) const;
+ // Gets the list of hyperslab blocks currently selected.
+ void getSelectHyperBlocklist(hsize_t startblock, hsize_t numblocks, hsize_t *buf) const;
- // Get number of hyperslab blocks.
- hssize_t getSelectHyperNblocks() const;
+ // Get number of hyperslab blocks.
+ hssize_t getSelectHyperNblocks() const;
- // Gets the number of elements in this dataspace selection.
- hssize_t getSelectNpoints() const;
+ // Gets the number of elements in this dataspace selection.
+ hssize_t getSelectNpoints() const;
- // Retrieves dataspace dimension size and maximum size.
- int getSimpleExtentDims( hsize_t *dims, hsize_t *maxdims = NULL ) const;
+ // Retrieves dataspace dimension size and maximum size.
+ int getSimpleExtentDims(hsize_t *dims, hsize_t *maxdims = NULL) const;
- // Gets the dimensionality of this dataspace.
- int getSimpleExtentNdims() const;
+ // Gets the dimensionality of this dataspace.
+ int getSimpleExtentNdims() const;
- // Gets the number of elements in this dataspace.
- // 12/05/00 - changed return type to hssize_t from hsize_t - C API
- hssize_t getSimpleExtentNpoints() const;
+ // Gets the number of elements in this dataspace.
+ // 12/05/00 - changed return type to hssize_t from hsize_t - C API
+ hssize_t getSimpleExtentNpoints() const;
- // Gets the current class of this dataspace.
- H5S_class_t getSimpleExtentType() const;
+ // Gets the current class of this dataspace.
+ H5S_class_t getSimpleExtentType() const;
- // Determines if this dataspace is a simple one.
- bool isSimple() const;
+ // Determines if this dataspace is a simple one.
+ bool isSimple() const;
- // Sets the offset of this simple dataspace.
- void offsetSimple( const hssize_t* offset ) const;
+ // Sets the offset of this simple dataspace.
+ void offsetSimple(const hssize_t* offset) const;
- // Selects the entire dataspace.
- void selectAll() const;
+ // Selects the entire dataspace.
+ void selectAll() const;
- // Selects array elements to be included in the selection for
- // this dataspace.
- void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const;
+ // Selects array elements to be included in the selection for
+ // this dataspace.
+ void selectElements(H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const;
- // Selects a hyperslab region to add to the current selected region.
- void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
+ // Selects a hyperslab region to add to the current selected region.
+ void selectHyperslab(H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL) const;
- // Resets the selection region to include no elements.
- void selectNone() const;
+ // Resets the selection region to include no elements.
+ void selectNone() const;
- // Verifies that the selection is within the extent of the dataspace.
- bool selectValid() const;
+ // Verifies that the selection is within the extent of the dataspace.
+ bool selectValid() const;
- // Removes the extent from this dataspace.
- void setExtentNone() const;
+ // Removes the extent from this dataspace.
+ void setExtentNone() const;
- // Sets or resets the size of this dataspace.
- void setExtentSimple( int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL ) const;
+ // Sets or resets the size of this dataspace.
+ void setExtentSimple(int rank, const hsize_t *current_size, const hsize_t *maximum_size = NULL) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("DataSpace"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DataSpace"); }
- // Gets the dataspace id.
- virtual hid_t getId() const;
+ // Gets the dataspace id.
+ virtual hid_t getId() const;
- // Deletes the global constant
- static void deleteConstants();
+ // Deletes the global constant
+ static void deleteConstants();
- // Destructor: properly terminates access to this dataspace.
- virtual ~DataSpace();
+ // Destructor: properly terminates access to this dataspace.
+ virtual ~DataSpace();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
protected:
- // Sets the dataspace id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the dataspace id.
+ virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- hid_t id; // HDF5 dataspace id
+ hid_t id; // HDF5 dataspace id
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- static DataSpace* ALL_;
+ static DataSpace* ALL_;
- // Creates the global constant
- static DataSpace* getConstant();
+ // Creates the global constant
+ static DataSpace* getConstant();
- // Friend function to set DataSpace id. For library use only.
- friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id);
+ // Friend function to set DataSpace id. For library use only.
+ friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
};
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 372b2c9..ae48d16 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -46,24 +46,24 @@ using std::cerr;
using std::endl;
//--------------------------------------------------------------------------
-// Function: DataType default constructor
-///\brief Default constructor: Creates a stub datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType default constructor
+///\brief Default constructor: Creates a stub datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType() : H5Object(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: DataType overloaded constructor
-///\brief Creates a datatype using an existing datatype's id
-///\param existing_id - IN: Id of the existing datatype
+// Function: DataType overloaded constructor
+///\brief Creates a datatype using an existing datatype's id
+///\param existing_id - IN: Id of the existing datatype
// Description
-// Constructor creates a copy of an existing DataType using
-// its id.
-// Programmer Binh-Minh Ribler - 2000
+// Constructor creates a copy of an existing DataType using
+// its id.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Dec, 2005
-// Removed second argument, "predefined", after changing to the
-// new ref counting mechanism that relies on C's ref counting.
+// Dec, 2005
+// Removed second argument, "predefined", after changing to the
+// new ref counting mechanism that relies on C's ref counting.
//--------------------------------------------------------------------------
DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id)
{
@@ -71,36 +71,36 @@ DataType::DataType(const hid_t existing_id) : H5Object(), id(existing_id)
}
//--------------------------------------------------------------------------
-// Function: DataType overloaded constructor
-///\brief Creates a object given its class and size
-///\param type_class - IN: Class of datatype to create
-///\param size - IN: Number of bytes in the datatype to create
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType overloaded constructor
+///\brief Creates a object given its class and size
+///\param type_class - IN: Class of datatype to create
+///\param size - IN: Number of bytes in the datatype to create
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object()
+DataType::DataType(const H5T_class_t type_class, size_t size) : H5Object()
{
- // Call C routine to create the new datatype
- id = H5Tcreate( type_class, size );
- if( id < 0 )
- {
- throw DataTypeIException("DataType constructor", "H5Tcreate failed");
- }
+ // Call C routine to create the new datatype
+ id = H5Tcreate(type_class, size);
+ if (id < 0)
+ {
+ throw DataTypeIException("DataType constructor", "H5Tcreate failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType overload constructor - dereference
-///\brief Given a reference, ref, to an hdf5 group, creates a
-/// DataType object
+// Function: DataType overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 group, creates a
+/// DataType object
///\param loc - IN: Location 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
+///\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
-// Added for application convenience.
+// Jul, 2008
+// Added for application convenience.
//--------------------------------------------------------------------------
DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object()
{
@@ -108,18 +108,18 @@ 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
+// 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
-// Programmer Binh-Minh Ribler - Oct, 2006
+///\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
-// Added for application convenience.
+// Jul, 2008
+// Added for application convenience.
//--------------------------------------------------------------------------
/* DataType::DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
{
@@ -128,9 +128,9 @@ DataType::DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type,
*/
//--------------------------------------------------------------------------
-// Function: DataType copy constructor
-///\brief Copy constructor: makes a copy of the original DataType object
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType copy constructor
+///\brief Copy constructor: makes a copy of the original DataType object
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType(const DataType& original) : H5Object(), id(original.id)
{
@@ -144,32 +144,32 @@ DataType::DataType(const DataType& original) : H5Object(), id(original.id)
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2015
// Description
-// Copying the type so that when a predefined type is passed in,
-// a copy of it is made, not just a duplicate of the HDF5 id.
-// Note: calling DataType::copy will invoke DataType::close()
-// unnecessarily and will produce undefined behavior.
-// -BMR, Apr 2015
+// Copying the type so that when a predefined type is passed in,
+// a copy of it is made, not just a duplicate of the HDF5 id.
+// Note: calling DataType::copy will invoke DataType::close()
+// unnecessarily and will produce undefined behavior.
+// -BMR, Apr 2015
//--------------------------------------------------------------------------
DataType::DataType(const PredType& pred_type) : H5Object()
{
// Call C routine to copy the datatype
- id = H5Tcopy( pred_type.getId() );
+ id = H5Tcopy(pred_type.getId());
if (id < 0)
- throw DataTypeIException("DataType constructor", "H5Tcopy failed");
+ throw DataTypeIException("DataType constructor", "H5Tcopy failed");
}
//--------------------------------------------------------------------------
// Function: DataType overloaded constructor
///\brief Creates a DataType instance by opening an HDF5 datatype given
-/// its name as a char*.
+/// its name as a char*.
///\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
-// existing function CommonFG::openDataType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openDataType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
DataType::DataType(const H5Location& loc, const char *dtype_name) : H5Object()
{
@@ -178,16 +178,16 @@ 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.
+///\brief Creates a DataType instance by opening an HDF5 datatype given
+/// its name as an \c H5std_string.
///\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
-// existing function CommonFG::openDataType(const H5std_string&) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openDataType(const H5std_string&) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Object()
{
@@ -195,108 +195,108 @@ DataType::DataType(const H5Location& loc, const H5std_string& dtype_name) : H5Ob
}
//--------------------------------------------------------------------------
-// Function: DataType::copy
-///\brief Copies an existing datatype to this datatype object
-///\param like_type - IN: Datatype to be copied
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::copy
+///\brief Copies an existing datatype to this datatype object
+///\param like_type - IN: Datatype to be copied
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
-void DataType::copy( const DataType& like_type )
+void DataType::copy(const DataType& like_type)
{
// close the current data type before copying like_type to this object
try {
- close();
+ close();
}
catch (Exception& close_error) {
- throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
+ throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
}
// call C routine to copy the datatype
- id = H5Tcopy( like_type.getId() );
- if( id < 0 )
- throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed");
+ id = H5Tcopy(like_type.getId());
+ if (id < 0)
+ throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed");
}
//--------------------------------------------------------------------------
-// Function: DataType::copy
-///\brief Copies the datatype of the given dataset to this datatype object
-///\param dset - IN: Dataset
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jan, 2007
+// Function: DataType::copy
+///\brief Copies the datatype of the given dataset to this datatype object
+///\param dset - IN: Dataset
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jan, 2007
///\par Description
-/// The resulted dataset will be transient and modifiable.
+/// The resulted dataset will be transient and modifiable.
//--------------------------------------------------------------------------
void DataType::copy(const DataSet& dset)
{
// close the current data type before copying dset's datatype to this object
try {
- close();
+ close();
}
catch (Exception& close_error) {
- throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
+ throw DataTypeIException(inMemFunc("copy"), close_error.getDetailMsg());
}
// call C routine to copy the datatype
- id = H5Tcopy( dset.getId() );
- if( id < 0 )
- throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed");
+ id = H5Tcopy(dset.getId());
+ if (id < 0)
+ throw DataTypeIException(inMemFunc("copy"), "H5Tcopy failed");
}
//--------------------------------------------------------------------------
-// Function: DataType::operator=
-///\brief Assignment operator
-///\param rhs - IN: Reference to the existing datatype
-///\return Reference to DataType instance
-///\exception H5::DataTypeIException
+// Function: DataType::operator=
+///\brief Assignment operator
+///\param rhs - IN: Reference to the existing datatype
+///\return Reference to DataType instance
+///\exception H5::DataTypeIException
// Description
-// Makes a copy of the type on the right hand side and stores
-// the new id in the left hand side object.
-// Programmer Binh-Minh Ribler - 2000
+// Makes a copy of the type on the right hand side and stores
+// the new id in the left hand side object.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Changed operator= to simply copy the id of rhs instead of
-// calling H5Tcopy because, when the operator= is invoked, a
-// different datatype id is created and it won't have the same
-// characteristics as the original one, specifically, if the
-// rhs represents a named datatype, "this" would still be a
-// transient datatype.
-// BMR - Mar, 2015
+// Changed operator= to simply copy the id of rhs instead of
+// calling H5Tcopy because, when the operator= is invoked, a
+// different datatype id is created and it won't have the same
+// characteristics as the original one, specifically, if the
+// rhs represents a named datatype, "this" would still be a
+// transient datatype.
+// BMR - Mar, 2015
//--------------------------------------------------------------------------
-DataType& DataType::operator=( const DataType& rhs )
+DataType& DataType::operator=(const DataType& rhs)
{
if (this != &rhs)
{
- setId(rhs.id);
+ setId(rhs.id);
}
return(*this);
}
//--------------------------------------------------------------------------
-// Function: DataType::operator==
-///\brief Compares this DataType against the given one to determines
-/// whether the two objects refer to the same actual datatype.
-///\param compared_type - IN: Reference to the datatype to compare
-///\return true if the datatypes are equal, and false, otherwise.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::operator==
+///\brief Compares this DataType against the given one to determines
+/// whether the two objects refer to the same actual datatype.
+///\param compared_type - IN: Reference to the datatype to compare
+///\return true if the datatypes are equal, and false, otherwise.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-bool DataType::operator==(const DataType& compared_type ) const
+bool DataType::operator==(const DataType& compared_type) const
{
- // Call C routine H5Tequal to determines whether two datatype
- // identifiers refer to the same datatype
- htri_t ret_value = H5Tequal( id, compared_type.getId() );
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else
- {
- throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value");
- }
+ // Call C routine H5Tequal to determines whether two datatype
+ // identifiers refer to the same datatype
+ htri_t ret_value = H5Tequal(id, compared_type.getId());
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else
+ {
+ throw DataTypeIException(inMemFunc("operator=="), "H5Tequal returns negative value");
+ }
}
//--------------------------------------------------------------------------
@@ -306,69 +306,69 @@ bool DataType::operator==(const DataType& compared_type ) const
///\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
+// 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");
+ 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
-//\param loc_id - IN: The id of either a file, group, dataset, named
-// datatype, or attribute.
-//\param name - IN: Name of the datatype
-//\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::p_commit (private)
+//\brief Commits a transient datatype to a file, creating a new
+// named datatype
+//\param loc_id - IN: The id of either a file, group, dataset, named
+// datatype, or attribute.
+//\param name - IN: Name of the datatype
+//\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
// Modification:
-// Copied from DataType::commit and made into private function
-// to be commonly used by several overloads of DataType::commit.
-// BMR - Jan, 2007
+// Copied from DataType::commit and made into private function
+// to be commonly used by several overloads of DataType::commit.
+// BMR - Jan, 2007
//--------------------------------------------------------------------------
void DataType::p_commit(hid_t loc_id, const char* name)
{
- // Call C routine to commit the transient datatype
- herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if( ret_value < 0 )
- throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed");
+ // Call C routine to commit the transient datatype
+ herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret_value < 0)
+ throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed");
}
//--------------------------------------------------------------------------
-// Function: DataType::commit
-///\brief Commits a transient datatype to a file, creating a new
-/// named datatype
-///\param loc - IN: A location (file, dataset, datatype, or group)
-///\param name - IN: Name of the datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jan, 2007
+// Function: DataType::commit
+///\brief Commits a transient datatype to a file, creating a new
+/// named datatype
+///\param loc - IN: A location (file, dataset, datatype, or group)
+///\param name - IN: Name of the datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jan, 2007
//--------------------------------------------------------------------------
void DataType::commit(const H5Location& loc, const char* name)
{
- p_commit(loc.getId(), name);
+ p_commit(loc.getId(), name);
}
//--------------------------------------------------------------------------
-// Function: DataType::commit
-// 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 loc - IN: A location (file, dataset, datatype, or group)
-// Param name - IN: Name of the datatype
-// Exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jan, 2007
+// Function: DataType::commit
+// 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 loc - IN: A location (file, dataset, datatype, or group)
+// Param name - IN: Name of the datatype
+// Exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jan, 2007
// 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
+// 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 DataType::commit(H5Location& loc, const char* name)
//{
@@ -376,30 +376,30 @@ void DataType::commit(const H5Location& loc, const char* name)
//}
//--------------------------------------------------------------------------
-// Function: DataType::commit
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of the
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::commit
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of the
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::commit(const H5Location& loc, const H5std_string& name)
{
- p_commit(loc.getId(), name.c_str());
+ p_commit(loc.getId(), name.c_str());
}
//--------------------------------------------------------------------------
-// Function: DataType::commit
-// 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 loc - IN: A location (file, dataset, datatype, or group)
-// Param name - IN: Name of the datatype
-// Exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Jan, 2007
+// Function: DataType::commit
+// 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 loc - IN: A location (file, dataset, datatype, or group)
+// Param name - IN: Name of the datatype
+// Exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Jan, 2007
// 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
+// 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 DataType::commit(H5Location& loc, const H5std_string& name)
//{
@@ -407,340 +407,340 @@ void DataType::commit(const H5Location& loc, const H5std_string& name)
//}
//--------------------------------------------------------------------------
-// Function: DataType::committed
-///\brief Determines whether a datatype is a named type or a
-/// transient type.
-///\return \c true if the datatype is a named type, and \c false,
-/// otherwise.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::committed
+///\brief Determines whether a datatype is a named type or a
+/// transient type.
+///\return \c true if the datatype is a named type, and \c false,
+/// otherwise.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DataType::committed() const
{
- // Call C function to determine if a datatype is a named one
- htri_t is_committed = H5Tcommitted( id );
- if (is_committed > 0)
- return true;
- else if (is_committed == 0)
- return false;
- else
- {
- throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value");
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: DataType::find
-///\brief Finds a conversion function that can handle a conversion
-/// from this datatype to the specified datatype, \a dest.
-///\param dest - IN: Destination datatype
-///\param pcdata - IN: Pointer to type conversion data
-///\return Pointer to a suitable conversion function
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
-{
- // Call C routine to find the conversion function
- H5T_conv_t func = H5Tfind( id, dest.getId(), pcdata );
- if( func == NULL )
- {
- throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function");
- }
- return( func );
-}
-
-//--------------------------------------------------------------------------
-// Function: DataType::convert
-///\brief Converts data from this datatype to the specified datatypes.
-///\param dest - IN: Destination datatype
-///\param nelmts - IN: Size of array \a buf
-///\param buf - IN/OUT: Array containing pre- and post-conversion
-/// values
-///\param background - IN: Optional backgroud buffer
-///\param plist - IN: Property list - default to PropList::DEFAULT
-///\return Pointer to a suitable conversion function
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist ) const
-{
- // Get identifiers for C API
- hid_t dest_id = dest.getId();
- hid_t plist_id = plist.getId();
-
- // Call C routine H5Tconvert to convert the data
- herr_t ret_value;
- ret_value = H5Tconvert( id, dest_id, nelmts, buf, background, plist_id );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed");
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: DataType::lock
-///\brief Locks a datatype, making it read-only and non-destructible.
+ // Call C function to determine if a datatype is a named one
+ htri_t is_committed = H5Tcommitted(id);
+ if (is_committed > 0)
+ return true;
+ else if (is_committed == 0)
+ return false;
+ else
+ {
+ throw DataTypeIException(inMemFunc("committed"), "H5Tcommitted return negative value");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DataType::find
+///\brief Finds a conversion function that can handle a conversion
+/// from this datatype to the specified datatype, \a dest.
+///\param dest - IN: Destination datatype
+///\param pcdata - IN: Pointer to type conversion data
+///\return Pointer to a suitable conversion function
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+H5T_conv_t DataType::find(const DataType& dest, H5T_cdata_t **pcdata) const
+{
+ // Call C routine to find the conversion function
+ H5T_conv_t func = H5Tfind(id, dest.getId(), pcdata);
+ if (func == NULL)
+ {
+ throw DataTypeIException(inMemFunc("find"), "H5Tfind returns a NULL function");
+ }
+ return(func);
+}
+
+//--------------------------------------------------------------------------
+// Function: DataType::convert
+///\brief Converts data from this datatype to the specified datatypes.
+///\param dest - IN: Destination datatype
+///\param nelmts - IN: Size of array \a buf
+///\param buf - IN/OUT: Array containing pre- and post-conversion
+/// values
+///\param background - IN: Optional backgroud buffer
+///\param plist - IN: Property list - default to PropList::DEFAULT
+///\return Pointer to a suitable conversion function
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DataType::convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist) const
+{
+ // Get identifiers for C API
+ hid_t dest_id = dest.getId();
+ hid_t plist_id = plist.getId();
+
+ // Call C routine H5Tconvert to convert the data
+ herr_t ret_value;
+ ret_value = H5Tconvert(id, dest_id, nelmts, buf, background, plist_id);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("convert"), "H5Tconvert failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DataType::lock
+///\brief Locks a datatype, making it read-only and non-destructible.
///
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Descrition
-/// This is normally done by the library for predefined data
-/// types so the application doesn't inadvertently change or
-/// delete a predefined type.
+/// This is normally done by the library for predefined data
+/// types so the application doesn't inadvertently change or
+/// delete a predefined type.
///
-/// Once a data type is locked it can never be unlocked unless
-/// the entire library is closed.
-// Programmer Binh-Minh Ribler - 2000
+/// Once a data type is locked it can never be unlocked unless
+/// the entire library is closed.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::lock() const
{
- // Call C routine to lock the datatype
- herr_t ret_value = H5Tlock( id );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed");
- }
+ // Call C routine to lock the datatype
+ herr_t ret_value = H5Tlock(id);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("lock"), "H5Tlock failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType::getClass
-///\brief Returns the datatype class identifier.
-///\return Datatype class identifier
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getClass
+///\brief Returns the datatype class identifier.
+///\return Datatype class identifier
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_class_t DataType::getClass() const
{
- H5T_class_t type_class = H5Tget_class( id );
+ H5T_class_t type_class = H5Tget_class(id);
- // Return datatype class identifier if successful
- if( type_class == H5T_NO_CLASS )
- {
- throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS");
- }
- return( type_class );
+ // Return datatype class identifier if successful
+ if (type_class == H5T_NO_CLASS)
+ {
+ throw DataTypeIException(inMemFunc("getClass"), "H5Tget_class returns H5T_NO_CLASS");
+ }
+ return(type_class);
}
//--------------------------------------------------------------------------
-// Function: DataType::getSize
-///\brief Returns the size of a datatype.
-///\return Datatype size in bytes
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getSize
+///\brief Returns the size of a datatype.
+///\return Datatype size in bytes
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
size_t DataType::getSize() const
{
- // Call C routine to get the datatype size
- size_t type_size = H5Tget_size( id );
- if( type_size <= 0 ) // valid data types are never zero size
- {
- throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size");
- }
- return( type_size );
+ // Call C routine to get the datatype size
+ size_t type_size = H5Tget_size(id);
+ if (type_size <= 0) // valid data types are never zero size
+ {
+ throw DataTypeIException(inMemFunc("getSize"), "H5Tget_size returns invalid datatype size");
+ }
+ return(type_size);
}
//--------------------------------------------------------------------------
-// Function: DataType::getSuper
-///\brief Returns the base datatype from which a datatype is derived.
-///\return DataType object
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getSuper
+///\brief Returns the base datatype from which a datatype is derived.
+///\return DataType object
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType DataType::getSuper() const
{
- // Call C routine to get the base datatype from which the specified
- // datatype is derived.
- hid_t base_type_id = H5Tget_super( id );
-
- // If H5Tget_super returns a valid datatype id, create and return
- // the base type, otherwise, raise exception
- if( base_type_id > 0 )
- {
- DataType base_type;
- base_type.p_setId(base_type_id);
- return(base_type);
- }
- else
- {
- throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed");
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: DataType::registerFunc
-///\brief Registers the specified conversion function.
-///\param pers - IN: Conversion option
-/// \li \c H5T_PERS_HARD for hard conversion functions
-/// \li \c H5T_PERS_SOFT for soft conversion functions.
-///\param name - IN: Name displayed in diagnostic output.
-///\param dest - IN: Destination datatype.
-///\param func - IN: Function to convert between source and
-/// destination datatypes.
-///\exception H5::DataTypeIException
+ // Call C routine to get the base datatype from which the specified
+ // datatype is derived.
+ hid_t base_type_id = H5Tget_super(id);
+
+ // If H5Tget_super returns a valid datatype id, create and return
+ // the base type, otherwise, raise exception
+ if (base_type_id > 0)
+ {
+ DataType base_type;
+ base_type.p_setId(base_type_id);
+ return(base_type);
+ }
+ else
+ {
+ throw DataTypeIException(inMemFunc("getSuper"), "H5Tget_super failed");
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: DataType::registerFunc
+///\brief Registers the specified conversion function.
+///\param pers - IN: Conversion option
+/// \li \c H5T_PERS_HARD for hard conversion functions
+/// \li \c H5T_PERS_SOFT for soft conversion functions.
+///\param name - IN: Name displayed in diagnostic output.
+///\param dest - IN: Destination datatype.
+///\param func - IN: Function to convert between source and
+/// destination datatypes.
+///\exception H5::DataTypeIException
///\par Description
-/// For more information, please see:
+/// For more information, please see:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
+void DataType::registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const
{
- hid_t dest_id = dest.getId(); // get id of the destination datatype
+ hid_t dest_id = dest.getId(); // get id of the destination datatype
- // Call C routine H5Tregister to register the conversion function
- herr_t ret_value = H5Tregister( pers, name, id, dest_id, func );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed");
- }
+ // Call C routine H5Tregister to register the conversion function
+ herr_t ret_value = H5Tregister(pers, name, id, dest_id, func);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("registerFunc"), "H5Tregister failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType::registerFunc
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of the
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::registerFunc
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of the
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::registerFunc( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const
+void DataType::registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const
{
- registerFunc( pers, name.c_str(), dest, func );
+ registerFunc(pers, name.c_str(), dest, func);
}
//--------------------------------------------------------------------------
-// Function: DataType::unregister
-///\brief Removes a conversion function from all conversion paths.
-///\param pers - IN: Conversion option
-/// \li \c H5T_PERS_HARD for hard conversion functions
-/// \li \c H5T_PERS_SOFT for soft conversion functions.
-///\param name - IN: Name displayed in diagnostic output.
-///\param dest - IN: Destination datatype.
-///\param func - IN: Function to convert between source and
-/// destination datatypes.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::unregister
+///\brief Removes a conversion function from all conversion paths.
+///\param pers - IN: Conversion option
+/// \li \c H5T_PERS_HARD for hard conversion functions
+/// \li \c H5T_PERS_SOFT for soft conversion functions.
+///\param name - IN: Name displayed in diagnostic output.
+///\param dest - IN: Destination datatype.
+///\param func - IN: Function to convert between source and
+/// destination datatypes.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
+void DataType::unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const
{
- hid_t dest_id = dest.getId(); // get id of the dest datatype for C API
+ hid_t dest_id = dest.getId(); // get id of the dest datatype for C API
- // Call C routine H5Tunregister to remove the conversion function
- herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed");
- }
+ // Call C routine H5Tunregister to remove the conversion function
+ herr_t ret_value = H5Tunregister(pers, name, id, dest_id, func);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("unregister"), "H5Tunregister failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType::unregister
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of the
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::unregister
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of the
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const
+void DataType::unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const
{
- unregister( pers, name.c_str(), dest, func );
+ unregister(pers, name.c_str(), dest, func);
}
//--------------------------------------------------------------------------
-// Function: DataType::setTag
-///\brief Tags an opaque datatype.
-///\param tag - IN: Descriptive ASCII string with which the opaque
-/// datatype is to be tagged.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::setTag
+///\brief Tags an opaque datatype.
+///\param tag - IN: Descriptive ASCII string with which the opaque
+/// datatype is to be tagged.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::setTag( const char* tag ) const
+void DataType::setTag(const char* tag) const
{
- // Call C routine H5Tset_tag to tag an opaque datatype.
- herr_t ret_value = H5Tset_tag( id, tag );
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed");
- }
+ // Call C routine H5Tset_tag to tag an opaque datatype.
+ herr_t ret_value = H5Tset_tag(id, tag);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("setTag"), "H5Tset_tag failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType::setTag
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of the
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::setTag
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of the
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::setTag( const H5std_string& tag ) const
+void DataType::setTag(const H5std_string& tag) const
{
- setTag( tag.c_str());
+ setTag(tag.c_str());
}
//--------------------------------------------------------------------------
-// Function: DataType::getTag
-///\brief Gets the tag associated with an opaque datatype.
-///\return Tag associated with the opaque datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getTag
+///\brief Gets the tag associated with an opaque datatype.
+///\return Tag associated with the opaque datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5std_string DataType::getTag() const
{
- char* tag_Cstr = H5Tget_tag( id );
+ char* tag_Cstr = H5Tget_tag(id);
// if the tag C-string returned is not NULL, convert it to C++ string
// and return it, otherwise, raise an exception
- if( tag_Cstr != NULL )
+ if (tag_Cstr != NULL)
{
- H5std_string tag = H5std_string(tag_Cstr); // C string to string object
- H5free_memory(tag_Cstr); // free the C string
- return (tag); // return the tag
+ H5std_string tag = H5std_string(tag_Cstr); // C string to string object
+ H5free_memory(tag_Cstr); // free the C string
+ return (tag); // return the tag
}
else
{
- throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag");
+ throw DataTypeIException(inMemFunc("getTag"), "H5Tget_tag returns NULL for tag");
}
}
//--------------------------------------------------------------------------
-// Function: DataType::detectClass
-///\brief Checks whether a datatype contains (or is) a certain type of
-/// datatype.
-///\return true if this datatype contains or is the specified type,
-/// and false, otherwise.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: DataType::detectClass
+///\brief Checks whether a datatype contains (or is) a certain type of
+/// datatype.
+///\return true if this datatype contains or is the specified type,
+/// and false, otherwise.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
bool DataType::detectClass(H5T_class_t cls) const
{
- htri_t ret_value = H5Tdetect_class(id, cls);
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else
- {
- throw DataTypeIException(inMemFunc("detectClass"),
- "H5Tdetect_class returns negative value");
- }
+ htri_t ret_value = H5Tdetect_class(id, cls);
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else
+ {
+ throw DataTypeIException(inMemFunc("detectClass"),
+ "H5Tdetect_class returns negative value");
+ }
}
//--------------------------------------------------------------------------
-// Function: DataType::isVariableStr
-///\brief Check whether this datatype is a variable-length string.
-///\return true if this datatype is a variable-length string, and
-/// false, otherwise.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: DataType::isVariableStr
+///\brief Check whether this datatype is a variable-length string.
+///\return true if this datatype is a variable-length string, and
+/// false, otherwise.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
bool DataType::isVariableStr() const
{
- htri_t is_varlen_str = H5Tis_variable_str(id);
- if( is_varlen_str == 1 )
- return true;
- else if( is_varlen_str == 0 )
- return false;
- else
- {
- throw DataTypeIException(inMemFunc("isVariableStr"),
- "H5Tis_variable_str returns negative value");
- }
+ htri_t is_varlen_str = H5Tis_variable_str(id);
+ if (is_varlen_str == 1)
+ return true;
+ else if (is_varlen_str == 0)
+ return false;
+ else
+ {
+ throw DataTypeIException(inMemFunc("isVariableStr"),
+ "H5Tis_variable_str returns negative value");
+ }
}
//--------------------------------------------------------------------------
@@ -757,7 +757,7 @@ bool DataType::isVariableStr() const
//--------------------------------------------------------------------------
hid_t DataType::getId() const
{
- return(id);
+ return(id);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -782,58 +782,58 @@ void DataType::p_setId(const hid_t new_id)
catch (Exception& close_error) {
throw DataTypeIException(inMemFunc("p_setId"), close_error.getDetailMsg());
}
- // reset object's id to the given id
- id = new_id;
+ // reset object's id to the given id
+ id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DataType::close
-///\brief Closes the datatype if it is not a predefined type.
+// Function: DataType::close
+///\brief Closes the datatype if it is not a predefined type.
///
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void DataType::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Tclose(id);
- if( ret_value < 0 )
- {
- throw DataTypeIException(inMemFunc("close"), "H5Tclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Tclose(id);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException(inMemFunc("close"), "H5Tclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: DataType destructor
-///\brief Properly terminates access to this datatype.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType destructor
+///\brief Properly terminates access to this datatype.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
-// - Added the use of H5CPP_EXITED to terminate the HDF5 library
-// and elimiate previous memory leaks. See comments in the
-// header file "H5PredType.h" for details. - BMR, Mar 30, 2012
-// - Major re-implementation of the global constants was done
-// to avoid relying on the order of the creation and deletion
-// of the global constants. Hence, H5CPP_EXITED was removed.
-// See Design Notes in "H5PredType.cpp" for details.
-// - BMR, Sep 30, 2015
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
+// - Added the use of H5CPP_EXITED to terminate the HDF5 library
+// and elimiate previous memory leaks. See comments in the
+// header file "H5PredType.h" for details. - BMR, Mar 30, 2012
+// - Major re-implementation of the global constants was done
+// to avoid relying on the order of the creation and deletion
+// of the global constants. Hence, H5CPP_EXITED was removed.
+// See Design Notes in "H5PredType.cpp" for details.
+// - BMR, Sep 30, 2015
//--------------------------------------------------------------------------
DataType::~DataType()
{
try
{
- close();
+ close();
}
catch (Exception& close_error) {
- cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
+ cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl;
}
}
} // end namespace
diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h
index 4e904a6..fd9c17d 100644
--- a/c++/src/H5DataType.h
+++ b/c++/src/H5DataType.h
@@ -30,128 +30,128 @@ namespace H5 {
*/
class H5_DLLCPP DataType : public H5Object {
public:
- // Creates a datatype given its class and size
- DataType( const H5T_class_t type_class, size_t size );
+ // Creates a datatype given its class and size
+ DataType(const H5T_class_t type_class, size_t size);
- // Copy constructor: makes a copy of the original object
- DataType( const DataType& original );
+ // Copy constructor: makes a copy of the original object
+ DataType(const DataType& original);
- // Creates a copy of a predefined type
- DataType(const PredType& pred_type);
+ // Creates a copy of a predefined type
+ DataType(const PredType& pred_type);
- // Creates a datatype by way of dereference.
- DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
-// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
+ // Creates a datatype by way of dereference.
+ DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
+// DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
- // Closes this datatype.
- virtual void close();
+ // Closes this datatype.
+ virtual void close();
- // Copies an existing datatype to this datatype object.
- void copy(const DataType& like_type);
+ // Copies an existing datatype to this datatype object.
+ void copy(const DataType& like_type);
- // Copies the datatype of dset to this datatype object.
- void copy(const DataSet& dset);
+ // Copies the datatype of dset to this datatype object.
+ void copy(const DataSet& dset);
- // Returns the datatype class identifier.
- H5T_class_t getClass() const;
+ // Returns the datatype class identifier.
+ H5T_class_t getClass() const;
- // Commits a transient datatype to a file; this datatype becomes
- // a named datatype which can be accessed from the location.
- void commit(const H5Location& loc, const char* name);
- void commit(const H5Location& loc, const H5std_string& name);
+ // Commits a transient datatype to a file; this datatype becomes
+ // a named datatype which can be accessed from the location.
+ 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 - removed from 1.8.18 and 1.10.1
- //void commit(H5Location& loc, const char* name);
- //void commit(H5Location& loc, const H5std_string& name);
+ // These two overloaded functions are kept for backward compatibility
+ // 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.
- bool committed() const;
+ // Determines whether this datatype is a named datatype or
+ // a transient datatype.
+ bool committed() const;
// Finds a conversion function that can handle the conversion
// this datatype to the given datatype, dest.
- H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const;
+ H5T_conv_t find(const DataType& dest, H5T_cdata_t **pcdata) const;
- // Converts data from between specified datatypes.
- void convert( const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const;
+ // Converts data from between specified datatypes.
+ void convert(const DataType& dest, size_t nelmts, void *buf, void *background, const PropList& plist=PropList::DEFAULT) const;
- // Assignment operator
- DataType& operator=( const DataType& rhs );
+ // Assignment operator
+ DataType& operator=(const DataType& rhs);
- // Determines whether two datatypes are the same.
- bool operator==(const DataType& compared_type ) const;
+ // Determines whether two datatypes are the same.
+ bool operator==(const DataType& compared_type) const;
- // Locks a datatype.
- void lock() const;
+ // Locks a datatype.
+ void lock() const;
- // Returns the size of a datatype.
- size_t getSize() const;
+ // Returns the size of a datatype.
+ size_t getSize() const;
- // Returns the base datatype from which a datatype is derived.
- // Note: not quite right for specific types yet???
- DataType getSuper() const;
+ // Returns the base datatype from which a datatype is derived.
+ // Note: not quite right for specific types yet???
+ DataType getSuper() const;
- // Registers a conversion function.
- void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
- void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const;
+ // Registers a conversion function.
+ void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const;
+ void registerFunc(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const;
- // Removes a conversion function from all conversion paths.
- void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const;
- void unregister( H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func ) const;
+ // Removes a conversion function from all conversion paths.
+ void unregister(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func) const;
+ void unregister(H5T_pers_t pers, const H5std_string& name, const DataType& dest, H5T_conv_t func) const;
- // Tags an opaque datatype.
- void setTag( const char* tag ) const;
- void setTag( const H5std_string& tag ) const;
+ // Tags an opaque datatype.
+ void setTag(const char* tag) const;
+ void setTag(const H5std_string& tag) const;
- // Gets the tag associated with an opaque datatype.
- H5std_string getTag() const;
+ // Gets the tag associated with an opaque datatype.
+ H5std_string getTag() const;
- // Checks whether this datatype contains (or is) a certain type class.
- bool detectClass(H5T_class_t cls) const;
+ // Checks whether this datatype contains (or is) a certain type class.
+ bool detectClass(H5T_class_t cls) const;
- // Checks whether this datatype is a variable-length string.
- bool isVariableStr() const;
+ // Checks whether this datatype is a variable-length string.
+ bool isVariableStr() const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("DataType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DataType"); }
// From CommonFG then H5Location
- // Constructors to open a generic named datatype at a given location.
- DataType(const H5Location& loc, const char* name);
- DataType(const H5Location& loc, const H5std_string& name);
+ // Constructors to open a generic named datatype at a given location.
+ DataType(const H5Location& loc, const char* name);
+ DataType(const H5Location& loc, const H5std_string& name);
// End of From CommonFG then H5Location
- // Creates a copy of an existing DataType using its id
- DataType( const hid_t type_id );
+ // Creates a copy of an existing DataType using its id
+ DataType(const hid_t type_id);
- // Default constructor
- DataType();
+ // Default constructor
+ DataType();
- // Gets the datatype id.
- virtual hid_t getId() const;
+ // Gets the datatype id.
+ virtual hid_t getId() const;
- // Destructor: properly terminates access to this datatype.
- virtual ~DataType();
+ // Destructor: properly terminates access to this datatype.
+ virtual ~DataType();
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- hid_t id; // HDF5 datatype id
+ hid_t id; // HDF5 datatype id
- // Sets the datatype id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the datatype id.
+ virtual void p_setId(const hid_t new_id);
- // Opens a datatype and returns the id.
- hid_t p_opentype(const H5Location& loc, const char* dtype_name) const;
+ // Opens a datatype and returns the id.
+ hid_t p_opentype(const H5Location& loc, const char* dtype_name) const;
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- // Friend function to set DataType id. For library use only.
- friend void f_DataType_setId(DataType* dtype, hid_t new_id);
+ // Friend function to set DataType id. For library use only.
+ friend void f_DataType_setId(DataType* dtype, hid_t new_id);
- void p_commit(hid_t loc_id, const char* name);
+ void p_commit(hid_t loc_id, const char* name);
};
}
#endif // __H5DataType_H
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp
index 8ab38dc..86d4d9c 100644
--- a/c++/src/H5DcreatProp.cpp
+++ b/c++/src/H5DcreatProp.cpp
@@ -40,7 +40,7 @@ DSetCreatPropList* DSetCreatPropList::DEFAULT_ = 0;
// Function: DSetCreatPropList::getConstant
// Purpose: Creates a DSetCreatPropList object representing the HDF5
// constant H5P_DATASET_CREATE, pointed to by
-// DSetCreatPropList::DEFAULT_
+// DSetCreatPropList::DEFAULT_
// exception H5::PropListIException
// Description
// If DSetCreatPropList::DEFAULT_ already points to an allocated
@@ -80,670 +80,670 @@ void DSetCreatPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose Constant for dataset creation default property
+// Purpose Constant for dataset creation default property
//--------------------------------------------------------------------------
const DSetCreatPropList& DSetCreatPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList default constructor
-///\brief Default constructor: creates a stub dataset creation property list
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList default constructor
+///\brief Default constructor: creates a stub dataset creation property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList::DSetCreatPropList() : ObjCreatPropList(H5P_DATASET_CREATE) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// DSetCreatPropList object
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// DSetCreatPropList object
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : ObjCreatPropList(orig) {}
+DSetCreatPropList::DSetCreatPropList(const DSetCreatPropList& orig) : ObjCreatPropList(orig) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList overloaded constructor
-///\brief Creates a DSetCreatPropList object using the id of an
-/// existing dataset creation property list.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList overloaded constructor
+///\brief Creates a DSetCreatPropList object using the id of an
+/// existing dataset creation property list.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : ObjCreatPropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setChunk
-///\brief Sets the size of the chunks used to store a chunked layout
-/// dataset.
-///\param ndims - IN: Number of dimensions of each chunk
-///\param dim - IN: Array containing the size of each chunk
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setChunk
+///\brief Sets the size of the chunks used to store a chunked layout
+/// dataset.
+///\param ndims - IN: Number of dimensions of each chunk
+///\param dim - IN: Array containing the size of each chunk
+///\exception H5::PropListIException
///\par Description
-/// The \a ndims parameter currently must have the same value as
-/// the rank of the dataset. The values of the \a dim array
-/// define the size of the chunks to store the dataset's raw
-/// data. As a side-effect, the layout of the dataset will be
-/// changed to \c H5D_CHUNKED, if it is not so already.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
+/// The \a ndims parameter currently must have the same value as
+/// the rank of the dataset. The values of the \a dim array
+/// define the size of the chunks to store the dataset's raw
+/// data. As a side-effect, the layout of the dataset will be
+/// changed to \c H5D_CHUNKED, if it is not so already.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DSetCreatPropList::setChunk(int ndims, const hsize_t* dim) const
{
- herr_t ret_value = H5Pset_chunk( id, ndims, dim );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed");
- }
+ herr_t ret_value = H5Pset_chunk(id, ndims, dim);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setChunk", "H5Pset_chunk failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getChunk
-///\brief Retrieves the size of the chunks used to store a chunked
-/// layout dataset.
-///\param max_ndims - IN: Size of \a dim array
-///\param dim - OUT: Array to store the chunk dimensions
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList::getChunk
+///\brief Retrieves the size of the chunks used to store a chunked
+/// layout dataset.
+///\param max_ndims - IN: Size of \a dim array
+///\param dim - OUT: Array to store the chunk dimensions
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
+int DSetCreatPropList::getChunk(int max_ndims, hsize_t* dim) const
{
- int chunk_size = H5Pget_chunk( id, max_ndims, dim );
- if( chunk_size < 0 )
- {
- throw PropListIException("DSetCreatPropList::getChunk",
- "H5Pget_chunk returns negative chunk size");
- }
- return( chunk_size );
+ int chunk_size = H5Pget_chunk(id, max_ndims, dim);
+ if (chunk_size < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getChunk",
+ "H5Pget_chunk returns negative chunk size");
+ }
+ return(chunk_size);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setLayout
-///\brief Sets the type of storage used store the raw data for a dataset.
-///\param layout - IN: Type of storage layout for raw data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setLayout
+///\brief Sets the type of storage used store the raw data for a dataset.
+///\param layout - IN: Type of storage layout for raw data
+///\exception H5::PropListIException
///\par Description
-/// For information on valid layout types, please refer to
+/// For information on valid layout types, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setLayout(H5D_layout_t layout) const
{
- herr_t ret_value = H5Pset_layout( id, layout );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setLayout",
- "H5Pset_layout failed");
- }
+ herr_t ret_value = H5Pset_layout(id, layout);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setLayout",
+ "H5Pset_layout failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getLayout
-///\brief Retrieves the layout type of this property list
-///\return Layout type, which can be:
-/// \li \c H5D_COMPACT - raw data is stored in the object
-/// header in the file.
-/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the
-/// object header in one contiguous chunk in
-/// the file.
-/// \li \c H5D_CHUNKED - raw data is stored separately from the
-/// object header in chunks in separate locations
-/// in the file.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getLayout
+///\brief Retrieves the layout type of this property list
+///\return Layout type, which can be:
+/// \li \c H5D_COMPACT - raw data is stored in the object
+/// header in the file.
+/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the
+/// object header in one contiguous chunk in
+/// the file.
+/// \li \c H5D_CHUNKED - raw data is stored separately from the
+/// object header in chunks in separate locations
+/// in the file.
+///\exception H5::PropListIException
///\par Description
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_layout_t DSetCreatPropList::getLayout() const
{
- H5D_layout_t layout = H5Pget_layout( id );
- if( layout == H5D_LAYOUT_ERROR )
- {
- throw PropListIException("DSetCreatPropList::getLayout",
- "H5Pget_layout returns H5D_LAYOUT_ERROR");
- }
- return( layout );
+ H5D_layout_t layout = H5Pget_layout(id);
+ if (layout == H5D_LAYOUT_ERROR)
+ {
+ throw PropListIException("DSetCreatPropList::getLayout",
+ "H5Pget_layout returns H5D_LAYOUT_ERROR");
+ }
+ return(layout);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setDeflate
-///\brief Sets compression method and compression level
-///\param level - IN: Compression level, should [0..9], inclusive
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setDeflate
+///\brief Sets compression method and compression level
+///\param level - IN: Compression level, should [0..9], inclusive
+///\exception H5::PropListIException
///\par Description
-/// The function sets the compression method for this property
-/// list to \c H5D_COMPRESS_DEFLATE and the compression level to
-/// \a level. Lower compression levels are faster but result in
-/// less compression.
-// Programmer Binh-Minh Ribler - 2000
+/// The function sets the compression method for this property
+/// list to \c H5D_COMPRESS_DEFLATE and the compression level to
+/// \a level. Lower compression levels are faster but result in
+/// less compression.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetCreatPropList::setDeflate( int level ) const
+void DSetCreatPropList::setDeflate(int level) const
{
- herr_t ret_value = H5Pset_deflate( id, level );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setDeflate",
- "H5Pset_deflate failed");
- }
+ herr_t ret_value = H5Pset_deflate(id, level);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setDeflate",
+ "H5Pset_deflate failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setSzip
-///\brief Sets up for the use of the SZIP compression filter.
-///\param options_mask - IN: A bit-mask conveying the desired SZIP
-/// options. Valid values are H5_SZIP_EC_OPTION_MASK
-/// and H5_SZIP_NN_OPTION_MASK.
-///\param pixels_per_block - IN: Number of pixels or data elements in
-/// each data block.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setSzip
+///\brief Sets up for the use of the SZIP compression filter.
+///\param options_mask - IN: A bit-mask conveying the desired SZIP
+/// options. Valid values are H5_SZIP_EC_OPTION_MASK
+/// and H5_SZIP_NN_OPTION_MASK.
+///\param pixels_per_block - IN: Number of pixels or data elements in
+/// each data block.
+///\exception H5::PropListIException
///\par Description
-/// The associate C function sets an SZIP compression filter,
-/// H5Z_FILTER_SZIP, for a dataset. For more information about
-/// SZIP and usage, please refer to the C layer Reference
-/// Manual at:
+/// The associate C function sets an SZIP compression filter,
+/// H5Z_FILTER_SZIP, for a dataset. For more information about
+/// SZIP and usage, please refer to the C layer Reference
+/// Manual at:
/// http://hdfgroup.org/HDF5/doc/RM_H5P.html#Property-SetSzip
-// Programmer Binh-Minh Ribler - Jan, 2007
+// Programmer Binh-Minh Ribler - Jan, 2007
//--------------------------------------------------------------------------
void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_per_block) const
{
herr_t ret_value = H5Pset_szip(id, options_mask, pixels_per_block);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw PropListIException("DSetCreatPropList::setSzip",
- "H5Pset_szip failed");
+ throw PropListIException("DSetCreatPropList::setSzip",
+ "H5Pset_szip failed");
}
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setNbit
-///\brief Sets up for the use of the Nbit compression filter.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setNbit
+///\brief Sets up for the use of the Nbit compression filter.
+///\exception H5::PropListIException
///\par Description
-/// The associate C function sets an Nbit compression filter,
-/// H5Z_FILTER_NBIT, for a dataset. For more information about
-/// Nbit compression, please refer to the C layer Reference
-/// Manual at:
+/// The associate C function sets an Nbit compression filter,
+/// H5Z_FILTER_NBIT, for a dataset. For more information about
+/// Nbit compression, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-setNbit
-// Programmer Binh-Minh Ribler - Apr, 2016
+// Programmer Binh-Minh Ribler - Apr, 2016
//--------------------------------------------------------------------------
void DSetCreatPropList::setNbit() const
{
herr_t ret_value = H5Pset_nbit(id);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw PropListIException("DSetCreatPropList::setNbit",
- "H5Pset_nbit failed");
+ throw PropListIException("DSetCreatPropList::setNbit",
+ "H5Pset_nbit failed");
}
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFillValue
-///\brief Sets a dataset fill value
-///\param fvalue_type - IN: Data type for the value passed via \a value
-///\param value - IN: Pointer to buffer containing the fill value
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFillValue
+///\brief Sets a dataset fill value
+///\param fvalue_type - IN: Data type for the value passed via \a value
+///\param value - IN: Pointer to buffer containing the fill value
+///\exception H5::PropListIException
///\par Description
-/// The datatype may differ from that of the dataset, but it must
-/// be one that the HDF5 library is able to convert \a value to
-/// the dataset datatype when the dataset is created.
-/// The default fill value is 0 (zero,) which is interpreted
-/// according to the actual dataset datatype.
+/// The datatype may differ from that of the dataset, but it must
+/// be one that the HDF5 library is able to convert \a value to
+/// the dataset datatype when the dataset is created.
+/// The default fill value is 0 (zero,) which is interpreted
+/// according to the actual dataset datatype.
///\par
-/// For information on setting fill value, please refer to the
-/// C layer Reference Manual at:
+/// For information on setting fill value, please refer to the
+/// C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const
+void DSetCreatPropList::setFillValue(const DataType& fvalue_type, const void* value) const
{
- herr_t ret_value = H5Pset_fill_value( id, fvalue_type.getId(), value );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setFillValue",
+ herr_t ret_value = H5Pset_fill_value(id, fvalue_type.getId(), value);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setFillValue",
"H5Pset_fill_value failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFillValue
-///\brief Retrieves a dataset fill value
-///\param fvalue_type - IN: Data type for the value passed via \a value
-///\param value - OUT: Pointer to buffer to hold the retrieved fill value
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFillValue
+///\brief Retrieves a dataset fill value
+///\param fvalue_type - IN: Data type for the value passed via \a value
+///\param value - OUT: Pointer to buffer to hold the retrieved fill value
+///\exception H5::PropListIException
///\par Description
-/// The fill value is returned through \a value pointer
-/// and the memory is allocated by the caller. The fill
-/// value will be converted from its current data type to the
-/// specified by \a fvalue_type.
-// Programmer Binh-Minh Ribler - 2000
+/// The fill value is returned through \a value pointer
+/// and the memory is allocated by the caller. The fill
+/// value will be converted from its current data type to the
+/// specified by \a fvalue_type.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const
+void DSetCreatPropList::getFillValue(const DataType& fvalue_type, void* value) const
{
- herr_t ret_value = H5Pget_fill_value( id, fvalue_type.getId(), value );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::getFillValue",
+ herr_t ret_value = H5Pget_fill_value(id, fvalue_type.getId(), value);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getFillValue",
"H5Pget_fill_value failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::isFillValueDefined
-///\brief Check if fill value has been defined for this property
+// Function: DSetCreatPropList::isFillValueDefined
+///\brief Check if fill value has been defined for this property
///\return
-/// \li \c H5D_FILL_VALUE_UNDEFINED =0,
-/// \li \c H5D_FILL_VALUE_DEFAULT =1,
-/// \li \c H5D_FILL_VALUE_USER_DEFINED =2
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+/// \li \c H5D_FILL_VALUE_UNDEFINED =0,
+/// \li \c H5D_FILL_VALUE_DEFAULT =1,
+/// \li \c H5D_FILL_VALUE_USER_DEFINED =2
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_fill_value_t DSetCreatPropList::isFillValueDefined() const
{
- H5D_fill_value_t status;
- herr_t ret_value = H5Pfill_value_defined(id, &status);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::isFillValueDefined",
+ H5D_fill_value_t status;
+ herr_t ret_value = H5Pfill_value_defined(id, &status);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::isFillValueDefined",
"H5Pfill_value_defined returned H5D_FILL_VALUE_ERROR (-1)");
- }
- else
- return (status);
+ }
+ else
+ return (status);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFilter
-///\brief Adds a filter to the filter pipeline
-///\param filter_id - IN: Filter to add
-///\param flags - IN: Specifies general properties of the filter
-///\param cd_nelmts - IN: Number of elements in cd_values
-///\param cd_values - IN: Auxiliary data for the filter
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFilter
+///\brief Adds a filter to the filter pipeline
+///\param filter_id - IN: Filter to add
+///\param flags - IN: Specifies general properties of the filter
+///\param cd_nelmts - IN: Number of elements in cd_values
+///\param cd_values - IN: Auxiliary data for the filter
+///\exception H5::PropListIException
///\par Description
-/// The \a flags argument is a bit vector of the field:
-/// \c H5Z_FLAG_OPTIONAL(0x0001)
+/// The \a flags argument is a bit vector of the field:
+/// \c H5Z_FLAG_OPTIONAL(0x0001)
///\par
-/// If this bit is set then the filter is optional. If the filter
-/// fails during a \c DataSet::write() operation then the filter
-/// is just excluded from the pipeline for the chunk for which it
-/// failed; the filter will not participate in the pipeline
-/// during a \c DataSet::read() of the chunk. If this bit is clear
-/// and the filter fails then the entire I/O operation fails.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags,
- size_t cd_nelmts, const unsigned int cd_values[] ) const
+/// If this bit is set then the filter is optional. If the filter
+/// fails during a \c DataSet::write() operation then the filter
+/// is just excluded from the pipeline for the chunk for which it
+/// failed; the filter will not participate in the pipeline
+/// during a \c DataSet::read() of the chunk. If this bit is clear
+/// and the filter fails then the entire I/O operation fails.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DSetCreatPropList::setFilter(H5Z_filter_t filter_id, unsigned int flags,
+ size_t cd_nelmts, const unsigned int cd_values[]) const
{
- herr_t ret_value = H5Pset_filter( id, filter_id, flags, cd_nelmts, cd_values );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setFilter",
+ herr_t ret_value = H5Pset_filter(id, filter_id, flags, cd_nelmts, cd_values);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setFilter",
"H5Pset_filter failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::removeFilter
-///\brief Removes one or more filters
-///\param filter_id - IN: Filter to remove
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::removeFilter
+///\brief Removes one or more filters
+///\param filter_id - IN: Filter to remove
+///\exception H5::PropListIException
///\par Description
-/// Deletes a filter from the dataset creation property list;
-/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE.
-// Programmer Binh-Minh Ribler - 2000
+/// Deletes a filter from the dataset creation property list;
+/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const
{
- herr_t ret_value = H5Premove_filter( id, filter_id);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::removeFilter",
+ herr_t ret_value = H5Premove_filter(id, filter_id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::removeFilter",
"H5Premove_filter failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getNfilters
-///\brief Returns the number of filters in the pipeline
-///\return Number of filters
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList::getNfilters
+///\brief Returns the number of filters in the pipeline
+///\return Number of filters
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DSetCreatPropList::getNfilters() const
{
- int num_filters = H5Pget_nfilters( id );
- if( num_filters < 0 )
- {
- throw PropListIException("DSetCreatPropList::getNfilters",
+ int num_filters = H5Pget_nfilters(id);
+ if (num_filters < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getNfilters",
"H5Pget_nfilters returned negative number of filters");
- }
- else
- return( num_filters );
+ }
+ else
+ return(num_filters);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFilter
-///\brief Returns information about a filter in a pipeline
-///\param filter_number - IN: Filter to get, range [0..N-1], where
-/// N is returned by H5Pget_nfilters()
-///\param flags - OUT: General properties of the filter
-///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
-/// of values defined by the filter
-///\param cd_values - OUT: Array to hold the data; allocated by the user
-///\param namelen - IN: Length of \a name
-///\param name - OUT: Name of the filter
-///\param filter_config - OUT: Flags indicating whether filter can encode/decode
-///\return Filter id
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFilter
+///\brief Returns information about a filter in a pipeline
+///\param filter_number - IN: Filter to get, range [0..N-1], where
+/// N is returned by H5Pget_nfilters()
+///\param flags - OUT: General properties of the filter
+///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
+/// of values defined by the filter
+///\param cd_values - OUT: Array to hold the data; allocated by the user
+///\param namelen - IN: Length of \a name
+///\param name - OUT: Name of the filter
+///\param filter_config - OUT: Flags indicating whether filter can encode/decode
+///\return Filter id
+///\exception H5::PropListIException
///\par Description
-/// Failure occurs when \a filter_number is out of range.
-// Note: the first argument was mistakenly typed as int instead
-// of unsigned int, but for backward compatibility, it cannot be
-// changed. -BMR (2014/04/15)
+/// Failure occurs when \a filter_number is out of range.
+// Note: the first argument was mistakenly typed as int instead
+// of unsigned int, but for backward compatibility, it cannot be
+// changed. -BMR (2014/04/15)
//--------------------------------------------------------------------------
H5Z_filter_t DSetCreatPropList::getFilter(int filter_number,
- unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values,
- size_t namelen, char name[], unsigned int& filter_config) const
+ unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values,
+ size_t namelen, char name[], unsigned int& filter_config) const
{
- H5Z_filter_t filter_id;
- filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts,
- cd_values, namelen, name, &filter_config);
- if( filter_id == H5Z_FILTER_ERROR )
- throw PropListIException("DSetCreatPropList::getFilter",
+ H5Z_filter_t filter_id;
+ filter_id = H5Pget_filter2(id, filter_number, &flags, &cd_nelmts,
+ cd_values, namelen, name, &filter_config);
+ if (filter_id == H5Z_FILTER_ERROR)
+ throw PropListIException("DSetCreatPropList::getFilter",
"H5Pget_filter2 returned H5Z_FILTER_ERROR");
- else
- return(filter_id);
+ else
+ return(filter_id);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFilterById
-///\brief Returns information about a filter in a pipeline given the
-/// filter id
-///\param filter_id - IN: Filter to get
-///\param flags - OUT: General properties of the filter
-///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
-/// of values defined by the filter
-///\param cd_values - OUT: Array to hold the data; allocated by the user
-///\param namelen - IN: Length of \a name
-///\param name - OUT: Name of the filter
-///\param filter_config - OUT: Flags indicating whether filter can encode/decode
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList::getFilterById
+///\brief Returns information about a filter in a pipeline given the
+/// filter id
+///\param filter_id - IN: Filter to get
+///\param flags - OUT: General properties of the filter
+///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number
+/// of values defined by the filter
+///\param cd_values - OUT: Array to hold the data; allocated by the user
+///\param namelen - IN: Length of \a name
+///\param name - OUT: Name of the filter
+///\param filter_config - OUT: Flags indicating whether filter can encode/decode
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id,
- unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values,
- size_t namelen, char name[], unsigned int &filter_config) const
+ unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values,
+ size_t namelen, char name[], unsigned int &filter_config) const
{
- herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts,
- cd_values, namelen, name, &filter_config);
- if (ret_value < 0)
- throw PropListIException("DSetCreatPropList::getFilterById",
+ herr_t ret_value = H5Pget_filter_by_id2(id, filter_id, &flags, &cd_nelmts,
+ cd_values, namelen, name, &filter_config);
+ if (ret_value < 0)
+ throw PropListIException("DSetCreatPropList::getFilterById",
"H5Pget_filter_by_id2 failed");
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::modifyFilter
-///\brief Modifies the specified filter
-///\param filter_id - IN: Filter to get
-///\param flags - OUT: General properties of the filter
-///\param cd_nelmts - IN: Number of elements in \a cd_values
-/// \n OUT: Number of values defined by the filter
-///\param cd_values - OUT: Array to hold the data; allocated by the user
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::modifyFilter
+///\brief Modifies the specified filter
+///\param filter_id - IN: Filter to get
+///\param flags - OUT: General properties of the filter
+///\param cd_nelmts - IN: Number of elements in \a cd_values
+/// \n OUT: Number of values defined by the filter
+///\param cd_values - OUT: Array to hold the data; allocated by the user
+///\exception H5::PropListIException
///\par Description
-/// The \a flags argument is a bit vector of the field:
-/// \c H5Z_FLAG_OPTIONAL(0x0001)
+/// The \a flags argument is a bit vector of the field:
+/// \c H5Z_FLAG_OPTIONAL(0x0001)
///\par
-/// If this bit is set then the filter is optional. If the filter
-/// fails during a DataSet::write() operation then the filter
-/// is just excluded from the pipeline for the chunk for which it
-/// failed; the filter will not participate in the pipeline
-/// during a DataSet::read() of the chunk. If this bit is clear
-/// and the filter fails then the entire I/O operation fails.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int
- flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
+/// If this bit is set then the filter is optional. If the filter
+/// fails during a DataSet::write() operation then the filter
+/// is just excluded from the pipeline for the chunk for which it
+/// failed; the filter will not participate in the pipeline
+/// during a DataSet::read() of the chunk. If this bit is clear
+/// and the filter fails then the entire I/O operation fails.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DSetCreatPropList::modifyFilter(H5Z_filter_t filter_id, unsigned int
+ flags, size_t cd_nelmts, const unsigned int cd_values[]) const
{
- herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::modifyFilter",
+ herr_t ret_value = H5Pmodify_filter(id, filter_id, flags, cd_nelmts, cd_values);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::modifyFilter",
"H5Pmodify_filter failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::allFiltersAvail
-///\brief Queries whether all the filters set in this property list
-/// are available currently.
-///\return true if all filters available, and false if one or more
-/// filters not currently available
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList::allFiltersAvail
+///\brief Queries whether all the filters set in this property list
+/// are available currently.
+///\return true if all filters available, and false if one or more
+/// filters not currently available
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DSetCreatPropList::allFiltersAvail() const
{
- htri_t ret_value = H5Pall_filters_avail(id);
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else // Raise exception when H5Pall_filters_avail returns a negative value
- {
- throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value");
- }
+ htri_t ret_value = H5Pall_filters_avail(id);
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else // Raise exception when H5Pall_filters_avail returns a negative value
+ {
+ throw PropListIException("DSetCreatPropList::allFiltersAvail", "H5Pall_filters_avail returned negative value");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setShuffle
-///\brief Sets method of the shuffle filter
+// Function: DSetCreatPropList::setShuffle
+///\brief Sets method of the shuffle filter
///
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
-/// Please refer to the Reference Manual of \c H5Pset_shuffle for
-/// details.
+/// Please refer to the Reference Manual of \c H5Pset_shuffle for
+/// details.
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setShuffle() const
{
- herr_t ret_value = H5Pset_shuffle(id);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setShuffle",
+ herr_t ret_value = H5Pset_shuffle(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setShuffle",
"H5Pset_shuffle failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getAllocTime
-///\brief Get space allocation time for this property.
-///\return Space allocation time.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getAllocTime
+///\brief Get space allocation time for this property.
+///\return Space allocation time.
+///\exception H5::PropListIException
///\par Description
-/// The values of space allocation time can be one of the
-/// followings:
-/// \li \c H5D_ALLOC_TIME_DEFAULT
-/// \li \c H5D_ALLOC_TIME_EARLY
-/// \li \c H5D_ALLOC_TIME_LATE
-/// \li \c H5D_ALLOC_TIME_INCR
-// Programmer Binh-Minh Ribler - 2000
+/// The values of space allocation time can be one of the
+/// followings:
+/// \li \c H5D_ALLOC_TIME_DEFAULT
+/// \li \c H5D_ALLOC_TIME_EARLY
+/// \li \c H5D_ALLOC_TIME_LATE
+/// \li \c H5D_ALLOC_TIME_INCR
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_alloc_time_t DSetCreatPropList::getAllocTime() const
{
- H5D_alloc_time_t alloc_time;
- herr_t ret_value = H5Pget_alloc_time(id, &alloc_time);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::getAllocTime",
+ H5D_alloc_time_t alloc_time;
+ herr_t ret_value = H5Pget_alloc_time(id, &alloc_time);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getAllocTime",
"H5Pget_alloc_time failed");
- }
- else
- return (alloc_time);
+ }
+ else
+ return (alloc_time);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFillTime
-///\brief Gets fill value writing time.
-///\return Fill value writing time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFillTime
+///\brief Gets fill value writing time.
+///\return Fill value writing time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for fill value writing time include
-/// \li \c H5D_FILL_TIME_NEVER
-/// \li \c H5D_FILL_TIME_ALLOC.
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for fill value writing time include
+/// \li \c H5D_FILL_TIME_NEVER
+/// \li \c H5D_FILL_TIME_ALLOC.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_fill_time_t DSetCreatPropList::getFillTime() const
{
- H5D_fill_time_t fill_time;
- herr_t ret_value = H5Pget_fill_time(id, &fill_time);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::getFillTime",
+ H5D_fill_time_t fill_time;
+ herr_t ret_value = H5Pget_fill_time(id, &fill_time);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getFillTime",
"H5Pget_fill_time failed");
- }
- else
- return (fill_time);
+ }
+ else
+ return (fill_time);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setAllocTime
-///\brief Sets space allocation time for dataset during creation.
-///\param alloc_time - IN: Allocation time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setAllocTime
+///\brief Sets space allocation time for dataset during creation.
+///\param alloc_time - IN: Allocation time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for space allocation time include:
-/// \li \c H5D_ALLOC_TIME_DEFAULT
-/// \li \c H5D_ALLOC_TIME_EARLY
-/// \li \c H5D_ALLOC_TIME_LATE
-/// \li \c H5D_ALLOC_TIME_INCR
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for space allocation time include:
+/// \li \c H5D_ALLOC_TIME_DEFAULT
+/// \li \c H5D_ALLOC_TIME_EARLY
+/// \li \c H5D_ALLOC_TIME_LATE
+/// \li \c H5D_ALLOC_TIME_INCR
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time) const
{
- herr_t ret_value = H5Pset_alloc_time(id, alloc_time);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setAllocTime",
+ herr_t ret_value = H5Pset_alloc_time(id, alloc_time);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setAllocTime",
"H5Pset_alloc_time failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFillTime
-///\brief Sets fill value writing time for dataset.
-///\return Fill value writing time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFillTime
+///\brief Sets fill value writing time for dataset.
+///\return Fill value writing time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for fill value writing time include
-/// \li \c H5D_FILL_TIME_NEVER
-/// \li \c H5D_FILL_TIME_ALLOC.
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for fill value writing time include
+/// \li \c H5D_FILL_TIME_NEVER
+/// \li \c H5D_FILL_TIME_ALLOC.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time) const
{
- herr_t ret_value = H5Pset_fill_time(id, fill_time);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setFillTime",
+ herr_t ret_value = H5Pset_fill_time(id, fill_time);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setFillTime",
"H5Pset_fill_time failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFletcher32
-///\brief Sets Fletcher32 checksum of EDC for this property list.
+// Function: DSetCreatPropList::setFletcher32
+///\brief Sets Fletcher32 checksum of EDC for this property list.
///
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setFletcher32() const
{
- herr_t ret_value = H5Pset_fletcher32(id);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setFletcher32",
+ herr_t ret_value = H5Pset_fletcher32(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setFletcher32",
"H5Pset_fletcher32 failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setExternal
-///\brief Adds an external file to the list of external files
-///\param name - IN: Name of the external file
-///\param offset - IN: Location where the data starts in the file
-///\param size - IN: Number of bytes reserved in the file for the data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setExternal
+///\brief Adds an external file to the list of external files
+///\param name - IN: Name of the external file
+///\param offset - IN: Location where the data starts in the file
+///\param size - IN: Number of bytes reserved in the file for the data
+///\exception H5::PropListIException
///\par Description
-/// If a dataset is splitted across multiple files then the files
-/// should be defined in order. The total size of the dataset is
-/// the sum of the \a size arguments for all the external files. If
-/// the total size is larger than the size of a dataset then the
-/// dataset can be extended (provided the data space also allows
-/// the extending).
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const
+/// If a dataset is splitted across multiple files then the files
+/// should be defined in order. The total size of the dataset is
+/// the sum of the \a size arguments for all the external files. If
+/// the total size is larger than the size of a dataset then the
+/// dataset can be extended (provided the data space also allows
+/// the extending).
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DSetCreatPropList::setExternal(const char* name, off_t offset, hsize_t size) const
{
- herr_t ret_value = H5Pset_external( id, name, offset, size );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::setExternal",
+ herr_t ret_value = H5Pset_external(id, name, offset, size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::setExternal",
"H5Pset_external failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getExternalCount
-///\brief Returns the number of external files for a dataset
-///\return Number of external files
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetCreatPropList::getExternalCount
+///\brief Returns the number of external files for a dataset
+///\return Number of external files
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DSetCreatPropList::getExternalCount() const
{
- int num_ext_files = H5Pget_external_count( id );
- if( num_ext_files < 0 )
- {
- throw PropListIException("DSetCreatPropList::getExternalCount",
+ int num_ext_files = H5Pget_external_count(id);
+ if (num_ext_files < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getExternalCount",
"H5Pget_external_count returns negative number of external files");
- }
- else
- return( num_ext_files );
+ }
+ else
+ return(num_ext_files);
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getExternal
-///\brief Returns information about an external file
-///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
-/// returned by getExternalCount()
-///\param name_size - IN: Maximum length of \a name
-///\param name - OUT: Name of the external file
-///\param offset - OUT: Location to return an offset value
-///\param size - OUT: Location to return the size of the external file data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getExternal
+///\brief Returns information about an external file
+///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
+/// returned by getExternalCount()
+///\param name_size - IN: Maximum length of \a name
+///\param name - OUT: Name of the external file
+///\param offset - OUT: Location to return an offset value
+///\param size - OUT: Location to return the size of the external file data
+///\exception H5::PropListIException
///\par Description
-/// The parameter \a idx ranges [0..N-1] where N is returned by
-/// getExternalCount(). At most \a name_size characters are copied
-/// into the name array. If the external file name is longer than
-/// name_size with the null terminator, the return value is not
-/// null terminated (similar to strncpy()).
-/// If \a name_size is zero or \a name is a null pointer, the
-/// external file name will not be returned. If \a offset or
-/// \a size are null pointers then the corresponding information
-/// will not be returned.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const
+/// The parameter \a idx ranges [0..N-1] where N is returned by
+/// getExternalCount(). At most \a name_size characters are copied
+/// into the name array. If the external file name is longer than
+/// name_size with the null terminator, the return value is not
+/// null terminated (similar to strncpy()).
+/// If \a name_size is zero or \a name is a null pointer, the
+/// external file name will not be returned. If \a offset or
+/// \a size are null pointers then the corresponding information
+/// will not be returned.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const
{
- herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetCreatPropList::getExternal",
+ herr_t ret_value = H5Pget_external(id, idx, name_size, name, &offset, &size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetCreatPropList::getExternal",
"H5Pget_external failed");
- }
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList destructor
-///\brief Noop destructor.
+// Function: DSetCreatPropList destructor
+///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetCreatPropList::~DSetCreatPropList () {}
+DSetCreatPropList::~DSetCreatPropList() {}
} // end namespace
diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h
index 60ce1d5..b536709 100644
--- a/c++/src/H5DcreatProp.h
+++ b/c++/src/H5DcreatProp.h
@@ -29,105 +29,105 @@ class DataType;
*/
class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
public:
- ///\brief Default dataset creation property list.
- static const DSetCreatPropList& DEFAULT;
+ ///\brief Default dataset creation property list.
+ static const DSetCreatPropList& DEFAULT;
- // Creates a dataset creation property list.
- DSetCreatPropList();
+ // Creates a dataset creation property list.
+ DSetCreatPropList();
- // Queries whether all the filters set in this property list are
- // available currently.
- bool allFiltersAvail() const;
+ // Queries whether all the filters set in this property list are
+ // available currently.
+ bool allFiltersAvail() const;
- // Get space allocation time for this property.
- H5D_alloc_time_t getAllocTime() const;
+ // Get space allocation time for this property.
+ H5D_alloc_time_t getAllocTime() const;
- // Set space allocation time for dataset during creation.
- void setAllocTime(H5D_alloc_time_t alloc_time) const;
+ // Set space allocation time for dataset during creation.
+ 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;
+ // Retrieves the size of the chunks used to store a chunked layout dataset.
+ int getChunk(int max_ndims, hsize_t* dim) const;
- // Sets the size of the chunks used to store a chunked layout dataset.
- void setChunk( int ndims, const hsize_t* dim ) const;
+ // Sets the size of the chunks used to store a chunked layout dataset.
+ void setChunk(int ndims, const hsize_t* dim) const;
- // Returns information about an external file.
- void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
+ // Returns information about an external file.
+ void getExternal(unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size) const;
- // Returns the number of external files for a dataset.
- int getExternalCount() const;
+ // Returns the number of external files for a dataset.
+ int getExternalCount() const;
- // Gets fill value writing time.
- H5D_fill_time_t getFillTime() const;
+ // Gets fill value writing time.
+ H5D_fill_time_t getFillTime() const;
- // Sets fill value writing time for dataset.
- void setFillTime(H5D_fill_time_t fill_time) const;
+ // Sets fill value writing time for dataset.
+ void setFillTime(H5D_fill_time_t fill_time) const;
- // Retrieves a dataset fill value.
- void getFillValue( const DataType& fvalue_type, void* value ) const;
+ // Retrieves a dataset fill value.
+ void getFillValue(const DataType& fvalue_type, void* value) const;
- // Sets a dataset fill value.
- void setFillValue( const DataType& fvalue_type, const void* value ) const;
+ // Sets a dataset fill value.
+ void setFillValue(const DataType& fvalue_type, const void* value) const;
- // Returns information about a filter in a pipeline.
- H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const;
+ // Returns information about a filter in a pipeline.
+ H5Z_filter_t getFilter(int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const;
- // Returns information about a filter in a pipeline given the filter id.
- void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const;
+ // Returns information about a filter in a pipeline given the filter id.
+ void getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const;
- // Gets the layout of the raw data storage of the data that uses this
- // property list.
- H5D_layout_t getLayout() const;
+ // Gets the layout of the raw data storage of the data that uses this
+ // property list.
+ H5D_layout_t getLayout() const;
- // Sets the type of storage used to store the raw data for the
- // dataset that uses this property list.
- void setLayout(H5D_layout_t layout) const;
+ // Sets the type of storage used to store the raw data for the
+ // dataset that uses this property list.
+ void setLayout(H5D_layout_t layout) const;
- // Returns the number of filters in the pipeline.
- int getNfilters() const;
+ // Returns the number of filters in the pipeline.
+ int getNfilters() const;
- // Checks if fill value has been defined for this property.
- H5D_fill_value_t isFillValueDefined() const;
+ // Checks if fill value has been defined for this property.
+ 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;
+ // Modifies the specified filter.
+ void modifyFilter(H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[]) const;
- // Remove one or all filters from the filter pipeline.
- void removeFilter( H5Z_filter_t filter_id) const;
+ // Remove one or all filters from the filter pipeline.
+ void removeFilter(H5Z_filter_t filter_id) const;
- // Sets compression method and compression level.
- void setDeflate( int level ) const;
+ // Sets compression method and compression level.
+ void setDeflate(int level) const;
- // Adds an external file to the list of external files.
- void setExternal( const char* name, off_t offset, hsize_t size ) const;
+ // Adds an external file to the list of external files.
+ void setExternal(const char* name, off_t offset, hsize_t size) const;
- // Adds a filter to the filter pipeline.
- void setFilter( H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const;
+ // Adds a filter to the filter pipeline.
+ void setFilter(H5Z_filter_t filter, unsigned int flags = 0, size_t cd_nelmts = 0, const unsigned int cd_values[] = NULL) const;
- // Sets Fletcher32 checksum of EDC for this property list.
- void setFletcher32() const;
+ // Sets Fletcher32 checksum of EDC for this property list.
+ void setFletcher32() const;
- // Sets method of the shuffle filter.
- void setShuffle() const;
+ // Sets method of the shuffle filter.
+ void setShuffle() const;
- // Sets SZIP compression method.
- void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const;
+ // Sets SZIP compression method.
+ void setSzip(unsigned int options_mask, unsigned int pixels_per_block) const;
- // Sets N-bit compression method.
- void setNbit() const;
+ // Sets N-bit compression method.
+ void setNbit() const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("DSetCreatPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DSetCreatPropList"); }
- // Copy constructor: creates a copy of a DSetCreatPropList object.
- DSetCreatPropList(const DSetCreatPropList& orig);
+ // Copy constructor: creates a copy of a DSetCreatPropList object.
+ DSetCreatPropList(const DSetCreatPropList& orig);
- // Creates a copy of an existing dataset creation property list
- // using the property list id.
- DSetCreatPropList(const hid_t plist_id);
+ // Creates a copy of an existing dataset creation property list
+ // using the property list id.
+ DSetCreatPropList(const hid_t plist_id);
- // Noop destructor.
- virtual ~DSetCreatPropList();
+ // Noop destructor.
+ virtual ~DSetCreatPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -135,7 +135,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
static void deleteConstants();
private:
- static DSetCreatPropList* DEFAULT_;
+ static DSetCreatPropList* DEFAULT_;
// Creates the global constant, should only be used by the library
static DSetCreatPropList* getConstant();
diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp
index 8746d35..e018ff2 100644
--- a/c++/src/H5DxferProp.cpp
+++ b/c++/src/H5DxferProp.cpp
@@ -15,7 +15,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -36,7 +36,7 @@ DSetMemXferPropList* DSetMemXferPropList::DEFAULT_ = 0;
// Function: DSetMemXferPropList::getConstant
// Creates a DSetMemXferPropList object representing the HDF5
// constant H5P_DATASET_XFER, pointed to by
-// DSetMemXferPropList::DEFAULT_
+// DSetMemXferPropList::DEFAULT_
// exception H5::PropListIException
// Description
// If DSetMemXferPropList::DEFAULT_ already points to an allocated
@@ -76,25 +76,25 @@ void DSetMemXferPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose Constant for default dataset memory and transfer property list.
+// Purpose Constant for default dataset memory and transfer property list.
//--------------------------------------------------------------------------
const DSetMemXferPropList& DSetMemXferPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function DSetMemXferPropList default constructor
-///\brief Default constructor: creates a stub dataset memory and
-/// transfer property list object.
-// Programmer: Binh-Minh Ribler - 2000
+// Function DSetMemXferPropList default constructor
+///\brief Default constructor: creates a stub dataset memory and
+/// transfer property list object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {}
//--------------------------------------------------------------------------
-// Function DSetMemXferPropList constructor
-///\brief Creates a dataset transfer property list with transform
-/// expression.
-// Programmer: Binh-Minh Ribler - 2000
+// Function DSetMemXferPropList constructor
+///\brief Creates a dataset transfer property list with transform
+/// expression.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET_XFER)
{
@@ -102,164 +102,164 @@ DSetMemXferPropList::DSetMemXferPropList(const char* exp) : PropList(H5P_DATASET
}
//--------------------------------------------------------------------------
-// Function DSetMemXferPropList copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// DSetMemXferPropList object
-///\param original - IN: Original dataset memory and transfer property
-/// list object to copy
-// Programmer: Binh-Minh Ribler - 2000
+// Function DSetMemXferPropList copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// DSetMemXferPropList object
+///\param original - IN: Original dataset memory and transfer property
+/// list object to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original ) : PropList( original ) {}
+DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : PropList(original ) {}
//--------------------------------------------------------------------------
-// Function DSetMemXferPropList overloaded constructor
-///\brief Creates a DSetMemXferPropList object using the id of an
-/// existing DSetMemXferPropList.
-///\param plist_id - IN: Id of an existing dataset memory and transfer
-/// property list
-// Programmer: Binh-Minh Ribler - 2000
+// Function DSetMemXferPropList overloaded constructor
+///\brief Creates a DSetMemXferPropList object using the id of an
+/// existing DSetMemXferPropList.
+///\param plist_id - IN: Id of an existing dataset memory and transfer
+/// property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetMemXferPropList::DSetMemXferPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setBuffer
-///\brief Sets type conversion and background buffers.
-///\param size - IN: Size, in bytes, of the type conversion and background buffers
-///\param tconv - IN: Pointer to application-allocated type conversion buffer
-///\param bkg - IN: Pointer to application-allocated background buffer
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::setBuffer
+///\brief Sets type conversion and background buffers.
+///\param size - IN: Size, in bytes, of the type conversion and background buffers
+///\param tconv - IN: Pointer to application-allocated type conversion buffer
+///\param bkg - IN: Pointer to application-allocated background buffer
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::setBuffer( size_t size, void* tconv, void* bkg ) const
+void DSetMemXferPropList::setBuffer(size_t size, void* tconv, void* bkg) const
{
- herr_t ret_value = H5Pset_buffer( id, size, tconv, bkg );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setBuffer",
- "H5Pset_buffer failed");
- }
+ herr_t ret_value = H5Pset_buffer(id, size, tconv, bkg);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setBuffer",
+ "H5Pset_buffer failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getBuffer
-///\brief Reads buffer settings.
-///\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
+// Function: DSetMemXferPropList::getBuffer
+///\brief Reads buffer settings.
+///\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 DSetMemXferPropList::getBuffer(void** tconv, void** bkg) const
{
- size_t buffer_size = H5Pget_buffer( id, tconv, bkg );
- if( buffer_size == 0 )
- {
- throw PropListIException("DSetMemXferPropList::getBuffer",
- "H5Pget_buffer returned 0 for buffer size - failure");
- }
- return( buffer_size );
+ size_t buffer_size = H5Pget_buffer(id, tconv, bkg);
+ if(buffer_size == 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getBuffer",
+ "H5Pget_buffer returned 0 for buffer size - failure");
+ }
+ return(buffer_size);
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setPreserve
-///\brief Sets the dataset transfer property list status to true or false.
-///\param status - IN: Status to set, true or false
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::setPreserve
+///\brief Sets the dataset transfer property list status to true or false.
+///\param status - IN: Status to set, true or false
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::setPreserve( bool status ) const
+void DSetMemXferPropList::setPreserve(bool status) const
{
- herr_t ret_value = H5Pset_preserve( id, (hbool_t) status );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setPreserve",
- "H5Pset_preserve failed");
- }
+ herr_t ret_value = H5Pset_preserve(id, (hbool_t) status);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setPreserve",
+ "H5Pset_preserve failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getPreserve
-///\brief Checks status of the dataset transfer property list.
-///\return Status of the dataset transfer property list
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::getPreserve
+///\brief Checks status of the dataset transfer property list.
+///\return Status of the dataset transfer property list
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DSetMemXferPropList::getPreserve() const
{
- int ret_value = H5Pget_preserve( id );
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else
- {
- throw PropListIException("DSetMemXferPropList::getPreserve",
- "H5Pget_preserve returned negative value for status");
- }
+ int ret_value = H5Pget_preserve(id);
+ if(ret_value > 0)
+ return true;
+ else if(ret_value == 0)
+ return false;
+ else
+ {
+ throw PropListIException("DSetMemXferPropList::getPreserve",
+ "H5Pget_preserve returned negative value for status");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setBtreeRatios
-///\brief Sets B-tree split ratios for a dataset transfer property list.
-///\param left - IN: B-tree split ratio for left-most nodes
-///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes
-///\param right - IN: B-tree split ratio for all other nodes
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::setBtreeRatios
+///\brief Sets B-tree split ratios for a dataset transfer property list.
+///\param left - IN: B-tree split ratio for left-most nodes
+///\param middle - IN: B-tree split ratio for right-most nodes and lone nodes
+///\param right - IN: B-tree split ratio for all other nodes
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::setBtreeRatios( double left, double middle, double right ) const
+void DSetMemXferPropList::setBtreeRatios(double left, double middle, double right) const
{
- herr_t ret_value = H5Pset_btree_ratios( id, left, middle, right );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setBtreeRatios",
- "H5Pset_btree_ratios failed");
- }
+ herr_t ret_value = H5Pset_btree_ratios(id, left, middle, right);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setBtreeRatios",
+ "H5Pset_btree_ratios failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getBtreeRatios
-///\brief Gets B-tree split ratios for a dataset transfer property list.
-///\param left - OUT: B-tree split ratio for left-most nodes
-///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes
-///\param right - OUT: B-tree split ratio for all other nodes
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::getBtreeRatios
+///\brief Gets B-tree split ratios for a dataset transfer property list.
+///\param left - OUT: B-tree split ratio for left-most nodes
+///\param middle - OUT: B-tree split ratio for right-most nodes and lone nodes
+///\param right - OUT: B-tree split ratio for all other nodes
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& right ) const
+void DSetMemXferPropList::getBtreeRatios(double& left, double& middle, double& right) const
{
- herr_t ret_value = H5Pget_btree_ratios( id, &left, &middle, &right );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::getBtreeRatios",
- "H5Pget_btree_ratios failed");
- }
+ herr_t ret_value = H5Pget_btree_ratios(id, &left, &middle, &right);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getBtreeRatios",
+ "H5Pget_btree_ratios failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setDataTransform
-///\brief Sets data transform expression.
-///\param expression - IN: null-terminated data transform expression (char*)
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - Mar, 2014
+// Function: DSetMemXferPropList::setDataTransform
+///\brief Sets data transform expression.
+///\param expression - IN: null-terminated data transform expression (char*)
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
void DSetMemXferPropList::setDataTransform(const char* expression) const
{
- herr_t ret_value = H5Pset_data_transform( id, expression);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setDataTransform",
- "H5Pset_data_transform failed");
- }
+ herr_t ret_value = H5Pset_data_transform(id, expression);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setDataTransform",
+ "H5Pset_data_transform failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setDataTransform
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes a reference to a \c H5std_string for the expression.
-///\param expression - IN: H5std_string data transform expression
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - Mar, 2014
+// Function: DSetMemXferPropList::setDataTransform
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes a reference to a \c H5std_string for the expression.
+///\param expression - IN: H5std_string data transform expression
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const
{
@@ -267,13 +267,13 @@ void DSetMemXferPropList::setDataTransform(const H5std_string& expression) const
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getDataTransform
-///\brief Sets data transform expression.
-///\param exp - OUT: buffer for data transform expression (char*)
-///\param buf_size - IN: size of buffer for expression, including the
-/// null terminator
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - Mar, 2014
+// Function: DSetMemXferPropList::getDataTransform
+///\brief Sets data transform expression.
+///\param exp - OUT: buffer for data transform expression (char*)
+///\param buf_size - IN: size of buffer for expression, including the
+/// null terminator
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const
{
@@ -285,8 +285,8 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const
// H5Pget_data_transform returns a negative value, raise an exception
if (exp_len < 0)
{
- throw PropListIException("DSetMemXferPropList::getDataTransform",
- "H5Pget_data_transform failed");
+ throw PropListIException("DSetMemXferPropList::getDataTransform",
+ "H5Pget_data_transform failed");
}
// H5Pget_data_transform will put a null terminator at the end of the
@@ -298,11 +298,11 @@ ssize_t DSetMemXferPropList::getDataTransform(char* exp, size_t buf_size) const
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getDataTransform
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes no parameter and returns a \c H5std_string for the expression.
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - Mar, 2014
+// Function: DSetMemXferPropList::getDataTransform
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes no parameter and returns a \c H5std_string for the expression.
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
H5std_string DSetMemXferPropList::getDataTransform() const
{
@@ -340,226 +340,226 @@ H5std_string DSetMemXferPropList::getDataTransform() const
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getTypeConvCB
-///\brief Sets an exception handling callback for datatype conversion
-/// for a dataset transfer property list.
-///\param op - IN: User's function
-///\param user_data - IN: User's data
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: DSetMemXferPropList::getTypeConvCB
+///\brief Sets an exception handling callback for datatype conversion
+/// for a dataset transfer property list.
+///\param op - IN: User's function
+///\param user_data - IN: User's data
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-void DSetMemXferPropList::setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const
+void DSetMemXferPropList::setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const
{
- herr_t ret_value = H5Pset_type_conv_cb( id, op, user_data);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setTypeConvCB",
- "H5Pset_type_conv_cb failed");
- }
+ herr_t ret_value = H5Pset_type_conv_cb(id, op, user_data);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setTypeConvCB",
+ "H5Pset_type_conv_cb failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getTypeConvCB
-///\brief Gets the exception handling callback function and data.
-///\param op - IN: Retrieved user function
-///\param user_data - IN: Retrieved user data
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: DSetMemXferPropList::getTypeConvCB
+///\brief Gets the exception handling callback function and data.
+///\param op - IN: Retrieved user function
+///\param user_data - IN: Retrieved user data
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const
+void DSetMemXferPropList::getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const
{
- herr_t ret_value = H5Pget_type_conv_cb( id, op, user_data);
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::getTypeConvCB",
- "H5Pget_type_conv_cb failed");
- }
+ herr_t ret_value = H5Pget_type_conv_cb(id, op, user_data);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getTypeConvCB",
+ "H5Pget_type_conv_cb failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setVlenMemManager
-///\brief Sets the memory manager for variable-length datatype allocation.
-///\param alloc_func - IN: User's allocate routine
-///\param alloc_info - IN: User's allocation parameters
-///\param free_func - IN: User's free routine
-///\param free_info - IN: User's free parameters
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::setVlenMemManager
+///\brief Sets the memory manager for variable-length datatype allocation.
+///\param alloc_func - IN: User's allocate routine
+///\param alloc_info - IN: User's allocation parameters
+///\param free_func - IN: User's free routine
+///\param free_info - IN: User's free parameters
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const
+void DSetMemXferPropList::setVlenMemManager(H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info) const
{
- herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info,
- free_func, free_info );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::setVlenMemManager",
- "H5Pset_vlen_mem_manager failed");
- }
+ herr_t ret_value = H5Pset_vlen_mem_manager(id, alloc_func, alloc_info,
+ free_func, free_info);
+ if(ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setVlenMemManager",
+ "H5Pset_vlen_mem_manager failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setVlenMemManager
-///\brief Sets the memory manager for variable-length datatype
-/// allocation - system \c malloc and \c free will be used.
+// Function: DSetMemXferPropList::setVlenMemManager
+///\brief Sets the memory manager for variable-length datatype
+/// allocation - system \c malloc and \c free will be used.
///
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetMemXferPropList::setVlenMemManager() const
{
- setVlenMemManager( NULL, NULL, NULL, NULL );
+ setVlenMemManager(NULL, NULL, NULL, NULL);
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getVlenMemManager
-///\brief Gets the memory manager for variable-length datatype allocation
-///\param alloc_func - OUT: User's allocate routine
-///\param alloc_info - OUT: User's allocation parameters
-///\param free_func - OUT: User's free routine
-///\param free_info - OUT: User's free parameters
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList::getVlenMemManager
+///\brief Gets the memory manager for variable-length datatype allocation
+///\param alloc_func - OUT: User's allocate routine
+///\param alloc_info - OUT: User's allocation parameters
+///\param free_func - OUT: User's free routine
+///\param free_info - OUT: User's free parameters
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info ) const
+void DSetMemXferPropList::getVlenMemManager(H5MM_allocate_t& alloc_func, void** alloc_info, H5MM_free_t& free_func, void** free_info) const
{
- herr_t ret_value = H5Pget_vlen_mem_manager( id, &alloc_func, alloc_info, &free_func, free_info );
- if( ret_value < 0 )
- {
- throw PropListIException("DSetMemXferPropList::getVlenMemManager",
- "H5Pget_vlen_mem_manager failed");
- }
+ herr_t ret_value = H5Pget_vlen_mem_manager(id, &alloc_func, alloc_info, &free_func, free_info);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getVlenMemManager",
+ "H5Pget_vlen_mem_manager failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setSmallDataBlockSize
-///\brief Sets the size of a contiguous block reserved for small data.
-///\param size - IN: Maximum size, in bytes, of the small data block.
-///\exception H5::PropListIException
+// Function: DSetMemXferPropList::setSmallDataBlockSize
+///\brief Sets the size of a contiguous block reserved for small data.
+///\param size - IN: Maximum size, in bytes, of the small data block.
+///\exception H5::PropListIException
///\par Description
-/// For detail, please refer to the C layer Reference Manual at:
+/// For detail, please refer to the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) const
{
- herr_t ret_value = H5Pset_small_data_block_size(id, size);
- if (ret_value < 0)
- {
- throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize",
- "H5Pset_small_data_block_size failed");
- }
+ herr_t ret_value = H5Pset_small_data_block_size(id, size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setSmallDataBlockSize",
+ "H5Pset_small_data_block_size failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getSmallDataBlockSize
-///\brief Returns the current small data block size setting.
-///\return Size of the small data block, in bytes
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: DSetMemXferPropList::getSmallDataBlockSize
+///\brief Returns the current small data block size setting.
+///\return Size of the small data block, in bytes
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hsize_t DSetMemXferPropList::getSmallDataBlockSize() const
{
- hsize_t size;
- herr_t ret_value = H5Pget_small_data_block_size(id, &size);
- if (ret_value < 0)
- {
- throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize",
- "H5Pget_small_data_block_size failed");
- }
- return(size);
+ hsize_t size;
+ herr_t ret_value = H5Pget_small_data_block_size(id, &size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getSmallDataBlockSize",
+ "H5Pget_small_data_block_size failed");
+ }
+ return(size);
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setHyperVectorSize
-///\brief Sets number of I/O vectors to be read/written in hyperslab I/O.
+// Function: DSetMemXferPropList::setHyperVectorSize
+///\brief Sets number of I/O vectors to be read/written in hyperslab I/O.
///
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
-/// For information, please refer to the C layer Reference
-/// Manual at:
+/// For information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) const
{
- herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size);
- if (ret_value < 0)
- {
- throw PropListIException("DSetMemXferPropList::setHyperVectorSize",
- "H5Pset_hyper_vector_size failed");
- }
+ herr_t ret_value = H5Pset_hyper_vector_size(id, vector_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setHyperVectorSize",
+ "H5Pset_hyper_vector_size failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getHyperVectorSize
-///\brief Returns the number of I/O vectors to be read/written in
-/// hyperslab I/O.
-///\return Number of I/O vectors
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: DSetMemXferPropList::getHyperVectorSize
+///\brief Returns the number of I/O vectors to be read/written in
+/// hyperslab I/O.
+///\return Number of I/O vectors
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t DSetMemXferPropList::getHyperVectorSize() const
{
- size_t vector_size;
- herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size);
- if (ret_value < 0)
- {
- throw PropListIException("DSetMemXferPropList::getHyperVectorSize",
- "H5Pget_hyper_vector_size failed");
- }
- return(vector_size);
+ size_t vector_size;
+ herr_t ret_value = H5Pget_hyper_vector_size(id, &vector_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getHyperVectorSize",
+ "H5Pget_hyper_vector_size failed");
+ }
+ return(vector_size);
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::setEDCCheck
-///\brief Enables or disables error-detecting for a dataset reading
-/// process.
-///\param check - IN: Specifies whether error detection is enabled or
-/// disabled
-///\exception H5::PropListIException
+// Function: DSetMemXferPropList::setEDCCheck
+///\brief Enables or disables error-detecting for a dataset reading
+/// process.
+///\param check - IN: Specifies whether error detection is enabled or
+/// disabled
+///\exception H5::PropListIException
///\par Description
-/// The error detection algorithm used is the algorithm previously
-/// specified in the corresponding dataset creation property
-/// list. This function does not affect the use of error
-/// detection in the writing process.
+/// The error detection algorithm used is the algorithm previously
+/// specified in the corresponding dataset creation property
+/// list. This function does not affect the use of error
+/// detection in the writing process.
///\par
-/// Valid values are as follows:
-/// \li \c H5Z_ENABLE_EDC (default)
-/// \li \c H5Z_DISABLE_EDC
-// Programmer: Binh-Minh Ribler - April, 2004
+/// Valid values are as follows:
+/// \li \c H5Z_ENABLE_EDC (default)
+/// \li \c H5Z_DISABLE_EDC
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) const
{
- herr_t ret_value = H5Pset_edc_check(id, check);
- if (ret_value < 0)
- {
- throw PropListIException("DSetMemXferPropList::setEDCCheck",
- "H5Pset_edc_check failed");
- }
+ herr_t ret_value = H5Pset_edc_check(id, check);
+ if (ret_value < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::setEDCCheck",
+ "H5Pset_edc_check failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList::getEDCCheck
-///\brief Determines whether error-detection is enabled for dataset reads.
-///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: DSetMemXferPropList::getEDCCheck
+///\brief Determines whether error-detection is enabled for dataset reads.
+///\return \c H5Z_ENABLE_EDC or \c H5Z_DISABLE_EDC
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5Z_EDC_t DSetMemXferPropList::getEDCCheck() const
{
- H5Z_EDC_t check = H5Pget_edc_check(id);
- if (check < 0)
- {
- throw PropListIException("DSetMemXferPropList::getEDCCheck",
- "H5Pget_edc_check failed");
- }
- return(check);
+ H5Z_EDC_t check = H5Pget_edc_check(id);
+ if (check < 0)
+ {
+ throw PropListIException("DSetMemXferPropList::getEDCCheck",
+ "H5Pget_edc_check failed");
+ }
+ return(check);
}
//--------------------------------------------------------------------------
-// Function: DSetMemXferPropList destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DSetMemXferPropList destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetMemXferPropList::~DSetMemXferPropList() {}
diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h
index 42194fb..f1c363f 100644
--- a/c++/src/H5DxferProp.h
+++ b/c++/src/H5DxferProp.h
@@ -27,93 +27,93 @@ namespace H5 {
*/
class H5_DLLCPP DSetMemXferPropList : public PropList {
public:
- ///\brief Default dataset memory and transfer property list.
- static const DSetMemXferPropList& DEFAULT;
+ ///\brief Default dataset memory and transfer property list.
+ static const DSetMemXferPropList& DEFAULT;
- // Creates a dataset memory and transfer property list.
- DSetMemXferPropList();
+ // Creates a dataset memory and transfer property list.
+ DSetMemXferPropList();
- // Creates a dataset transform property list.
- DSetMemXferPropList(const char* expression);
+ // Creates a dataset transform property list.
+ DSetMemXferPropList(const char* expression);
- // Sets type conversion and background buffers.
- void setBuffer( size_t size, void* tconv, void* bkg ) const;
+ // Sets type conversion and background buffers.
+ void setBuffer(size_t size, void* tconv, void* bkg) const;
- // Reads buffer settings.
- size_t getBuffer( void** tconv, void** bkg ) const;
+ // Reads buffer settings.
+ size_t getBuffer(void** tconv, void** bkg) const;
- // Sets B-tree split ratios for a dataset transfer property list.
- void setBtreeRatios( double left, double middle, double right ) const;
+ // Sets B-tree split ratios for a dataset transfer property list.
+ void setBtreeRatios(double left, double middle, double right) const;
- // Gets B-tree split ratios for a dataset transfer property list.
- void getBtreeRatios( double& left, double& middle, double& right ) const;
+ // Gets B-tree split ratios for a dataset transfer property list.
+ void getBtreeRatios(double& left, double& middle, double& right) const;
- // Sets data transform expression.
- void setDataTransform(const char* expression) const;
- void setDataTransform(const H5std_string& expression) const;
+ // Sets data transform expression.
+ void setDataTransform(const char* expression) const;
+ void setDataTransform(const H5std_string& expression) const;
- // Gets data transform expression.
- ssize_t getDataTransform(char* exp, size_t buf_size=0) const;
- H5std_string getDataTransform() const;
+ // Gets data transform expression.
+ ssize_t getDataTransform(char* exp, size_t buf_size=0) const;
+ H5std_string getDataTransform() const;
- // Sets the dataset transfer property list status to TRUE or FALSE.
- void setPreserve( bool status ) const;
+ // Sets the dataset transfer property list status to TRUE or FALSE.
+ void setPreserve(bool status) const;
- // Checks status of the dataset transfer property list.
- bool getPreserve() const;
+ // Checks status of the dataset transfer property list.
+ bool getPreserve() const;
- // Sets an exception handling callback for datatype conversion.
- void setTypeConvCB( H5T_conv_except_func_t op, void *user_data) const;
+ // Sets an exception handling callback for datatype conversion.
+ void setTypeConvCB(H5T_conv_except_func_t op, void *user_data) const;
- // Gets the exception handling callback for datatype conversion.
- void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) const;
+ // Gets the exception handling callback for datatype conversion.
+ void getTypeConvCB(H5T_conv_except_func_t *op, void **user_data) const;
- // Sets the memory manager for variable-length datatype
- // allocation in H5Dread and H5Dvlen_reclaim.
- void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info,
- H5MM_free_t free, void* free_info ) const;
+ // Sets the memory manager for variable-length datatype
+ // allocation in H5Dread and H5Dvlen_reclaim.
+ void setVlenMemManager(H5MM_allocate_t alloc, void* alloc_info,
+ H5MM_free_t free, void* free_info) const;
- // alloc and free are set to NULL, indicating that system
- // malloc and free are to be used.
- void setVlenMemManager() const;
+ // alloc and free are set to NULL, indicating that system
+ // malloc and free are to be used.
+ void setVlenMemManager() const;
- // Gets the memory manager for variable-length datatype
- // allocation in H5Dread and H5Tvlen_reclaim.
- void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
- H5MM_free_t& free, void** free_info ) const;
+ // Gets the memory manager for variable-length datatype
+ // allocation in H5Dread and H5Tvlen_reclaim.
+ void getVlenMemManager(H5MM_allocate_t& alloc, void** alloc_info,
+ H5MM_free_t& free, void** free_info) const;
- // Sets the size of a contiguous block reserved for small data.
- void setSmallDataBlockSize(hsize_t size) const;
+ // Sets the size of a contiguous block reserved for small data.
+ void setSmallDataBlockSize(hsize_t size) const;
- // Returns the current small data block size setting.
- hsize_t getSmallDataBlockSize() const;
+ // Returns the current small data block size setting.
+ hsize_t getSmallDataBlockSize() const;
- // Sets number of I/O vectors to be read/written in hyperslab I/O.
- void setHyperVectorSize(size_t vector_size) const;
+ // Sets number of I/O vectors to be read/written in hyperslab I/O.
+ 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() const;
+ // Returns the number of I/O vectors to be read/written in
+ // hyperslab I/O.
+ size_t getHyperVectorSize() const;
- // Enables or disables error-detecting for a dataset reading
- // process.
- void setEDCCheck(H5Z_EDC_t check) const;
+ // Enables or disables error-detecting for a dataset reading
+ // process.
+ void setEDCCheck(H5Z_EDC_t check) const;
- // Determines whether error-detection is enabled for dataset reads.
- H5Z_EDC_t getEDCCheck() const;
+ // Determines whether error-detection is enabled for dataset reads.
+ H5Z_EDC_t getEDCCheck() const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("DSetMemXferPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("DSetMemXferPropList"); }
- // Copy constructor: makes a copy of a DSetMemXferPropList object.
- DSetMemXferPropList(const DSetMemXferPropList& orig);
+ // Copy constructor: makes a copy of a DSetMemXferPropList object.
+ DSetMemXferPropList(const DSetMemXferPropList& orig);
- // Creates a copy of an existing dataset memory and transfer
- // property list using the property list id.
- DSetMemXferPropList(const hid_t plist_id);
+ // Creates a copy of an existing dataset memory and transfer
+ // property list using the property list id.
+ DSetMemXferPropList(const hid_t plist_id);
- // Noop destructor
- virtual ~DSetMemXferPropList();
+ // Noop destructor
+ virtual ~DSetMemXferPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -121,7 +121,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
static void deleteConstants();
private:
- static DSetMemXferPropList* DEFAULT_;
+ static DSetMemXferPropList* DEFAULT_;
// Creates the global constant, should only be used by the library
static DSetMemXferPropList* getConstant();
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index 5e1f0bd..49f60e6 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -15,7 +15,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -37,230 +37,230 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: EnumType default constructor
-///\brief Default constructor: Creates a stub datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType default constructor
+///\brief Default constructor: Creates a stub datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType::EnumType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Creates an EnumType object using the id of an existing datatype.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType overloaded constructor
+///\brief Creates an EnumType object using the id of an existing datatype.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType( const hid_t existing_id ) : DataType( existing_id ) {}
+EnumType::EnumType(const hid_t existing_id) : DataType( existing_id ) {}
//--------------------------------------------------------------------------
-// Function: EnumType copy constructor
-///\brief Copy constructor: makes a copy of the original EnumType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType copy constructor
+///\brief Copy constructor: makes a copy of the original EnumType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType( const EnumType& original ) : DataType( original ) {}
+EnumType::EnumType(const EnumType& original) : DataType( original ) {}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Creates an empty enumeration datatype given a size, in bytes.
-///\param size - IN: Number of bytes in the datatype to create
-///\exception H5::DataTypeIException
+// Function: EnumType overloaded constructor
+///\brief Creates an empty enumeration datatype given a size, in bytes.
+///\param size - IN: Number of bytes in the datatype to create
+///\exception H5::DataTypeIException
// Description
-// The DataType constructor calls the C API H5Tcreate to create
-// the enum datatype.
-// Programmer Binh-Minh Ribler - 2000
+// The DataType constructor calls the C API H5Tcreate to create
+// the enum datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType( size_t size ) : DataType( H5T_ENUM, size ) {}
+EnumType::EnumType(size_t size) : DataType( H5T_ENUM, size ) {}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Gets the enum datatype of the specified dataset.
-///\param dataset - IN: Dataset that this enum datatype associates with
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType overloaded constructor
+///\brief Gets the enum datatype of the specified dataset.
+///\param dataset - IN: Dataset that this enum datatype associates with
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType( const DataSet& dataset ) : DataType()
+EnumType::EnumType(const DataSet& dataset) : DataType()
{
- // Calls C function H5Dget_type to get the id of the datatype
- id = H5Dget_type( dataset.getId() );
+ // Calls C function H5Dget_type to get the id of the datatype
+ id = H5Dget_type(dataset.getId());
- // If the datatype id is not valid, throw an exception
- if( id < 0 )
- {
- throw DataSetIException("EnumType constructor", "H5Dget_type failed");
- }
+ // If the datatype id is not valid, throw an exception
+ if (id < 0)
+ {
+ throw DataSetIException("EnumType constructor", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Creates a new enum datatype based on an integer datatype.
-///\param data_type - IN: Base datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType overloaded constructor
+///\brief Creates a new enum datatype based on an integer datatype.
+///\param data_type - IN: Base datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-EnumType::EnumType( const IntType& data_type ) : DataType()
+EnumType::EnumType(const IntType& data_type) : DataType()
{
- // Calls C function H5Tenum_create to get the id of the datatype
- id = H5Tenum_create( data_type.getId() );
+ // Calls C function H5Tenum_create to get the id of the datatype
+ id = H5Tenum_create(data_type.getId());
- // If the datatype id is not valid, throw an exception
- if( id < 0 )
- {
- throw DataSetIException("EnumType constructor", "H5Tenum_create failed");
- }
+ // If the datatype id is not valid, throw an exception
+ if (id < 0)
+ {
+ throw DataSetIException("EnumType constructor", "H5Tenum_create failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\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
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// Function: EnumType overloaded constructor
+///\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
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - Dec 2016
// Description
-// In 1.10.1, this constructor was introduced and will replace the
-// existing function CommonFG::openEnumType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openEnumType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
EnumType::EnumType(const H5Location& loc, const char *dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name);
+ id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Enum datatype name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openEnumType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openEnumType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: EnumType::insert
-///\brief Inserts a new member to this enumeration datatype.
-///\param name - IN: Name of the new member
-///\param value - IN: Pointer to the value of the new member
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::insert
+///\brief Inserts a new member to this enumeration datatype.
+///\param name - IN: Name of the new member
+///\param value - IN: Pointer to the value of the new member
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::insert( const char* name, void *value ) const
+void EnumType::insert(const char* name, void *value) const
{
- // Calls C routine H5Tenum_insert to insert the new enum datatype member.
- herr_t ret_value = H5Tenum_insert( id, name, value );
- if( ret_value < 0 )
- {
- throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed");
- }
+ // Calls C routine H5Tenum_insert to insert the new enum datatype member.
+ herr_t ret_value = H5Tenum_insert(id, name, value);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("EnumType::insert", "H5Tenum_insert failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: EnumType::insert
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::insert
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::insert( const H5std_string& name, void *value ) const
+void EnumType::insert(const H5std_string& name, void *value) const
{
- insert( name.c_str(), value );
+ insert(name.c_str(), value);
}
//--------------------------------------------------------------------------
-// Function: EnumType::nameOf
-///\brief Returns the symbol name corresponding to a specified member
-/// of this enumeration datatype.
-///\param value - IN: Pointer to the value of the enum datatype
-///\param size - IN: Size for the name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::nameOf
+///\brief Returns the symbol name corresponding to a specified member
+/// of this enumeration datatype.
+///\param value - IN: Pointer to the value of the enum datatype
+///\param size - IN: Size for the name
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string EnumType::nameOf( void *value, size_t size ) const
+H5std_string EnumType::nameOf(void *value, size_t size) const
{
- char* name_C = new char[size+1]; // temporary C-string for C API
- HDmemset(name_C, 0, size+1); // clear buffer
+ char* name_C = new char[size+1]; // temporary C-string for C API
+ HDmemset(name_C, 0, size+1); // clear buffer
- // Calls C routine H5Tenum_nameof to get the name of the specified enum type
- herr_t ret_value = H5Tenum_nameof( id, value, name_C, size );
+ // Calls C routine H5Tenum_nameof to get the name of the specified enum type
+ herr_t ret_value = H5Tenum_nameof(id, value, name_C, size);
- // If H5Tenum_nameof returns a negative value, raise an exception,
- if( ret_value < 0 )
- {
+ // If H5Tenum_nameof returns a negative value, raise an exception,
+ if (ret_value < 0)
+ {
delete []name_C;
- throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed");
- }
- // otherwise, create the string to hold the datatype name and return it
- H5std_string name(name_C);
- delete []name_C;
- return( name );
+ throw DataTypeIException("EnumType::nameOf", "H5Tenum_nameof failed");
+ }
+ // otherwise, create the string to hold the datatype name and return it
+ H5std_string name(name_C);
+ delete []name_C;
+ return(name);
}
//--------------------------------------------------------------------------
-// Function: EnumType::valueOf
-///\brief Retrieves the value corresponding to a member of this
-/// enumeration datatype, given the member's name.
-///\param name - IN: Name of the queried member
-///\param value - OUT: Pointer to the retrieved value
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::valueOf
+///\brief Retrieves the value corresponding to a member of this
+/// enumeration datatype, given the member's name.
+///\param name - IN: Name of the queried member
+///\param value - OUT: Pointer to the retrieved value
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::valueOf( const char* name, void *value ) const
+void EnumType::valueOf(const char* name, void *value) const
{
- // Calls C routine H5Tenum_valueof to get the enum datatype value
- herr_t ret_value = H5Tenum_valueof( id, name, value );
- if( ret_value < 0 )
- {
- throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed");
- }
+ // Calls C routine H5Tenum_valueof to get the enum datatype value
+ herr_t ret_value = H5Tenum_valueof(id, name, value);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("EnumType::valueOf", "H5Tenum_valueof failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: EnumType::valueOf
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::valueOf
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::valueOf( const H5std_string& name, void *value ) const
+void EnumType::valueOf(const H5std_string& name, void *value) const
{
- valueOf( name.c_str(), value );
+ valueOf(name.c_str(), value);
}
//--------------------------------------------------------------------------
-// Function: EnumType::getMemberIndex
-///\brief Returns the index of a member in this enumeration datatype.
-///\param name - IN: Name of the queried member
-///\return Index of the member if it exists. Index will have the value
-/// between 0 and \c N-1, where \c N is the value returned by the
-/// member function \c EnumType::getNmembers.
-///\exception H5::DataTypeIException
+// Function: EnumType::getMemberIndex
+///\brief Returns the index of a member in this enumeration datatype.
+///\param name - IN: Name of the queried member
+///\return Index of the member if it exists. Index will have the value
+/// between 0 and \c N-1, where \c N is the value returned by the
+/// member function \c EnumType::getNmembers.
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 16, 2002
//--------------------------------------------------------------------------
int EnumType::getMemberIndex(const char *name) const
{
- int member_index = H5Tget_member_index(id, name);
- if( member_index < 0 )
- {
- throw DataTypeIException("EnumType::getMemberIndex",
+ int member_index = H5Tget_member_index(id, name);
+ if (member_index < 0)
+ {
+ throw DataTypeIException("EnumType::getMemberIndex",
"H5Tget_member_index returns negative value");
- }
- return( member_index );
+ }
+ return(member_index);
}
//--------------------------------------------------------------------------
-// Function: EnumType::getMemberIndex
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in the type of
-/// argument \a name.
+// Function: EnumType::getMemberIndex
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in the type of
+/// argument \a name.
// Programmer Binh-Minh Ribler - May 16, 2002
//--------------------------------------------------------------------------
int EnumType::getMemberIndex(const H5std_string& name) const
@@ -269,46 +269,46 @@ int EnumType::getMemberIndex(const H5std_string& name) const
}
//--------------------------------------------------------------------------
-// Function: EnumType::getNmembers
-///\brief Returns the number of members in this enumeration datatype.
-///\return Number of members
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: EnumType::getNmembers
+///\brief Returns the number of members in this enumeration datatype.
+///\return Number of members
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
int EnumType::getNmembers() const
{
- int num_members = H5Tget_nmembers( id );
- if( num_members < 0 )
- {
- throw DataTypeIException("EnumType::getNmembers",
+ int num_members = H5Tget_nmembers(id);
+ if (num_members < 0)
+ {
+ throw DataTypeIException("EnumType::getNmembers",
"H5Tget_nmembers returns negative number of members");
- }
- return( num_members );
+ }
+ return(num_members);
}
//--------------------------------------------------------------------------
-// Function: EnumType::getMemberValue
-///\brief Retrieves the value of a member in this enumeration datatype,
-/// given the member's index.
-///\param memb_no - IN: Index of the queried member
-///\param value - OUT: Pointer to the retrieved value
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType::getMemberValue
+///\brief Retrieves the value of a member in this enumeration datatype,
+/// given the member's index.
+///\param memb_no - IN: Index of the queried member
+///\param value - OUT: Pointer to the retrieved value
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::getMemberValue( unsigned memb_no, void *value ) const
+void EnumType::getMemberValue(unsigned memb_no, void *value) const
{
- // Call C routine H5Tget_member_value to get the datatype member's value
- hid_t ret_value = H5Tget_member_value( id, memb_no, value );
- if( ret_value < 0 )
- {
- throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed");
- }
+ // Call C routine H5Tget_member_value to get the datatype member's value
+ hid_t ret_value = H5Tget_member_value(id, memb_no, value);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("EnumType::getMemberValue", "H5Tget_member_value failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: EnumType destructor
-///\brief Properly terminates access to this enum datatype.
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType destructor
+///\brief Properly terminates access to this enum datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
EnumType::~EnumType() {}
diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h
index 054811b..2fbe2cd 100644
--- a/c++/src/H5EnumType.h
+++ b/c++/src/H5EnumType.h
@@ -28,56 +28,56 @@ namespace H5 {
class H5_DLLCPP EnumType : public DataType {
public:
- // Creates an empty enumeration datatype based on a native signed
- // integer type, whose size is given by size.
- EnumType( size_t size );
+ // Creates an empty enumeration datatype based on a native signed
+ // integer type, whose size is given by size.
+ EnumType(size_t size);
- // Gets the enum datatype of the specified dataset
- EnumType( const DataSet& dataset ); // H5Dget_type
+ // Gets the enum datatype of the specified dataset
+ EnumType(const DataSet& dataset); // H5Dget_type
- // Creates a new enum datatype based on an integer datatype
- EnumType( const IntType& data_type ); // H5Tenum_create
+ // Creates a new enum datatype based on an integer datatype
+ EnumType(const IntType& data_type); // H5Tenum_create
- // Constructors that open an enum datatype, given a location.
- EnumType(const H5Location& loc, const char* name);
- EnumType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open an enum datatype, given a location.
+ EnumType(const H5Location& loc, const char* name);
+ EnumType(const H5Location& loc, const H5std_string& name);
- // Returns the number of members in this enumeration datatype.
- int getNmembers () const;
+ // Returns the number of members in this enumeration datatype.
+ int getNmembers () const;
- // Returns the index of a member in this enumeration data type.
- int getMemberIndex(const char* name) const;
- int getMemberIndex(const H5std_string& name) const;
+ // Returns the index of a member in this enumeration data type.
+ int getMemberIndex(const char* name) const;
+ int getMemberIndex(const H5std_string& name) const;
- // Returns the value of an enumeration datatype member
- void getMemberValue( unsigned memb_no, void *value ) const;
+ // Returns the value of an enumeration datatype member
+ void getMemberValue(unsigned memb_no, void *value) const;
- // Inserts a new member to this enumeration type.
- void insert( const char* name, void *value ) const;
- void insert( const H5std_string& name, void *value ) const;
+ // Inserts a new member to this enumeration type.
+ void insert(const char* name, void *value) const;
+ void insert(const H5std_string& name, void *value) const;
- // Returns the symbol name corresponding to a specified member
- // of this enumeration datatype.
- H5std_string nameOf( void *value, size_t size ) const;
+ // Returns the symbol name corresponding to a specified member
+ // of this enumeration datatype.
+ H5std_string nameOf(void *value, size_t size) const;
- // Returns the value corresponding to a specified member of this
- // enumeration datatype.
- void valueOf( const char* name, void *value ) const;
- void valueOf( const H5std_string& name, void *value ) const;
+ // Returns the value corresponding to a specified member of this
+ // enumeration datatype.
+ void valueOf(const char* name, void *value) const;
+ void valueOf(const H5std_string& name, void *value) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("EnumType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("EnumType"); }
- // Default constructor
- EnumType();
+ // Default constructor
+ EnumType();
- // Creates an enumeration datatype using an existing id
- EnumType( const hid_t existing_id );
+ // Creates an enumeration datatype using an existing id
+ EnumType(const hid_t existing_id);
- // Copy constructor: makes a copy of the original EnumType object.
- EnumType( const EnumType& original );
+ // Copy constructor: makes a copy of the original EnumType object.
+ EnumType(const EnumType& original);
- virtual ~EnumType();
+ virtual ~EnumType();
};
}
#endif // __H5EnumType_H
diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp
index 335bb20..0316f64 100644
--- a/c++/src/H5Exception.cpp
+++ b/c++/src/H5Exception.cpp
@@ -23,207 +23,207 @@ namespace H5 {
const char Exception::DEFAULT_MSG[] = "No detailed information provided";
//--------------------------------------------------------------------------
-// Function: Exception default constructor
-///\brief Default constructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception default constructor
+///\brief Default constructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Exception::Exception() : detail_message(""), func_name("") {}
//--------------------------------------------------------------------------
-// Function: Exception overloaded constructor
-///\brief Creates an exception with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception overloaded constructor
+///\brief Creates an exception with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Exception::Exception(const H5std_string& func, const H5std_string& message) : detail_message(message), func_name(func) {}
//--------------------------------------------------------------------------
-// Function: Exception copy constructor
-///\brief Copy constructor: makes a copy of the original Exception object.
-///\param orig - IN: Exception instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception copy constructor
+///\brief Copy constructor: makes a copy of the original Exception object.
+///\param orig - IN: Exception instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Exception::Exception( const Exception& orig ) : detail_message(orig.detail_message), func_name(orig.func_name) {}
+Exception::Exception(const Exception& orig) : detail_message(orig.detail_message), func_name(orig.func_name) {}
//--------------------------------------------------------------------------
-// Function: Exception::getMajorString
-///\brief Returns a text string that describes the error
-/// specified by a major error number.
-///\param err_major - IN: Major error number
-///\return Major error string
+// Function: Exception::getMajorString
+///\brief Returns a text string that describes the error
+/// specified by a major error number.
+///\param err_major - IN: Major error number
+///\return Major error string
///\par Description
-/// In the failure case, the string "Invalid major error number"
-/// will be returned.
-// Programmer Binh-Minh Ribler - 2000
+/// In the failure case, the string "Invalid major error number"
+/// will be returned.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string Exception::getMajorString( hid_t err_major ) const
+H5std_string Exception::getMajorString(hid_t err_major) const
{
- // Preliminary call to H5Eget_msg() to get the length of the message
- ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0);
-
- // If H5Eget_msg() returns a negative value, raise an exception,
- if( mesg_size < 0 )
- throw IdComponentException("Exception::getMajorString",
- "H5Eget_msg failed");
-
- // Call H5Eget_msg again to get the actual message
- char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API
- mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1);
-
- // Check for failure again
- if( mesg_size < 0 )
- {
- delete []mesg_C;
- throw IdComponentException("Exception::getMajorString",
- "H5Eget_msg failed");
- }
-
- // Convert the C error description and return
- H5std_string major_str(mesg_C);
- delete []mesg_C;
- return( major_str );
+ // Preliminary call to H5Eget_msg() to get the length of the message
+ ssize_t mesg_size = H5Eget_msg(err_major, NULL, NULL, 0);
+
+ // If H5Eget_msg() returns a negative value, raise an exception,
+ if (mesg_size < 0)
+ throw IdComponentException("Exception::getMajorString",
+ "H5Eget_msg failed");
+
+ // Call H5Eget_msg again to get the actual message
+ char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API
+ mesg_size = H5Eget_msg(err_major, NULL, mesg_C, mesg_size+1);
+
+ // Check for failure again
+ if (mesg_size < 0)
+ {
+ delete []mesg_C;
+ throw IdComponentException("Exception::getMajorString",
+ "H5Eget_msg failed");
+ }
+
+ // Convert the C error description and return
+ H5std_string major_str(mesg_C);
+ delete []mesg_C;
+ return(major_str);
}
//--------------------------------------------------------------------------
-// Function: Exception::getMinorString
-///\brief Returns a text string that describes the error
-/// specified by a minor error number.
-///\param err_minor - IN: Minor error number
-///\return Minor error string
+// Function: Exception::getMinorString
+///\brief Returns a text string that describes the error
+/// specified by a minor error number.
+///\param err_minor - IN: Minor error number
+///\return Minor error string
///\par Description
-/// In the failure case, the string "Invalid minor error number"
-/// will be returned.
-// Programmer Binh-Minh Ribler - 2000
+/// In the failure case, the string "Invalid minor error number"
+/// will be returned.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string Exception::getMinorString( hid_t err_minor ) const
+H5std_string Exception::getMinorString(hid_t err_minor) const
{
- // Preliminary call to H5Eget_msg() to get the length of the message
- ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0);
-
- // If H5Eget_msg() returns a negative value, raise an exception,
- if( mesg_size < 0 )
- throw IdComponentException("Exception::getMinorString",
- "H5Eget_msg failed");
-
- // Call H5Eget_msg again to get the actual message
- char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API
- mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1);
-
- // Check for failure again
- if( mesg_size < 0 )
- {
- delete []mesg_C;
- throw IdComponentException("Exception::getMinorString",
- "H5Eget_msg failed");
- }
-
- // Convert the C error description and return
- H5std_string minor_str(mesg_C);
- delete []mesg_C;
- return( minor_str );
+ // Preliminary call to H5Eget_msg() to get the length of the message
+ ssize_t mesg_size = H5Eget_msg(err_minor, NULL, NULL, 0);
+
+ // If H5Eget_msg() returns a negative value, raise an exception,
+ if (mesg_size < 0)
+ throw IdComponentException("Exception::getMinorString",
+ "H5Eget_msg failed");
+
+ // Call H5Eget_msg again to get the actual message
+ char* mesg_C = new char[mesg_size+1]; // temporary C-string for C API
+ mesg_size = H5Eget_msg(err_minor, NULL, mesg_C, mesg_size+1);
+
+ // Check for failure again
+ if (mesg_size < 0)
+ {
+ delete []mesg_C;
+ throw IdComponentException("Exception::getMinorString",
+ "H5Eget_msg failed");
+ }
+
+ // Convert the C error description and return
+ H5std_string minor_str(mesg_C);
+ delete []mesg_C;
+ return(minor_str);
}
//--------------------------------------------------------------------------
-// Function: Exception::setAutoPrint
-///\brief Turns on the automatic error printing.
-///\param func - IN: Function to be called upon an error condition
-///\param client_data - IN: Data passed to the error function
+// Function: Exception::setAutoPrint
+///\brief Turns on the automatic error printing.
+///\param func - IN: Function to be called upon an error condition
+///\param client_data - IN: Data passed to the error function
///\par Description
-/// When the library is first initialized the auto printing
-/// function, \a func, is set to the C API \c H5Eprint and
-/// \a client_data is the standard error stream pointer, \c stderr.
-/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD
-/// direction.
+/// When the library is first initialized the auto printing
+/// function, \a func, is set to the C API \c H5Eprint and
+/// \a client_data is the standard error stream pointer, \c stderr.
+/// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD
+/// direction.
///\par
-/// Users are encouraged to write their own more specific error
-/// handlers
-// Programmer Binh-Minh Ribler - 2000
+/// Users are encouraged to write their own more specific error
+/// handlers
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void Exception::setAutoPrint( H5E_auto2_t& func, void* client_data )
+void Exception::setAutoPrint(H5E_auto2_t& func, void* client_data)
{
- // calls the C API routine H5Eset_auto to set the auto printing to
- // the specified function.
- herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, func, client_data );
- if( ret_value < 0 )
- throw Exception( "Exception::setAutoPrint", "H5Eset_auto failed" );
+ // calls the C API routine H5Eset_auto to set the auto printing to
+ // the specified function.
+ herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, func, client_data);
+ if (ret_value < 0)
+ throw Exception("Exception::setAutoPrint", "H5Eset_auto failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::dontPrint
-///\brief Turns off the automatic error printing from the C library.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::dontPrint
+///\brief Turns off the automatic error printing from the C library.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Exception::dontPrint()
{
- // calls the C API routine H5Eset_auto with NULL parameters to turn
- // off the automatic error printing.
- herr_t ret_value = H5Eset_auto2( H5E_DEFAULT, NULL, NULL );
- if( ret_value < 0 )
- throw Exception( "Exception::dontPrint", "H5Eset_auto failed" );
+ // calls the C API routine H5Eset_auto with NULL parameters to turn
+ // off the automatic error printing.
+ herr_t ret_value = H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+ if (ret_value < 0)
+ throw Exception("Exception::dontPrint", "H5Eset_auto failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::getAutoPrint
-///\brief Retrieves the current settings for the automatic error
-/// stack traversal function and its data.
-///\param func - OUT: Current setting for the function to be
-/// called upon an error condition
-///\param client_data - OUT: Current setting for the data passed to
-/// the error function
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::getAutoPrint
+///\brief Retrieves the current settings for the automatic error
+/// stack traversal function and its data.
+///\param func - OUT: Current setting for the function to be
+/// called upon an error condition
+///\param client_data - OUT: Current setting for the data passed to
+/// the error function
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void Exception::getAutoPrint( H5E_auto2_t& func, void** client_data )
+void Exception::getAutoPrint(H5E_auto2_t& func, void** client_data)
{
- // calls the C API routine H5Eget_auto to get the current setting of
- // the automatic error printing
- herr_t ret_value = H5Eget_auto2( H5E_DEFAULT, &func, client_data );
- if( ret_value < 0 )
- throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" );
+ // calls the C API routine H5Eget_auto to get the current setting of
+ // the automatic error printing
+ herr_t ret_value = H5Eget_auto2(H5E_DEFAULT, &func, client_data);
+ if (ret_value < 0)
+ throw Exception("Exception::getAutoPrint", "H5Eget_auto failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::clearErrorStack
-///\brief Clears the error stack for the current thread.
+// Function: Exception::clearErrorStack
+///\brief Clears the error stack for the current thread.
///\par Description
-/// The stack is also cleared whenever a C API function is
-/// called, with certain exceptions (for instance, \c H5Eprint).
-// Programmer Binh-Minh Ribler - 2000
+/// The stack is also cleared whenever a C API function is
+/// called, with certain exceptions (for instance, \c H5Eprint).
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Exception::clearErrorStack()
{
- // calls the C API routine H5Eclear to clear the error stack
- herr_t ret_value = H5Eclear2(H5E_DEFAULT);
- if( ret_value < 0 )
- throw Exception( "Exception::clearErrorStack", "H5Eclear failed" );
+ // calls the C API routine H5Eclear to clear the error stack
+ herr_t ret_value = H5Eclear2(H5E_DEFAULT);
+ if (ret_value < 0)
+ throw Exception("Exception::clearErrorStack", "H5Eclear failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::walkErrorStack
-///\brief Walks the error stack for the current thread, calling the
-/// specified function.
-///\param direction - IN: Direction in which the error stack is to be walked
-///\param func - IN: Function to be called for each error encountered
-///\param client_data - IN: Data passed to the error function
+// Function: Exception::walkErrorStack
+///\brief Walks the error stack for the current thread, calling the
+/// specified function.
+///\param direction - IN: Direction in which the error stack is to be walked
+///\param func - IN: Function to be called for each error encountered
+///\param client_data - IN: Data passed to the error function
///\par Description
-/// Valid values for \a direction include:
-/// \li \c H5E_WALK_UPWARD - begin with the most specific error
-/// and end at the API
-/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the
-/// inner-most function where the error was first detected
+/// Valid values for \a direction include:
+/// \li \c H5E_WALK_UPWARD - begin with the most specific error
+/// and end at the API
+/// \li \c H5E_WALK_DOWNWARD - begin at the API and end at the
+/// inner-most function where the error was first detected
///\par
-/// The function specified by \a func will be called for each
-/// error in the error stack. The \c H5E_walk_t prototype is as
-/// follows:
+/// The function specified by \a func will be called for each
+/// error in the error stack. The \c H5E_walk_t prototype is as
+/// follows:
///\code
/// typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data)
/// int n - Indexed position of the error in the stack; it begins at zero
-/// regardless of stack traversal direction
+/// regardless of stack traversal direction
/// H5E_error_t *err_desc - Pointer to a data structure describing the
-/// error. This structure is listed below.
+/// error. This structure is listed below.
/// void *client_data - Pointer to client data in the format expected by
-/// the user-defined function.
+/// the user-defined function.
///\endcode
///\par
/// Data structure to describe the error:
@@ -238,87 +238,87 @@ void Exception::clearErrorStack()
/// const char *desc; //optional supplied description
/// } H5E_error2_t;
///\endcode
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void Exception::walkErrorStack( H5E_direction_t direction, H5E_walk2_t func, void* client_data )
+void Exception::walkErrorStack(H5E_direction_t direction, H5E_walk2_t func, void* client_data)
{
- // calls the C API routine H5Ewalk to walk the error stack
- herr_t ret_value = H5Ewalk2( H5E_DEFAULT, direction, func, client_data );
- if( ret_value < 0 )
- throw Exception( "Exception::walkErrorStack", "H5Ewalk failed" );
+ // calls the C API routine H5Ewalk to walk the error stack
+ herr_t ret_value = H5Ewalk2(H5E_DEFAULT, direction, func, client_data);
+ if (ret_value < 0)
+ throw Exception("Exception::walkErrorStack", "H5Ewalk failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::getDetailMsg
-///\brief Returns the detailed message set at the time the exception
-/// is thrown.
-///\return Text message - \c H5std_string
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::getDetailMsg
+///\brief Returns the detailed message set at the time the exception
+/// is thrown.
+///\return Text message - \c H5std_string
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5std_string Exception::getDetailMsg() const
{
- return(detail_message);
+ return(detail_message);
}
//--------------------------------------------------------------------------
-// Function: Exception::getCDetailMsg
-///\brief Returns the detailed message set at the time the exception
-/// is thrown.
-///\return Text message - \c char pointer
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::getCDetailMsg
+///\brief Returns the detailed message set at the time the exception
+/// is thrown.
+///\return Text message - \c char pointer
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
const char* Exception::getCDetailMsg() const
{
- return(detail_message.c_str());
+ return(detail_message.c_str());
}
//--------------------------------------------------------------------------
-// Function: Exception::getFuncName
-///\brief Returns the name of the function, where the exception is thrown.
-///\return Text message - \c H5std_string
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::getFuncName
+///\brief Returns the name of the function, where the exception is thrown.
+///\return Text message - \c H5std_string
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5std_string Exception::getFuncName() const
{
- return(func_name);
+ return(func_name);
}
//--------------------------------------------------------------------------
-// Function: Exception::getCFuncName
-///\brief Returns the name of the function, where the exception is thrown.
-///\return Text message - \c char pointer
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::getCFuncName
+///\brief Returns the name of the function, where the exception is thrown.
+///\return Text message - \c char pointer
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
const char* Exception::getCFuncName() const
{
- return(func_name.c_str());
+ return(func_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: Exception::printErrorStack (static)
-///\brief Prints the error stack in a default manner.
-///\param stream - IN: File pointer, default to stderr
-///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0)
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::printErrorStack (static)
+///\brief Prints the error stack in a default manner.
+///\param stream - IN: File pointer, default to stderr
+///\param err_stack - IN: Error stack ID, default to H5E_DEFAULT(0)
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Exception::printErrorStack(FILE* stream, hid_t err_stack)
{
herr_t ret_value = H5Eprint2(err_stack, stream);
- if( ret_value < 0 )
- throw Exception( "Printing error stack", "H5Eprint2 failed" );
+ if (ret_value < 0)
+ throw Exception("Printing error stack", "H5Eprint2 failed");
}
//--------------------------------------------------------------------------
-// Function: Exception::printError
-// Purpose: Prints the error stack in a default manner. This member
-// function is replaced by the static function printErrorStack
-// and will be removed from the next major release.
-// Parameter stream - IN: File pointer
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception::printError
+// Purpose: Prints the error stack in a default manner. This member
+// function is replaced by the static function printErrorStack
+// and will be removed from the next major release.
+// Parameter stream - IN: File pointer
+// Programmer Binh-Minh Ribler - 2000
// Description:
-// This function can be removed in next major release.
-// -BMR, 2014/04/24
-// Removed from documentation. -BMR, 2016/03/23
+// This function can be removed in next major release.
+// -BMR, 2014/04/24
+// Removed from documentation. -BMR, 2016/03/23
//--------------------------------------------------------------------------
void Exception::printError(FILE* stream) const
{
@@ -326,285 +326,285 @@ void Exception::printError(FILE* stream) const
}
//--------------------------------------------------------------------------
-// Function: Exception destructor
-///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: Exception destructor
+///\brief Noop destructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Exception::~Exception() throw() {}
//--------------------------------------------------------------------------
-// Subclass: FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: FileIException default constructor
-///\brief Default constructor.
+// Function: FileIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
FileIException::FileIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: FileIException overloaded constructor
-///\brief Creates a FileIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: FileIException overloaded constructor
+///\brief Creates a FileIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
FileIException::FileIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: FileIException destructor
-///\brief Noop destructor.
+// Function: FileIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
FileIException::~FileIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: GroupIException default constructor
-///\brief Default constructor.
+// Function: GroupIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
GroupIException::GroupIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: GroupIException overloaded constructor
-///\brief Creates a GroupIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: GroupIException overloaded constructor
+///\brief Creates a GroupIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
GroupIException::GroupIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: GroupIException destructor
-///\brief Noop destructor.
+// Function: GroupIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
GroupIException::~GroupIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: DataSpaceIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: DataSpaceIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: DataSpaceIException default constructor
-///\brief Default constructor.
+// Function: DataSpaceIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
DataSpaceIException::DataSpaceIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: DataSpaceIException overloaded constructor
-///\brief Creates a DataSpaceIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: DataSpaceIException overloaded constructor
+///\brief Creates a DataSpaceIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataSpaceIException::DataSpaceIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: DataSpaceIException destructor
-///\brief Noop destructor.
+// Function: DataSpaceIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
DataSpaceIException::~DataSpaceIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: DataTypeIException default constructor
-///\brief Default constructor.
+// Function: DataTypeIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
DataTypeIException::DataTypeIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: DataTypeIException overloaded constructor
-///\brief Creates a DataTypeIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: DataTypeIException overloaded constructor
+///\brief Creates a DataTypeIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataTypeIException::DataTypeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: DataTypeIException destructor
-///\brief Noop destructor.
+// Function: DataTypeIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
DataTypeIException::~DataTypeIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: ObjHeaderIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: ObjHeaderIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: ObjHeaderIException default constructor
-///\brief Default constructor.
+// Function: ObjHeaderIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
ObjHeaderIException::ObjHeaderIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: ObjHeaderIException overloaded constructor
-///\brief Creates an ObjHeaderIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: ObjHeaderIException overloaded constructor
+///\brief Creates an ObjHeaderIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
ObjHeaderIException::ObjHeaderIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: ObjHeaderIException destructor
-///\brief Noop destructor.
+// Function: ObjHeaderIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
ObjHeaderIException::~ObjHeaderIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: PropListIException default constructor
-///\brief Default constructor.
+// Function: PropListIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
PropListIException::PropListIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: PropListIException overloaded constructor
-///\brief Creates a PropListIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: PropListIException overloaded constructor
+///\brief Creates a PropListIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
PropListIException::PropListIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: PropListIException destructor
-///\brief Noop destructor.
+// Function: PropListIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
PropListIException::~PropListIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: DataSetIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: DataSetIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: DataSetIException default constructor
-///\brief Default constructor.
+// Function: DataSetIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
DataSetIException::DataSetIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: DataSetIException overloaded constructor
-///\brief Creates a DataSetIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: DataSetIException overloaded constructor
+///\brief Creates a DataSetIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
DataSetIException::DataSetIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: DataSetIException destructor
-///\brief Noop destructor.
+// Function: DataSetIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
DataSetIException::~DataSetIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: AttributeIException default constructor
-///\brief Default constructor.
+// Function: AttributeIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
AttributeIException::AttributeIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: AttributeIException overloaded constructor
-///\brief Creates an AttributeIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: AttributeIException overloaded constructor
+///\brief Creates an AttributeIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
AttributeIException::AttributeIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: AttributeIException destructor
-///\brief Noop destructor.
+// Function: AttributeIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
AttributeIException::~AttributeIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: ReferenceException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: ReferenceException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: ReferenceException default constructor
-///\brief Default constructor.
+// Function: ReferenceException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
ReferenceException::ReferenceException():Exception(){}
//--------------------------------------------------------------------------
-// Function: ReferenceException overloaded constructor
-///\brief Creates a ReferenceException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: ReferenceException overloaded constructor
+///\brief Creates a ReferenceException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
ReferenceException::ReferenceException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: ReferenceException destructor
-///\brief Noop destructor.
+// Function: ReferenceException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
ReferenceException::~ReferenceException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: LibraryIException default constructor
-///\brief Default constructor.
+// Function: LibraryIException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
LibraryIException::LibraryIException():Exception(){}
//--------------------------------------------------------------------------
-// Function: LibraryIException overloaded constructor
-///\brief Creates a LibraryIException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: LibraryIException overloaded constructor
+///\brief Creates a LibraryIException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
LibraryIException::LibraryIException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: LibraryIException destructor
-///\brief Noop destructor.
+// Function: LibraryIException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
LibraryIException::~LibraryIException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: LocationException
-// Programmer Binh-Minh Ribler - 2014
+// Subclass: LocationException
+// Programmer Binh-Minh Ribler - 2014
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: LocationException default constructor
-///\brief Default constructor.
+// Function: LocationException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
LocationException::LocationException():Exception(){}
//--------------------------------------------------------------------------
-// Function: LocationException overloaded constructor
-///\brief Creates a LocationException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: LocationException overloaded constructor
+///\brief Creates a LocationException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
LocationException::LocationException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: LocationException destructor
-///\brief Noop destructor.
+// Function: LocationException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
LocationException::~LocationException() throw() {}
//--------------------------------------------------------------------------
-// Subclass: IdComponentException
-// Programmer Binh-Minh Ribler - 2000
+// Subclass: IdComponentException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: IdComponentException default constructor
-///\brief Default constructor.
+// Function: IdComponentException default constructor
+///\brief Default constructor.
//--------------------------------------------------------------------------
IdComponentException::IdComponentException(): Exception() {}
//--------------------------------------------------------------------------
-// Function: IdComponentException overloaded constructor
-///\brief Creates a IdComponentException with the name of the function,
-/// in which the failure occurs, and an optional detailed message.
-///\param func - IN: Name of the function where failure occurs
-///\param message - IN: Message on the failure
+// Function: IdComponentException overloaded constructor
+///\brief Creates a IdComponentException with the name of the function,
+/// in which the failure occurs, and an optional detailed message.
+///\param func - IN: Name of the function where failure occurs
+///\param message - IN: Message on the failure
//--------------------------------------------------------------------------
IdComponentException::IdComponentException(const H5std_string& func, const H5std_string& message) : Exception(func, message) {}
//--------------------------------------------------------------------------
-// Function: IdComponentException destructor
-///\brief Noop destructor.
+// Function: IdComponentException destructor
+///\brief Noop destructor.
//--------------------------------------------------------------------------
IdComponentException::~IdComponentException() throw() {}
diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h
index 7112995..1f85711 100644
--- a/c++/src/H5Exception.h
+++ b/c++/src/H5Exception.h
@@ -33,147 +33,147 @@ namespace H5 {
*/
class H5_DLLCPP Exception {
public:
- // Creates an exception with a function name where the failure occurs
- // and an optional detailed message
- Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ // Creates an exception with a function name where the failure occurs
+ // and an optional detailed message
+ Exception(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- // Returns a character string that describes the error specified by
- // a major error number.
- H5std_string getMajorString( hid_t err_major_id ) const;
+ // Returns a character string that describes the error specified by
+ // a major error number.
+ H5std_string getMajorString(hid_t err_major_id) const;
- // Returns a character string that describes the error specified by
- // a minor error number.
- H5std_string getMinorString( hid_t err_minor_id ) const;
+ // Returns a character string that describes the error specified by
+ // a minor error number.
+ H5std_string getMinorString(hid_t err_minor_id) const;
- // Returns the detailed message set at the time the exception is thrown
- H5std_string getDetailMsg() const;
- const char* getCDetailMsg() const; // C string of detailed message
- H5std_string getFuncName() const; // function name as a string object
- const char* getCFuncName() const; // function name as a char string
+ // Returns the detailed message set at the time the exception is thrown
+ H5std_string getDetailMsg() const;
+ const char* getCDetailMsg() const; // C string of detailed message
+ H5std_string getFuncName() const; // function name as a string object
+ const char* getCFuncName() const; // function name as a char string
- // Turns on the automatic error printing.
- static void setAutoPrint( H5E_auto2_t& func, void* client_data);
+ // Turns on the automatic error printing.
+ static void setAutoPrint(H5E_auto2_t& func, void* client_data);
- // Turns off the automatic error printing.
- static void dontPrint();
+ // Turns off the automatic error printing.
+ static void dontPrint();
- // Retrieves the current settings for the automatic error stack
- // traversal function and its data.
- static void getAutoPrint( H5E_auto2_t& func, void** client_data);
+ // Retrieves the current settings for the automatic error stack
+ // traversal function and its data.
+ static void getAutoPrint(H5E_auto2_t& func, void** client_data);
- // Clears the error stack for the current thread.
- static void clearErrorStack();
+ // Clears the error stack for the current thread.
+ static void clearErrorStack();
- // Walks the error stack for the current thread, calling the
- // specified function.
- static void walkErrorStack( H5E_direction_t direction,
- H5E_walk2_t func, void* client_data);
+ // Walks the error stack for the current thread, calling the
+ // specified function.
+ static void walkErrorStack(H5E_direction_t direction,
+ H5E_walk2_t func, void* client_data);
- // Prints the error stack in a default manner.
- static void printErrorStack(FILE* stream = stderr,
- hid_t err_stack = H5E_DEFAULT); // Static
- virtual void printError(FILE* stream = NULL) const;
+ // Prints the error stack in a default manner.
+ static void printErrorStack(FILE* stream = stderr,
+ hid_t err_stack = H5E_DEFAULT);
+ virtual void printError(FILE* stream = NULL) const;
- // Default constructor
- Exception();
+ // Default constructor
+ Exception();
- // copy constructor
- Exception( const Exception& orig);
+ // copy constructor
+ Exception(const Exception& orig);
- // virtual Destructor
- virtual ~Exception() throw();
+ // virtual Destructor
+ virtual ~Exception() throw();
protected:
- // Default value for detail_message
- static const char DEFAULT_MSG[];
+ // Default value for detail_message
+ static const char DEFAULT_MSG[];
private:
- H5std_string detail_message;
- H5std_string func_name;
+ H5std_string detail_message;
+ H5std_string func_name;
};
class H5_DLLCPP FileIException : public Exception {
public:
- FileIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- FileIException();
- virtual ~FileIException() throw();
+ FileIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ FileIException();
+ virtual ~FileIException() throw();
};
class H5_DLLCPP GroupIException : public Exception {
public:
- GroupIException( const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- GroupIException();
- virtual ~GroupIException() throw();
+ GroupIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ GroupIException();
+ virtual ~GroupIException() throw();
};
class H5_DLLCPP DataSpaceIException : public Exception {
public:
- DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- DataSpaceIException();
- virtual ~DataSpaceIException() throw();
+ DataSpaceIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ DataSpaceIException();
+ virtual ~DataSpaceIException() throw();
};
class H5_DLLCPP DataTypeIException : public Exception {
public:
- DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- DataTypeIException();
- virtual ~DataTypeIException() throw();
+ DataTypeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ DataTypeIException();
+ virtual ~DataTypeIException() throw();
};
class H5_DLLCPP ObjHeaderIException : public Exception {
public:
- ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- ObjHeaderIException();
- virtual ~ObjHeaderIException() throw();
+ ObjHeaderIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ ObjHeaderIException();
+ virtual ~ObjHeaderIException() throw();
};
class H5_DLLCPP PropListIException : public Exception {
public:
- PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- PropListIException();
- virtual ~PropListIException() throw();
+ PropListIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ PropListIException();
+ virtual ~PropListIException() throw();
};
class H5_DLLCPP DataSetIException : public Exception {
public:
- DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- DataSetIException();
- virtual ~DataSetIException() throw();
+ DataSetIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ DataSetIException();
+ virtual ~DataSetIException() throw();
};
class H5_DLLCPP AttributeIException : public Exception {
public:
- AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- AttributeIException();
- virtual ~AttributeIException() throw();
+ AttributeIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ AttributeIException();
+ virtual ~AttributeIException() throw();
};
class H5_DLLCPP ReferenceException : public Exception {
public:
- ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- ReferenceException();
- virtual ~ReferenceException() throw();
+ ReferenceException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ ReferenceException();
+ virtual ~ReferenceException() throw();
};
class H5_DLLCPP LibraryIException : public Exception {
public:
- LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- LibraryIException();
- virtual ~LibraryIException() throw();
+ LibraryIException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ LibraryIException();
+ virtual ~LibraryIException() throw();
};
class H5_DLLCPP LocationException : public Exception {
public:
- LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- LocationException();
- virtual ~LocationException() throw();
+ LocationException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ LocationException();
+ virtual ~LocationException() throw();
};
class H5_DLLCPP IdComponentException : public Exception {
public:
- IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
- IdComponentException();
- virtual ~IdComponentException() throw();
+ IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG);
+ IdComponentException();
+ virtual ~IdComponentException() throw();
};
}
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp
index c3919da..1ab812c 100644
--- a/c++/src/H5FaccProp.cpp
+++ b/c++/src/H5FaccProp.cpp
@@ -63,7 +63,7 @@ FileAccPropList* FileAccPropList::getConstant()
//--------------------------------------------------------------------------
// Function: FileAccPropList::deleteConstants
-// Purpose: Deletes the constant object that FileAccPropList::DEFAULT_
+// Purpose Deletes the constant object that FileAccPropList::DEFAULT_
// points to.
// exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2015
@@ -75,271 +75,271 @@ void FileAccPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose: Constant for default property
+// Purpose Constant for default property
//--------------------------------------------------------------------------
const FileAccPropList& FileAccPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: Default Constructor
-///\brief Creates a file access property list
-// Programmer: Binh-Minh Ribler - 2000
+// Function: Default Constructor
+///\brief Creates a file access property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {}
+FileAccPropList::FileAccPropList() : PropList(H5P_FILE_ACCESS) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList copy constructor
-///\brief Copy Constructor: makes a copy of the original
-///\param original - IN: FileAccPropList instance to copy
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList copy constructor
+///\brief Copy Constructor: makes a copy of the original
+///\param original - IN: FileAccPropList instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList(const FileAccPropList& original) : PropList(original) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList overloaded constructor
-///\brief Creates a file access property list using the id of an
-/// existing one.
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList overloaded constructor
+///\brief Creates a file access property list using the id of an
+/// existing one.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setStdio
-///\brief Modifies this property list to use the \c H5FD_STDIO driver.
+// Function: FileAccPropList::setStdio
+///\brief Modifies this property list to use the \c H5FD_STDIO driver.
///
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setStdio() const
{
- herr_t ret_value = H5Pset_fapl_stdio(id);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed");
- }
+ herr_t ret_value = H5Pset_fapl_stdio(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setStdio", "H5Pset_fapl_stdio failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getDriver
-///\brief Return the ID of the low-level file driver.
-///\return A low-level driver ID which is the same ID used when the
-/// driver was set for the property list. The driver ID is
-/// only valid as long as the file driver remains registered.
-/// Valid driver identifiers can be found at:
+// Function: FileAccPropList::getDriver
+///\brief Return the ID of the low-level file driver.
+///\return A low-level driver ID which is the same ID used when the
+/// driver was set for the property list. The driver ID is
+/// only valid as long as the file driver remains registered.
+/// Valid driver identifiers can be found at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hid_t FileAccPropList::getDriver() const
{
- hid_t driver = H5Pget_driver(id);
- if (driver < 0)
- {
- throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed");
- }
+ hid_t driver = H5Pget_driver(id);
+ if (driver < 0)
+ {
+ throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed");
+ }
return(driver);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setDriver
-///\brief Set file driver for this property list.
-///\param new_driver_id - IN: File driver
-///\param new_driver_info - IN: Struct containing the driver-specific properites
-///\exception H5::PropListIException
+// Function: FileAccPropList::setDriver
+///\brief Set file driver for this property list.
+///\param new_driver_id - IN: File driver
+///\param new_driver_info - IN: Struct containing the driver-specific properites
+///\exception H5::PropListIException
///\par Description
-/// For a list of valid driver identifiers, please see the C
-/// layer Reference Manual at:
+/// For a list of valid driver identifiers, please see the C
+/// layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const
{
- herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info);
- if (ret_value < 0)
- {
- throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed");
- }
+ herr_t ret_value = H5Pset_driver(id, new_driver_id, new_driver_info);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setDriver", "H5Pset_driver failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setFamilyOffset
-///\brief Sets offset for family driver.
-///\param offset - IN: offset value
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::setFamilyOffset
+///\brief Sets offset for family driver.
+///\param offset - IN: offset value
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setFamilyOffset(hsize_t offset) const
{
- herr_t ret_value = H5Pset_family_offset(id, offset);
- if (ret_value < 0)
- {
- throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed");
- }
+ herr_t ret_value = H5Pset_family_offset(id, offset);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setFamilyOffset", "H5Pset_family_offset failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getFamilyOffset
-///\brief Get offset for family driver.
-///\return Offset for family driver
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getFamilyOffset
+///\brief Get offset for family driver.
+///\return Offset for family driver
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hsize_t FileAccPropList::getFamilyOffset() const
{
- hsize_t offset;
- herr_t ret_value = H5Pget_family_offset(id, &offset);
- if (ret_value < 0)
- {
- throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed");
- }
+ hsize_t offset;
+ herr_t ret_value = H5Pget_family_offset(id, &offset);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getFamilyOffset", "H5Pget_family_offset failed");
+ }
return(offset);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setCore
-///\brief Modifies this file access property list to use the \c H5FD_CORE
-/// driver.
-///\param increment - IN: Specifies how much memory to increase each
-/// time more memory is needed, in bytes
-///\param backing_store - IN: Indicating whether to write the file
-/// contents to disk when the file is closed
-///\exception H5::PropListIException
+// Function: FileAccPropList::setCore
+///\brief Modifies this file access property list to use the \c H5FD_CORE
+/// driver.
+///\param increment - IN: Specifies how much memory to increase each
+/// time more memory is needed, in bytes
+///\param backing_store - IN: Indicating whether to write the file
+/// contents to disk when the file is closed
+///\exception H5::PropListIException
///\par Description
-/// For more details on the use of \c H5FD_CORE driver, please
-/// refer to
+/// For more details on the use of \c H5FD_CORE driver, please
+/// refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const
{
- herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store);
- if (ret_value < 0)
- {
- throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed");
- }
+ herr_t ret_value = H5Pset_fapl_core (id, increment, backing_store);
+ if (ret_value < 0)
+ {
+ throw PropListIException ("FileAccPropList::setCore", "H5Pset_fapl_core failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getCore
-///\brief Queries core file driver properties.
-///\param increment - OUT: Size of memory increment, in bytes
-///\param backing_store - OUT: Indicating whether to write the file
-/// contents to disk when the file is closed
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getCore
+///\brief Queries core file driver properties.
+///\param increment - OUT: Size of memory increment, in bytes
+///\param backing_store - OUT: Indicating whether to write the file
+/// contents to disk when the file is closed
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const
{
- herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed");
- }
+ herr_t ret_value = H5Pget_fapl_core(id, &increment, &backing_store);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getCore", "H5Pget_fapl_core failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setFamily
-///\brief Sets this file access property list to use the family driver.
-///\param memb_size - IN: Size in bytes of each file member
-///\param memb_plist - IN: File access property list to be used for
-/// each family member
-///\exception H5::PropListIException
+// Function: FileAccPropList::setFamily
+///\brief Sets this file access property list to use the family driver.
+///\param memb_size - IN: Size in bytes of each file member
+///\param memb_plist - IN: File access property list to be used for
+/// each family member
+///\exception H5::PropListIException
///\par Description
-/// Note that \a memb_size is used only when creating a new file.
-// Programmer: Binh-Minh Ribler - April, 2004
+/// Note that \a memb_size is used only when creating a new file.
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const
+void FileAccPropList::setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const
{
- herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId() );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed");
- }
+ herr_t ret_value = H5Pset_fapl_family (id, memb_size, memb_plist.getId());
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setFamily", "H5Pset_fapl_family failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getFamily
-///\brief Returns information about the family file access property
-/// list.
-///\param memb_size - OUT: Size in bytes of each file member
-///\param memb_plist - OUT: Retrieved file access property list for each
-/// file member
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getFamily
+///\brief Returns information about the family file access property
+/// list.
+///\param memb_size - OUT: Size in bytes of each file member
+///\param memb_plist - OUT: Retrieved file access property list for each
+/// file member
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const
{
- hid_t memb_plist_id;
- herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
- }
- memb_plist.p_setId(memb_plist_id);
+ hid_t memb_plist_id;
+ herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
+ }
+ memb_plist.p_setId(memb_plist_id);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getFamily
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts and its return value.
-///\param memb_size - OUT: Size in bytes of each file member
-///\return The file access property list for each file member
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getFamily
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts and its return value.
+///\param memb_size - OUT: Size in bytes of each file member
+///\return The file access property list for each file member
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
{
- hid_t memb_plist_id;
- herr_t ret_value = H5Pget_fapl_family( id, &memb_size, &memb_plist_id );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
- }
- FileAccPropList memb_plist(memb_plist_id);
- return(memb_plist);
-}
-
-//--------------------------------------------------------------------------
-// Function: FileAccPropList::setSplit
-///\brief Emulates the old split file driver, which stored meta data
-/// in one file and raw data in another file.
-///\param meta_plist - IN: File access plist for the metadata file
-///\param raw_plist - IN: File access plist for the raw data file
-///\param meta_ext - IN: Metadata filename extension as \c char*
-///\param raw_ext - IN: Raw data filename extension as \c char*
-///\exception H5::PropListIException
+ hid_t memb_plist_id;
+ herr_t ret_value = H5Pget_fapl_family(id, &memb_size, &memb_plist_id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getFamily", "H5Pget_fapl_family failed");
+ }
+ FileAccPropList memb_plist(memb_plist_id);
+ return(memb_plist);
+}
+
+//--------------------------------------------------------------------------
+// Function: FileAccPropList::setSplit
+///\brief Emulates the old split file driver, which stored meta data
+/// in one file and raw data in another file.
+///\param meta_plist - IN: File access plist for the metadata file
+///\param raw_plist - IN: File access plist for the raw data file
+///\param meta_ext - IN: Metadata filename extension as \c char*
+///\param raw_ext - IN: Raw data filename extension as \c char*
+///\exception H5::PropListIException
///\par Description
-/// Temporary - For information, please refer to:
+/// Temporary - For information, please refer to:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const
-{
- hid_t meta_pid = meta_plist.getId();
- hid_t raw_pid = raw_plist.getId();
- herr_t ret_value = H5Pset_fapl_split( id, meta_ext, meta_pid, raw_ext, raw_pid );
- if( ret_value < 0 )
+void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext) const
{
- throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed");
- }
+ hid_t meta_pid = meta_plist.getId();
+ hid_t raw_pid = raw_plist.getId();
+ herr_t ret_value = H5Pset_fapl_split(id, meta_ext, meta_pid, raw_ext, raw_pid);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setSplit", "H5Pset_fapl_split failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setSplit
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes character arguments as \c H5std_string.
-///\param meta_plist - IN: File access plist for the metadata file
-///\param raw_plist - IN: File access plist for the raw data file
-///\param meta_ext - IN: Metadata filename extension as \c H5std_string
-///\param raw_ext - IN: Raw data filename extension as \c H5std_string
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::setSplit
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes character arguments as \c H5std_string.
+///\param meta_plist - IN: File access plist for the metadata file
+///\param raw_plist - IN: File access plist for the raw data file
+///\param meta_ext - IN: Metadata filename extension as \c H5std_string
+///\param raw_ext - IN: Raw data filename extension as \c H5std_string
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext ) const
+void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccPropList& raw_plist, const H5std_string& meta_ext, const H5std_string& raw_ext) const
{
- setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() );
+ setSplit(meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str());
}
// Stream Virtual File Driver had been removed from the main library.
@@ -347,402 +347,402 @@ void FileAccPropList::setSplit(const FileAccPropList& meta_plist, const FileAccP
// -BMR, March, 2012
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getSieveBufSize
-///\brief Returns the current settings for the data sieve buffer size
-/// property from this property list.
-///\return Data sieve buffer size, in bytes
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getSieveBufSize
+///\brief Returns the current settings for the data sieve buffer size
+/// property from this property list.
+///\return Data sieve buffer size, in bytes
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t FileAccPropList::getSieveBufSize() const
{
- size_t bufsize;
- herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
- }
- return(bufsize);
+ size_t bufsize;
+ herr_t ret_value = H5Pget_sieve_buf_size(id, &bufsize);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
+ }
+ return(bufsize);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setSieveBufSize
-///\brief Sets the maximum size of the data sieve buffer.
-///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer
-///\exception H5::PropListIException
+// Function: FileAccPropList::setSieveBufSize
+///\brief Sets the maximum size of the data sieve buffer.
+///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer
+///\exception H5::PropListIException
///\par Description
-/// For detail on data sieving, please refer to
+/// For detail on data sieving, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setSieveBufSize(size_t bufsize) const
{
- herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
- }
+ herr_t ret_value = H5Pset_sieve_buf_size(id, bufsize);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getSieveBufSize", "H5Pget_sieve_buf_size failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setMetaBlockSize
-///\brief Sets the minimum size of metadata block allocations.
-///\param block_size - IN: Minimum size, in bytes, of metadata
-/// block allocations
-///\exception H5::PropListIException
+// Function: FileAccPropList::setMetaBlockSize
+///\brief Sets the minimum size of metadata block allocations.
+///\param block_size - IN: Minimum size, in bytes, of metadata
+/// block allocations
+///\exception H5::PropListIException
///\par Description
-/// For more detail, please see the C layer Reference Manual at:
+/// For more detail, please see the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const
{
- herr_t ret_value = H5Pset_meta_block_size(id, block_size);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed");
- }
+ herr_t ret_value = H5Pset_meta_block_size(id, block_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setMetaBlockSize", "H5Pset_meta_block_size failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getMetaBlockSize
-///\brief Returns the current metadata block size setting.
-///\return Metadata block size
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getMetaBlockSize
+///\brief Returns the current metadata block size setting.
+///\return Metadata block size
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hsize_t FileAccPropList::getMetaBlockSize() const
{
- hsize_t block_size;
- herr_t ret_value = H5Pget_meta_block_size(id, &block_size);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed");
- }
- return(block_size);
+ hsize_t block_size;
+ herr_t ret_value = H5Pget_meta_block_size(id, &block_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getMetaBlockSize", "H5Pget_meta_block_size failed");
+ }
+ return(block_size);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setLog
-///\brief Modifies this file access property list to use the logging
-/// driver.
-///\param logfile - IN: Name of the log file
-///\param flags - IN: Flags specifying the types of logging activity
-///\param buf_size - IN: Size of the logging buffer
-///\exception H5::PropListIException
+// Function: FileAccPropList::setLog
+///\brief Modifies this file access property list to use the logging
+/// driver.
+///\param logfile - IN: Name of the log file
+///\param flags - IN: Flags specifying the types of logging activity
+///\param buf_size - IN: Size of the logging buffer
+///\exception H5::PropListIException
///\par Description
-/// For detail on \a flags, please refer to
+/// For detail on \a flags, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const
{
- herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed");
- }
+ herr_t ret_value = H5Pset_fapl_log(id, logfile, flags, buf_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setLog", "H5Pset_fapl_log failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setLog
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param logfile - IN: Name of the log file - string
-///\param flags - IN: Flags specifying the types of logging activity
-///\param buf_size - IN: Size of the logging buffer
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::setLog
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param logfile - IN: Name of the log file - string
+///\param flags - IN: Flags specifying the types of logging activity
+///\param buf_size - IN: Size of the logging buffer
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const
{
- setLog(logfile.c_str(), flags, buf_size);
+ setLog(logfile.c_str(), flags, buf_size);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setSec2
-///\brief Modifies this file access property list to use the sec2
-/// driver.
+// Function: FileAccPropList::setSec2
+///\brief Modifies this file access property list to use the sec2
+/// driver.
///
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setSec2() const
{
- herr_t ret_value = H5Pset_fapl_sec2(id);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed");
- }
+ herr_t ret_value = H5Pset_fapl_sec2(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setSec2", "H5Pset_fapl_sec2 failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setAlignment
-///\brief Sets the alignment properties of this property list.
-///\param threshold - IN: Threshold value for file object size
-///\param alignment - IN: Alignment value
-///\exception H5::PropListIException
+// Function: FileAccPropList::setAlignment
+///\brief Sets the alignment properties of this property list.
+///\param threshold - IN: Threshold value for file object size
+///\param alignment - IN: Alignment value
+///\exception H5::PropListIException
///\par Description
-/// The parameter \a threshold must have a non-negative value.
-/// Note that setting the threshold value to 0 (zero) has the
-/// effect of a special case, forcing everything to be aligned.
-/// The parameter \a alignment must have a positive value.
+/// The parameter \a threshold must have a non-negative value.
+/// Note that setting the threshold value to 0 (zero) has the
+/// effect of a special case, forcing everything to be aligned.
+/// The parameter \a alignment must have a positive value.
///
-/// For detail on \a setting alignment, please refer to
+/// For detail on \a setting alignment, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment
-// Programmer: Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
+void FileAccPropList::setAlignment(hsize_t threshold, hsize_t alignment) const
{
- herr_t ret_value = H5Pset_alignment( id, threshold, alignment );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed");
- }
+ herr_t ret_value = H5Pset_alignment(id, threshold, alignment);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setAlignment", "H5Pset_alignment failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getAlignment
-///\brief Returns the current settings for alignment properties from
-/// this property list.
-///\param threshold - OUT: Retrieved threshold value for file object size
-///\param alignment - OUT: Retrieved alignment value
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList::getAlignment
+///\brief Returns the current settings for alignment properties from
+/// this property list.
+///\param threshold - OUT: Retrieved threshold value for file object size
+///\param alignment - OUT: Retrieved alignment value
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const
+void FileAccPropList::getAlignment(hsize_t &threshold, hsize_t &alignment) const
{
- herr_t ret_value = H5Pget_alignment( id, &threshold, &alignment );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed");
- }
+ herr_t ret_value = H5Pget_alignment(id, &threshold, &alignment);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getAlignment", "H5Pget_alignment failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setMultiType
-///\brief Sets data type for \c MULTI driver.
-///\param dtype - IN: Type of data
-///\exception H5::PropListIException
+// Function: FileAccPropList::setMultiType
+///\brief Sets data type for \c MULTI driver.
+///\param dtype - IN: Type of data
+///\exception H5::PropListIException
///\par Description
-/// More details and valid values for \a dtype can be found at:
+/// More details and valid values for \a dtype can be found at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setMultiType(H5FD_mem_t dtype) const
{
- herr_t ret_value = H5Pset_multi_type(id, dtype);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed");
- }
+ herr_t ret_value = H5Pset_multi_type(id, dtype);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setMultiType", "H5Pset_multi_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getMultiType
-///\brief Returns the data type property for \c MULTI driver.
-///\return The data type property
-///\exception H5::PropListIException
+// Function: FileAccPropList::getMultiType
+///\brief Returns the data type property for \c MULTI driver.
+///\return The data type property
+///\exception H5::PropListIException
///\par Description
-/// More details and possible returned values can be found at:
+/// More details and possible returned values can be found at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType
-// Programmer: Binh-Minh Ribler - April, 2004
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5FD_mem_t FileAccPropList::getMultiType() const
{
- H5FD_mem_t dtype;
- herr_t ret_value = H5Pget_multi_type(id, &dtype);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed");
- }
- return(dtype);
+ H5FD_mem_t dtype;
+ herr_t ret_value = H5Pget_multi_type(id, &dtype);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getMultiType", "H5Pget_multi_type failed");
+ }
+ return(dtype);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setCache
-///\brief Sets the meta data cache and raw data chunk cache parameters.
-///\param mdc_nelmts - IN: Number of elements in the meta data cache
-///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache
-///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes
-///\param rdcc_w0 - IN: Preemption policy
-///\exception H5::PropListIException
+// Function: FileAccPropList::setCache
+///\brief Sets the meta data cache and raw data chunk cache parameters.
+///\param mdc_nelmts - IN: Number of elements in the meta data cache
+///\param rdcc_nelmts - IN: Number of elements in the raw data chunk cache
+///\param rdcc_nbytes - IN: Total size of the raw data chunk cache, in bytes
+///\param rdcc_w0 - IN: Preemption policy
+///\exception H5::PropListIException
///\par Description
-/// The argument \a rdcc_w0 should hold a value between 0 and 1
-/// inclusive. This value indicates how much chunks that have
-/// been fully read are favored for preemption. A value of zero
-/// means fully read chunks are treated no differently than other
-/// chunks (the preemption is strictly LRU) while a value of one
-/// means fully read chunks are always preempted before other chunks.
-// Programmer: Binh-Minh Ribler - 2000
+/// The argument \a rdcc_w0 should hold a value between 0 and 1
+/// inclusive. This value indicates how much chunks that have
+/// been fully read are favored for preemption. A value of zero
+/// means fully read chunks are treated no differently than other
+/// chunks (the preemption is strictly LRU) while a value of one
+/// means fully read chunks are always preempted before other chunks.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const
+void FileAccPropList::setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const
{
- herr_t ret_value = H5Pset_cache( id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0 );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed");
- }
+ herr_t ret_value = H5Pset_cache(id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setCache", "H5Pset_cache failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getCache
-///\brief Queries the meta data cache and raw data chunk cache parameters.
-///\param mdc_nelmts - OUT: Number of elements in the meta data cache
-///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache
-///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes
-///\param rdcc_w0 - OUT: Preemption policy
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList::getCache
+///\brief Queries the meta data cache and raw data chunk cache parameters.
+///\param mdc_nelmts - OUT: Number of elements in the meta data cache
+///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache
+///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes
+///\param rdcc_w0 - OUT: Preemption policy
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const
+void FileAccPropList::getCache(int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0) const
{
- herr_t ret_value = H5Pget_cache( id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0 );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed");
- }
+ herr_t ret_value = H5Pget_cache(id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getCache", "H5Pget_cache failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setFcloseDegree
-///\brief Sets the degree for the file close behavior.
-///\param degree - IN:
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::setFcloseDegree
+///\brief Sets the degree for the file close behavior.
+///\param degree - IN:
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree) const
{
- herr_t ret_value = H5Pset_fclose_degree(id, degree);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed");
- }
+ herr_t ret_value = H5Pset_fclose_degree(id, degree);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setFcloseDegree", "H5Pset_fclose_degree failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getFcloseDegree
-///\brief Returns the degree for the file close behavior.
-///\return The degree for the file close behavior
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: FileAccPropList::getFcloseDegree
+///\brief Returns the degree for the file close behavior.
+///\return The degree for the file close behavior
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5F_close_degree_t FileAccPropList::getFcloseDegree() const
{
- H5F_close_degree_t degree;
- herr_t ret_value = H5Pget_fclose_degree(id, &degree);
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed");
- }
- return(degree);
+ H5F_close_degree_t degree;
+ herr_t ret_value = H5Pget_fclose_degree(id, &degree);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getFcloseDegree", "H5Pget_fclose_degree failed");
+ }
+ return(degree);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setGcReferences
-///\brief Sets garbage collecting references flag.
-///\param gc_ref - IN: Flag setting reference garbage collection to
-/// on (1) or off (0).
-///\exception H5::PropListIException
+// Function: FileAccPropList::setGcReferences
+///\brief Sets garbage collecting references flag.
+///\param gc_ref - IN: Flag setting reference garbage collection to
+/// on (1) or off (0).
+///\exception H5::PropListIException
///\par Description
-/// For detail on \a fapl, please refer to
+/// For detail on \a fapl, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences
-// Programmer: Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileAccPropList::setGcReferences( unsigned gc_ref ) const
+void FileAccPropList::setGcReferences(unsigned gc_ref) const
{
- herr_t ret_value = H5Pset_gc_references( id, gc_ref );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed");
- }
+ herr_t ret_value = H5Pset_gc_references(id, gc_ref);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::setGcReferences", "H5Pset_gc_references failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getGcReferences
-///\brief Returns the garbage collecting references setting.
-///\return Garbage collecting references setting, 0 (off) or 1 (on)
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList::getGcReferences
+///\brief Returns the garbage collecting references setting.
+///\return Garbage collecting references setting, 0 (off) or 1 (on)
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
unsigned FileAccPropList::getGcReferences() const
{
- unsigned gc_ref;
+ unsigned gc_ref;
- // the name of this routine will be changed to H5Pget_gc_references???
- herr_t ret_value = H5Pget_gc_references( id, &gc_ref );
- if( ret_value < 0 )
- {
- throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed");
- }
- return( gc_ref );
+ // the name of this routine will be changed to H5Pget_gc_references???
+ herr_t ret_value = H5Pget_gc_references(id, &gc_ref);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileAccPropList::getGcReferences", "H5Pget_gc_references failed");
+ }
+ return(gc_ref);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setLibverBounds
-///\brief Sets bounds on versions of library format to be used when creating
-/// or writing objects.
-///\param libver_low - IN: Earliest version of the library that will be
-/// used for creating or writing objects
-///\param libver_high - IN: Latest version of the library that will be
-///\exception H5::PropListIException
+// Function: FileAccPropList::setLibverBounds
+///\brief Sets bounds on versions of library format to be used when creating
+/// or writing objects.
+///\param libver_low - IN: Earliest version of the library that will be
+/// used for creating or writing objects
+///\param libver_high - IN: Latest version of the library that will be
+///\exception H5::PropListIException
///\par Description
-/// Valid values of \a libver_low are as follows:
-/// \li \c H5F_LIBVER_EARLIEST (Default)
-/// \li \c H5F_LIBVER_18
-/// \li \c H5F_LIBVER_LATEST
+/// Valid values of \a libver_low are as follows:
+/// \li \c H5F_LIBVER_EARLIEST (Default)
+/// \li \c H5F_LIBVER_18
+/// \li \c H5F_LIBVER_LATEST
///
-/// Valid values of \a libver_high are as follows:
-/// \li \c H5F_LIBVER_18
-/// \li \c H5F_LIBVER_LATEST (Default)
+/// Valid values of \a libver_high are as follows:
+/// \li \c H5F_LIBVER_18
+/// \li \c H5F_LIBVER_LATEST (Default)
///
-/// For more details, please refer to
+/// For more details, please refer to
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLibverBounds
-// Programmer: Binh-Minh Ribler - March, 2015
+// Programmer Binh-Minh Ribler - March, 2015
//--------------------------------------------------------------------------
void FileAccPropList::setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const
{
herr_t ret_value = H5Pset_libver_bounds(id, libver_low, libver_high);
if (ret_value < 0)
{
- throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed");
+ throw PropListIException("FileAccPropList::setLibverBounds", "H5Pset_libver_bounds failed");
}
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getLibverBounds
-///\brief Gets the current settings for the library version format bounds
-/// from a file access property list.
-///\param libver_low - OUT: Earliest version of the library that will be
-/// used for creating or writing objects
-///\param libver_high - OUT: Latest version of the library that will be
-/// used for creating or writing objects
-///\exception H5::PropListIException
+// Function: FileAccPropList::getLibverBounds
+///\brief Gets the current settings for the library version format bounds
+/// from a file access property list.
+///\param libver_low - OUT: Earliest version of the library that will be
+/// used for creating or writing objects
+///\param libver_high - OUT: Latest version of the library that will be
+/// used for creating or writing objects
+///\exception H5::PropListIException
///\par Description
-/// On success, the argument \a libver_low can have the following
-/// values:
-/// \li \c H5F_LIBVER_EARLIEST
-/// \li \c H5F_LIBVER_18
-/// \li \c H5F_LIBVER_LATEST
+/// On success, the argument \a libver_low can have the following
+/// values:
+/// \li \c H5F_LIBVER_EARLIEST
+/// \li \c H5F_LIBVER_18
+/// \li \c H5F_LIBVER_LATEST
///
-/// and \a libver_high:
-/// \li \c H5F_LIBVER_18
-/// \li \c H5F_LIBVER_LATEST
-// Programmer: Binh-Minh Ribler - March, 2015
+/// and \a libver_high:
+/// \li \c H5F_LIBVER_18
+/// \li \c H5F_LIBVER_LATEST
+// Programmer Binh-Minh Ribler - March, 2015
//--------------------------------------------------------------------------
void FileAccPropList::getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const
{
herr_t ret_value = H5Pget_libver_bounds(id, &libver_low, &libver_high);
- if( ret_value < 0 )
+ if (ret_value < 0)
{
- throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed");
+ throw PropListIException("FileAccPropList::getLibverBounds", "H5Pget_libver_bounds failed");
}
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList destructor
-///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileAccPropList destructor
+///\brief Noop destructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::~FileAccPropList() {}
diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h
index aec5fcc..ae7c7f9 100644
--- a/c++/src/H5FaccProp.h
+++ b/c++/src/H5FaccProp.h
@@ -27,121 +27,121 @@ namespace H5 {
*/
class H5_DLLCPP FileAccPropList : public PropList {
public:
- ///\brief Default file access property list.
- static const FileAccPropList& DEFAULT;
+ ///\brief Default file access property list.
+ static const FileAccPropList& DEFAULT;
- // Creates a file access property list.
- FileAccPropList();
+ // Creates a file access property list.
+ FileAccPropList();
- // Modifies this property list to use the H5FD_STDIO driver
- void setStdio() const;
+ // Modifies this property list to use the H5FD_STDIO driver
+ void setStdio() const;
- // Set file driver for this property list
- void setDriver(hid_t new_driver_id, const void *new_driver_info) const;
+ // Set file driver for this property list
+ void setDriver(hid_t new_driver_id, const void *new_driver_info) const;
- // Returns a low-level file driver identifier.
- hid_t getDriver() const;
+ // Returns a low-level file driver identifier.
+ hid_t getDriver() const;
- // Sets offset for family driver.
- void setFamilyOffset(hsize_t offset) const;
+ // Sets offset for family driver.
+ void setFamilyOffset(hsize_t offset) const;
- // Gets offset for family driver.
- hsize_t getFamilyOffset() const;
+ // Gets offset for family driver.
+ hsize_t getFamilyOffset() const;
- // Modifies this file access property list to use the sec2 driver.
- void setSec2() const;
+ // Modifies this file access property list to use the sec2 driver.
+ void setSec2() const;
- // Modifies this file access property list to use the H5FD_CORE
- // driver.
- void setCore (size_t increment, hbool_t backing_store) const;
+ // Modifies this file access property list to use the H5FD_CORE
+ // driver.
+ void setCore (size_t increment, hbool_t backing_store) const;
- // Queries H5FD_CORE driver properties.
- void getCore (size_t& increment, hbool_t& backing_store) const;
+ // Queries H5FD_CORE driver properties.
+ void getCore (size_t& increment, hbool_t& backing_store) const;
- // Sets this file access properties list to the family driver.
- void setFamily( hsize_t memb_size, const FileAccPropList& memb_plist ) const;
+ // Sets this file access properties list to the family driver.
+ void setFamily(hsize_t memb_size, const FileAccPropList& memb_plist) const;
- // Returns information about the family file access property list.
- void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const;
- FileAccPropList getFamily(hsize_t& memb_size) const;
+ // Returns information about the family file access property list.
+ void getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const;
+ FileAccPropList getFamily(hsize_t& memb_size) const;
- // Emulates the old split file driver,
- void setSplit(const FileAccPropList& meta_plist,
- const FileAccPropList& raw_plist,
- const char* meta_ext = ".meta",
- const char* raw_ext = ".raw" ) const;
- void setSplit(const FileAccPropList& meta_plist,
- const FileAccPropList& raw_plist,
- const H5std_string& meta_ext = ".meta",
- const H5std_string& raw_ext = ".raw") const;
+ // Emulates the old split file driver,
+ void setSplit(const FileAccPropList& meta_plist,
+ const FileAccPropList& raw_plist,
+ const char* meta_ext = ".meta",
+ const char* raw_ext = ".raw") const;
+ void setSplit(const FileAccPropList& meta_plist,
+ const FileAccPropList& raw_plist,
+ const H5std_string& meta_ext = ".meta",
+ const H5std_string& raw_ext = ".raw") const;
- // Sets the maximum size of the data sieve buffer.
- void setSieveBufSize(size_t bufsize) const;
+ // Sets the maximum size of the data sieve buffer.
+ void setSieveBufSize(size_t bufsize) const;
- // Returns the current settings for the data sieve buffer size
- // property
- size_t getSieveBufSize() const;
+ // Returns the current settings for the data sieve buffer size
+ // property
+ size_t getSieveBufSize() const;
- // Sets the minimum size of metadata block allocations.
- void setMetaBlockSize(hsize_t &block_size) const;
+ // Sets the minimum size of metadata block allocations.
+ void setMetaBlockSize(hsize_t &block_size) const;
- // Returns the current metadata block size setting.
- hsize_t getMetaBlockSize() const;
+ // Returns the current metadata block size setting.
+ hsize_t getMetaBlockSize() const;
- // Modifies this file access property list to use the logging driver.
- void setLog(const char *logfile, unsigned flags, size_t buf_size) const;
- void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const;
+ // Modifies this file access property list to use the logging driver.
+ void setLog(const char *logfile, unsigned flags, size_t buf_size) const;
+ void setLog(const H5std_string& logfile, unsigned flags, size_t buf_size) const;
- // Sets alignment properties of this file access property list
- void setAlignment( hsize_t threshold = 1, hsize_t alignment = 1 ) const;
+ // Sets alignment properties of this file access property list
+ void setAlignment(hsize_t threshold = 1, hsize_t alignment = 1) const;
- // Retrieves the current settings for alignment properties from
- // this property list.
- void getAlignment( hsize_t& threshold, hsize_t& alignment ) const;
+ // Retrieves the current settings for alignment properties from
+ // this property list.
+ void getAlignment(hsize_t& threshold, hsize_t& alignment) const;
- // Sets data type for multi driver.
- void setMultiType(H5FD_mem_t dtype) const;
+ // Sets data type for multi driver.
+ void setMultiType(H5FD_mem_t dtype) const;
- // Returns the data type property for MULTI driver.
- H5FD_mem_t getMultiType() const;
+ // Returns the data type property for MULTI driver.
+ H5FD_mem_t getMultiType() const;
- // Sets the meta data cache and raw data chunk cache parameters.
- void setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const;
+ // Sets the meta data cache and raw data chunk cache parameters.
+ void setCache(int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0) const;
- // Queries the meta data cache and raw data chunk cache parameters.
- void getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const;
+ // Queries the meta data cache and raw data chunk cache parameters.
+ 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) const;
+ // Sets the degree for the file close behavior.
+ void setFcloseDegree(H5F_close_degree_t degree) const;
- // Returns the degree for the file close behavior.
- H5F_close_degree_t getFcloseDegree() const;
+ // Returns the degree for the file close behavior.
+ H5F_close_degree_t getFcloseDegree() const;
- // Sets garbage collecting references flag.
- void setGcReferences( unsigned gc_ref = 0 ) const;
+ // Sets garbage collecting references flag.
+ void setGcReferences(unsigned gc_ref = 0) const;
- // Returns garbage collecting references setting.
- unsigned getGcReferences() const;
+ // Returns garbage collecting references setting.
+ unsigned getGcReferences() const;
- // Sets bounds on versions of library format to be used when creating
- // or writing objects.
- void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const;
+ // Sets bounds on versions of library format to be used when creating
+ // or writing objects.
+ void setLibverBounds(H5F_libver_t libver_low, H5F_libver_t libver_high) const;
- // Gets the current settings for the library version format bounds.
- void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const;
+ // Gets the current settings for the library version format bounds.
+ void getLibverBounds(H5F_libver_t& libver_low, H5F_libver_t& libver_high) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("FileAccPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("FileAccPropList"); }
- // Copy constructor: creates a copy of a FileAccPropList object.
- FileAccPropList( const FileAccPropList& original );
+ // Copy constructor: creates a copy of a FileAccPropList object.
+ FileAccPropList(const FileAccPropList& original);
- // Creates a copy of an existing file access property list
- // using the property list id.
- FileAccPropList (const hid_t plist_id);
+ // Creates a copy of an existing file access property list
+ // using the property list id.
+ FileAccPropList (const hid_t plist_id);
- // Noop destructor
- virtual ~FileAccPropList();
+ // Noop destructor
+ virtual ~FileAccPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp
index ed6064f..c490f26 100644
--- a/c++/src/H5FcreatProp.cpp
+++ b/c++/src/H5FcreatProp.cpp
@@ -33,7 +33,7 @@ FileCreatPropList* FileCreatPropList::DEFAULT_ = 0;
//--------------------------------------------------------------------------
// Function: FileCreatPropList::getConstant
-// Purpose: Creates a FileCreatPropList object representing the HDF5
+// Purpose Creates a FileCreatPropList object representing the HDF5
// constant H5P_FILE_ACCESS, pointed to by FileCreatPropList::DEFAULT_
// exception H5::PropListIException
// Description
@@ -62,7 +62,7 @@ FileCreatPropList* FileCreatPropList::getConstant()
//--------------------------------------------------------------------------
// Function: FileCreatPropList::deleteConstants
-// Purpose: Deletes the constant object that FileCreatPropList::DEFAULT_
+// Purpose Deletes the constant object that FileCreatPropList::DEFAULT_
// points to.
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
@@ -73,302 +73,302 @@ void FileCreatPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose Constant for default property
+// Purpose Constant for default property
//--------------------------------------------------------------------------
const FileCreatPropList& FileCreatPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: FileCreatPropList default constructor
-///\brief Default constructor: Creates a file create property list
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList default constructor
+///\brief Default constructor: Creates a file create property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {}
+FileCreatPropList::FileCreatPropList() : PropList(H5P_FILE_CREATE) {}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// FileCreatPropList object.
-///\param original - IN: FileCreatPropList instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// FileCreatPropList object.
+///\param original - IN: FileCreatPropList instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {}
+FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList( original ) {}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList overloaded constructor
-///\brief Creates a file creation property list using the id of an
-/// existing one.
-///\param plist_id - IN: FileCreatPropList id to use
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList overloaded constructor
+///\brief Creates a file creation property list using the id of an
+/// existing one.
+///\param plist_id - IN: FileCreatPropList id to use
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getVersion
-///\brief Retrieves version information for various parts of a file.
-///\param super - OUT: The file super block.
-///\param freelist - OUT: The global free list.
-///\param stab - OUT: The root symbol table entry.
-///\param shhdr - OUT: Shared object headers.
-///\exception H5::PropListIException
+// Function: FileCreatPropList::getVersion
+///\brief Retrieves version information for various parts of a file.
+///\param super - OUT: The file super block.
+///\param freelist - OUT: The global free list.
+///\param stab - OUT: The root symbol table entry.
+///\param shhdr - OUT: Shared object headers.
+///\exception H5::PropListIException
///\par Description
-/// Any (or even all) of the output arguments can be null pointers.
-// Programmer Binh-Minh Ribler - 2000
+/// Any (or even all) of the output arguments can be null pointers.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const
{
- herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::getVersion",
- "H5Pget_version failed");
- }
+ herr_t ret_value = H5Pget_version(id, &super, &freelist, &stab, &shhdr);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getVersion",
+ "H5Pget_version failed");
+ }
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setUserblock
-///\brief Sets the user block size field of this file creation property list.
-///\param size - IN: User block size to be set, in bytes
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setUserblock
+///\brief Sets the user block size field of this file creation property list.
+///\param size - IN: User block size to be set, in bytes
+///\exception H5::PropListIException
///\par Description
-/// The default user block size is 0; it may be set to any power
-/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
-// Programmer Binh-Minh Ribler - 2000
+/// The default user block size is 0; it may be set to any power
+/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setUserblock( hsize_t size ) const
+void FileCreatPropList::setUserblock(hsize_t size) const
{
- herr_t ret_value = H5Pset_userblock( id, size);
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::setUserblock",
- "H5Pset_userblock failed");
- }
+ herr_t ret_value = H5Pset_userblock(id, size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::setUserblock",
+ "H5Pset_userblock failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getUserblock
-///\brief Returns the user block size of this file creation property list.
-///\return User block size
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList::getUserblock
+///\brief Returns the user block size of this file creation property list.
+///\return User block size
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hsize_t FileCreatPropList::getUserblock() const
{
- hsize_t userblock_size;
- herr_t ret_value = H5Pget_userblock( id, &userblock_size );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::getUserblock",
- "H5Pget_userblock failed");
- }
- return( userblock_size );
+ hsize_t userblock_size;
+ herr_t ret_value = H5Pget_userblock(id, &userblock_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getUserblock",
+ "H5Pget_userblock failed");
+ }
+ return(userblock_size);
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setSizes
-///\brief Sets the byte size of the offsets and lengths used to
-/// address objects in an HDF5 file.
-///\param sizeof_addr - IN: Size of an object offset in bytes
-///\param sizeof_size - IN: Size of an object length in bytes.
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setSizes
+///\brief Sets the byte size of the offsets and lengths used to
+/// address objects in an HDF5 file.
+///\param sizeof_addr - IN: Size of an object offset in bytes
+///\param sizeof_size - IN: Size of an object length in bytes.
+///\exception H5::PropListIException
///\par Description
-/// For information on setting sizes, please refer to the
-/// C layer Reference Manual at:
+/// For information on setting sizes, please refer to the
+/// C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
+void FileCreatPropList::setSizes(size_t sizeof_addr, size_t sizeof_size) const
{
- herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::setSizes",
- "H5Pset_sizes failed");
- }
+ herr_t ret_value = H5Pset_sizes(id, sizeof_addr, sizeof_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::setSizes",
+ "H5Pset_sizes failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getSizes
-///\brief Retrieves the size of the offsets and lengths used in an
-/// HDF5 file.
+// Function: FileCreatPropList::getSizes
+///\brief Retrieves the size of the offsets and lengths used in an
+/// HDF5 file.
///
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const
+void FileCreatPropList::getSizes(size_t& sizeof_addr, size_t& sizeof_size) const
{
- herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::getSizes",
- "H5Pget_sizes failed");
- }
+ herr_t ret_value = H5Pget_sizes(id, &sizeof_addr, &sizeof_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getSizes",
+ "H5Pget_sizes failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setSymk
-///\brief Sets the size of parameters used to control the symbol table
-/// nodes.
-///\param ik - IN: Symbol table tree rank
-///\param lk - IN: Symbol table node size
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setSymk
+///\brief Sets the size of parameters used to control the symbol table
+/// nodes.
+///\param ik - IN: Symbol table tree rank
+///\param lk - IN: Symbol table node size
+///\exception H5::PropListIException
///\par Description
-/// For information, please see the C layer Reference Manual at:
+/// For information, please see the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
+void FileCreatPropList::setSymk(unsigned ik, unsigned lk) const
{
- herr_t ret_value = H5Pset_sym_k( id, ik, lk );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::setSymk",
- "H5Pset_sym_k failed");
- }
+ herr_t ret_value = H5Pset_sym_k(id, ik, lk);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::setSymk",
+ "H5Pset_sym_k failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getSymk
-///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
-/// the symbol table leaf node 1/2 size.
+// Function: FileCreatPropList::getSymk
+///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
+/// the symbol table leaf node 1/2 size.
///
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
-/// For information, please see
+/// For information, please see
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
+void FileCreatPropList::getSymk(unsigned& ik, unsigned& lk) const
{
- herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::getSymk",
- "H5Pget_sym_k failed");
- }
+ herr_t ret_value = H5Pget_sym_k(id, &ik, &lk);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getSymk",
+ "H5Pget_sym_k failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setIstorek
-///\brief Sets the size of the parameter used to control the B-trees
-/// for indexing chunked datasets.
-///\param ik - IN: 1/2 rank of chunked storage B-tree
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setIstorek
+///\brief Sets the size of the parameter used to control the B-trees
+/// for indexing chunked datasets.
+///\param ik - IN: 1/2 rank of chunked storage B-tree
+///\exception H5::PropListIException
///\par Description
-/// For information, please see the C layer Reference Manual at:
+/// For information, please see the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setIstorek( unsigned ik ) const
+void FileCreatPropList::setIstorek(unsigned ik) const
{
- herr_t ret_value = H5Pset_istore_k( id, ik );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::setIstorek",
- "H5Pset_istore_k failed");
- }
+ herr_t ret_value = H5Pset_istore_k(id, ik);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::setIstorek",
+ "H5Pset_istore_k failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getIstorek
-///\brief Returns the 1/2 rank of an indexed storage B-tree.
-///\return 1/2 rank of chunked storage B-tree
-///\exception H5::PropListIException
+// Function: FileCreatPropList::getIstorek
+///\brief Returns the 1/2 rank of an indexed storage B-tree.
+///\return 1/2 rank of chunked storage B-tree
+///\exception H5::PropListIException
///\par Description
-/// For information, please see
+/// For information, please see
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
unsigned FileCreatPropList::getIstorek() const
{
- unsigned ik;
- herr_t ret_value = H5Pget_istore_k( id, &ik );
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::getIstorek",
- "H5Pget_istore_k failed");
- }
- return( ik );
+ unsigned ik;
+ herr_t ret_value = H5Pget_istore_k(id, &ik);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getIstorek",
+ "H5Pget_istore_k failed");
+ }
+ return(ik);
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setFileSpace
-///\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 threshold - IN: Free-space section threshold. The library
-/// default is 1, which is to track all free-space sections.
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setFileSpace
+///\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 threshold - IN: Free-space section threshold. The library
+/// default is 1, which is to track all free-space sections.
+///\exception H5::PropListIException
///\par Description
-/// If the given strategy is zero, the property will not be
-/// 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:
+/// If the given strategy is zero, the property will not be
+/// 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
+// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
void FileCreatPropList::setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const
{
- herr_t ret_value = H5Pset_file_space(id, strategy, threshold);
- if( ret_value < 0 )
- {
- throw PropListIException("FileCreatPropList::setFileSpace",
- "H5Pset_file_space failed");
- }
+ herr_t ret_value = H5Pset_file_space(id, strategy, threshold);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::setFileSpace",
+ "H5Pset_file_space failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getFileSpaceStrategy
-///\brief Returns the strategy that the library uses in managing file space.
-///\return The strategy value
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - Feb, 2017
+// Function: FileCreatPropList::getFileSpaceStrategy
+///\brief Returns the strategy that the library uses in managing file space.
+///\return The strategy value
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
H5F_file_space_type_t FileCreatPropList::getFileSpaceStrategy() const
{
- H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL;
- herr_t ret_value = H5Pget_file_space(id, &strategy, NULL);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getFileSpaceStrategy",
- "H5Pget_file_space for strategy failed");
- }
- return(strategy);
+ H5F_file_space_type_t strategy = H5F_FILE_SPACE_ALL;
+ herr_t ret_value = H5Pget_file_space(id, &strategy, NULL);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getFileSpaceStrategy",
+ "H5Pget_file_space for 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
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - Feb, 2017
+// Function: FileCreatPropList::getFileSpaceThreshold
+///\brief Returns the threshold value that the library uses in tracking
+/// free space sections.
+///\return The threshold value
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
hsize_t FileCreatPropList::getFileSpaceThreshold() const
{
- hsize_t threshold = 0;
- herr_t ret_value = H5Pget_file_space(id, NULL, &threshold);
- if (ret_value < 0)
- {
- throw PropListIException("FileCreatPropList::getFileSpaceThreshold",
- "H5Pget_file_space for threshold failed");
- }
- return(threshold);
+ hsize_t threshold = 0;
+ herr_t ret_value = H5Pget_file_space(id, NULL, &threshold);
+ if (ret_value < 0)
+ {
+ throw PropListIException("FileCreatPropList::getFileSpaceThreshold",
+ "H5Pget_file_space for threshold failed");
+ }
+ return(threshold);
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileCreatPropList::~FileCreatPropList() {}
diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h
index cadff8b..1bbaabf 100644
--- a/c++/src/H5FcreatProp.h
+++ b/c++/src/H5FcreatProp.h
@@ -27,78 +27,78 @@ namespace H5 {
*/
class H5_DLLCPP FileCreatPropList : public PropList {
public:
- ///\brief Default file creation property list.
- static const FileCreatPropList& DEFAULT;
+ ///\brief Default file creation property list.
+ static const FileCreatPropList& DEFAULT;
- // Creates a file create property list.
- FileCreatPropList();
+ // Creates a file create property list.
+ FileCreatPropList();
#ifndef H5_NO_DEPRECATED_SYMBOLS
- // Retrieves version information for various parts of a file.
- void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const;
+ // Retrieves version information for various parts of a file.
+ void getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- // Sets the userblock size field of a file creation property list.
- void setUserblock( hsize_t size ) const;
+ // Sets the userblock size field of a file creation property list.
+ void setUserblock(hsize_t size) const;
- // Gets the size of a user block in this file creation property list.
- hsize_t getUserblock() const;
+ // Gets the size of a user block in this file creation property list.
+ hsize_t getUserblock() const;
- // Retrieves the size-of address and size quantities stored in a
- // file according to this file creation property list.
- void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
+ // Retrieves the size-of address and size quantities stored in a
+ // file according to this file creation property list.
+ void getSizes(size_t& sizeof_addr, size_t& sizeof_size) const;
- // Sets file size-of addresses and sizes.
- void setSizes( size_t sizeof_addr = 4, size_t sizeof_size = 4 ) const;
+ // Sets file size-of addresses and sizes.
+ void setSizes(size_t sizeof_addr = 4, size_t sizeof_size = 4) const;
- // Retrieves the size of the symbol table B-tree 1/2 rank and the
- // symbol table leaf node 1/2 size.
- void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const;
+ // Retrieves the size of the symbol table B-tree 1/2 rank and the
+ // symbol table leaf node 1/2 size.
+ void getSymk(unsigned& int_nodes_k, unsigned& leaf_nodes_k) const;
- // Sets the size of parameters used to control the symbol table nodes.
- void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const;
+ // Sets the size of parameters used to control the symbol table nodes.
+ void setSymk(unsigned int_nodes_k, unsigned leaf_nodes_k) const;
- // Returns the 1/2 rank of an indexed storage B-tree.
- unsigned getIstorek() const;
+ // Returns the 1/2 rank of an indexed storage B-tree.
+ unsigned getIstorek() const;
- // Sets the size of parameter used to control the B-trees for
- // indexing chunked datasets.
- void setIstorek( unsigned ik ) const;
+ // Sets the size of parameter used to control the B-trees for
+ // indexing chunked datasets.
+ void setIstorek(unsigned ik) const;
- // 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;
+ // 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;
- // Returns the strategy that the library uses in managing file space.
- H5F_file_space_type_t getFileSpaceStrategy() const;
+ // Returns the strategy that the library uses in managing file space.
+ H5F_file_space_type_t getFileSpaceStrategy() const;
- // Returns the threshold value that the library uses in tracking free
- // space sections.
- hsize_t getFileSpaceThreshold() const;
+ // Returns the threshold value that the library uses in tracking free
+ // space sections.
+ hsize_t getFileSpaceThreshold() const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("FileCreatPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass() const { return("FileCreatPropList"); }
- // Copy constructor: creates a copy of a FileCreatPropList object.
- FileCreatPropList(const FileCreatPropList& orig);
+ // Copy constructor: creates a copy of a FileCreatPropList object.
+ FileCreatPropList(const FileCreatPropList& orig);
- // Creates a copy of an existing file create property list
- // using the property list id.
- FileCreatPropList (const hid_t plist_id);
+ // Creates a copy of an existing file create property list
+ // using the property list id.
+ FileCreatPropList(const hid_t plist_id);
- // Noop destructor
- virtual ~FileCreatPropList();
+ // Noop destructor
+ virtual ~FileCreatPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Deletes the global constant, should only be used by the library
- static void deleteConstants();
+ // Deletes the global constant, should only be used by the library
+ static void deleteConstants();
private:
- static FileCreatPropList* DEFAULT_;
+ static FileCreatPropList* DEFAULT_;
- // Creates the global constant, should only be used by the library
- static FileCreatPropList* getConstant();
+ // Creates the global constant, should only be used by the library
+ static FileCreatPropList* getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp
index cd97025..cdb5837 100644
--- a/c++/src/H5File.cpp
+++ b/c++/src/H5File.cpp
@@ -46,43 +46,43 @@ namespace H5 {
//--------------------------------------------------------------------------
// Function H5File default constructor
-///\brief Default constructor: creates a stub H5File object.
-// Programmer Binh-Minh Ribler - 2000
+///\brief Default constructor: creates a stub H5File object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File() : Group(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief Creates or opens an HDF5 file depending on the parameter flags.
-///\param name - IN: Name of the file
-///\param flags - IN: File access flags
-///\param create_plist - IN: File creation property list, used when
-/// modifying default file meta-data. Default to
-/// FileCreatPropList::DEFAULT
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
+// Function: H5File overloaded constructor
+///\brief Creates or opens an HDF5 file depending on the parameter flags.
+///\param name - IN: Name of the file
+///\param flags - IN: File access flags
+///\param create_plist - IN: File creation property list, used when
+/// modifying default file meta-data. Default to
+/// FileCreatPropList::DEFAULT
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
///\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.
-/// \li \c H5F_ACC_EXCL - Fail if file already exists.
-/// \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
-/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
-/// exists, and fail, otherwise
+/// 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.
+/// \li \c H5F_ACC_EXCL - Fail if file already exists.
+/// \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
+/// \li \c H5F_ACC_RDWR - Open file for read/write, if it already
+/// 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:
+/// 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
-// Programmer Binh-Minh Ribler - 2000
+// 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)
+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);
@@ -92,22 +92,22 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c
}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief This is another overloaded constructor. It differs from the
-/// above constructor only in the type of the \a name argument.
-///\param name - IN: Name of the file - \c H5std_string
-///\param flags - IN: File access flags
-///\param create_plist - IN: File creation property list, used when
-/// modifying default file meta-data. Default to
-/// FileCreatPropList::DEFAULT
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
+// Function: H5File overloaded constructor
+///\brief This is another overloaded constructor. It differs from the
+/// above constructor only in the type of the \a name argument.
+///\param name - IN: Name of the file - \c H5std_string
+///\param flags - IN: File access flags
+///\param create_plist - IN: File creation property list, used when
+/// modifying default file meta-data. Default to
+/// 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
-// Programmer Binh-Minh Ribler - 2000
+// 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)
+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);
@@ -120,21 +120,21 @@ H5File::H5File( const H5std_string& name, unsigned int flags, const FileCreatPro
//--------------------------------------------------------------------------
// This function is private and contains common code between the
// constructors taking a string or a char*
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - removed H5F_ACC_CREAT because H5Fcreate will fail with
-// H5F_ACC_CREAT. - BMR, Sep 17, 2014
+// - removed H5F_ACC_CREAT because H5Fcreate will fail with
+// H5F_ACC_CREAT. - BMR, Sep 17, 2014
//--------------------------------------------------------------------------
void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist)
{
// These bits only set for creation, so if any of them are set,
// create the file.
- if( flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))
+ 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
+ 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");
}
@@ -143,8 +143,8 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
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
+ id = H5Fopen(name, flags, access_plist_id);
+ if (id < 0) // throw an exception when open/create fail
{
throw FileIException("H5File constructor", "H5Fopen failed");
}
@@ -152,17 +152,17 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro
}
//--------------------------------------------------------------------------
-// Function: H5File overloaded constructor
-///\brief Creates an H5File object using an existing file id.
-///\param existing_id - IN: Id of an existing file
-// Programmer Binh-Minh Ribler - 2015
+// Function: H5File overloaded constructor
+///\brief Creates an H5File object using an existing file id.
+///\param existing_id - IN: Id of an existing file
+// Programmer Binh-Minh Ribler - 2015
// Description
// 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
-// constructor is needed by the library in order to return
-// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
+// 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
+// constructor is needed by the library in order to return
+// an object, H5File doesn't need it. -BMR (HDFFV-8766 partially)
//--------------------------------------------------------------------------
H5File::H5File(hid_t existing_id) : Group()
{
@@ -173,11 +173,11 @@ H5File::H5File(hid_t existing_id) : Group()
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// H5File object.
-///\param original - IN: H5File instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// H5File object.
+///\param original - IN: H5File instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5File::H5File(const H5File& original) : Group()
{
@@ -186,57 +186,57 @@ H5File::H5File(const H5File& original) : Group()
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5 (static)
-///\brief Determines whether a file in HDF5 format. (Static)
-///\param name - IN: Name of the file
-///\return true if the file is in HDF5 format, and false, otherwise
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::isHdf5 (static)
+///\brief Determines whether a file in HDF5 format. (Static)
+///\param name - IN: Name of the file
+///\return true if the file is in HDF5 format, and false, otherwise
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5File::isHdf5(const char* name)
{
- // Calls C routine H5Fis_hdf5 to determine whether the file is in
- // HDF5 format. It returns positive value, 0, or negative value
- htri_t ret_value = H5Fis_hdf5( name );
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else // Raise exception when H5Fis_hdf5 returns a negative value
- {
- throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value");
- }
+ // Calls C routine H5Fis_hdf5 to determine whether the file is in
+ // HDF5 format. It returns positive value, 0, or negative value
+ htri_t ret_value = H5Fis_hdf5(name);
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else // Raise exception when H5Fis_hdf5 returns a negative value
+ {
+ throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::isHdf5 (static)
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes an \c H5std_string for \a name. (Static)
-///\param name - IN: Name of the file - \c H5std_string
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::isHdf5 (static)
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes an \c H5std_string for \a name. (Static)
+///\param name - IN: Name of the file - \c H5std_string
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-bool H5File::isHdf5(const H5std_string& name )
+bool H5File::isHdf5(const H5std_string& name)
{
- return( isHdf5( name.c_str()) );
+ return(isHdf5( name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: openFile
-///\brief Opens an HDF5 file
-///\param name - IN: Name of the file
-///\param flags - IN: File access flags
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
+// Function: openFile
+///\brief Opens an HDF5 file
+///\param name - IN: Name of the file
+///\param flags - IN: File access flags
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
///\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.
+/// 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.
///
-/// H5F_ACC_RDONLY: Open with read only access. - default
+/// H5F_ACC_RDONLY: Open with read only access. - default
///
-// Programmer Binh-Minh Ribler - Oct, 2005
+// Programmer Binh-Minh Ribler - Oct, 2005
//--------------------------------------------------------------------------
void H5File::openFile(const char* name, unsigned int flags, const FileAccPropList& access_plist)
{
@@ -256,14 +256,14 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis
}
//--------------------------------------------------------------------------
-// Function: H5File::openFile
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes an \c H5std_string for \a name.
-///\param name - IN: Name of the file - \c H5std_string
-///\param flags - IN: File access flags
-///\param access_plist - IN: File access property list. Default to
-/// FileAccPropList::DEFAULT
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::openFile
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes an \c H5std_string for \a name.
+///\param name - IN: Name of the file - \c H5std_string
+///\param flags - IN: File access flags
+///\param access_plist - IN: File access property list. Default to
+/// FileAccPropList::DEFAULT
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAccPropList& access_plist)
{
@@ -271,21 +271,21 @@ void H5File::openFile(const H5std_string& name, unsigned int flags, const FileAc
}
//--------------------------------------------------------------------------
-// Function: H5File::reOpen
-///\brief Reopens this file.
+// Function: H5File::reOpen
+///\brief Reopens this file.
///
-///\exception H5::FileIException
+///\exception H5::FileIException
// Description
-// If this object has represented another HDF5 file, the previous
-// HDF5 file need to be closed first.
-// Programmer Binh-Minh Ribler - 2000
+// If this object has represented another HDF5 file, the previous
+// HDF5 file need to be closed first.
+// Programmer Binh-Minh Ribler - 2000
// Note: This wrapper doesn't seem right regarding the 'id' and should
// be investigated. BMR - 2/20/2005
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Feb 20, 2005
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Feb 20, 2005
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
void H5File::reOpen()
{
@@ -296,148 +296,148 @@ void H5File::reOpen()
throw FileIException("H5File::reOpen", close_error.getDetailMsg());
}
- // call C routine to reopen the file - Note: not sure about this,
- // which id to be the parameter when closing?
- id = H5Freopen( id );
- if( id < 0 ) // Raise exception when H5Freopen returns a neg value
- throw FileIException("H5File::reOpen", "H5Freopen failed");
+ // call C routine to reopen the file - Note: not sure about this,
+ // which id to be the parameter when closing?
+ id = H5Freopen(id);
+ if (id < 0) // Raise exception when H5Freopen returns a neg value
+ throw FileIException("H5File::reOpen", "H5Freopen failed");
}
//--------------------------------------------------------------------------
-// Function: H5File::getCreatePlist
-///\brief Returns the creation property list of this file
-///\return FileCreatPropList object
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::getCreatePlist
+///\brief Returns the creation property list of this file
+///\return FileCreatPropList object
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileCreatPropList H5File::getCreatePlist() const
{
- hid_t create_plist_id = H5Fget_create_plist( id );
-
- // if H5Fget_create_plist returns a valid id, create and return
- // the FileCreatPropList object for this property list
- if( create_plist_id > 0 )
- {
- FileCreatPropList create_plist( create_plist_id );
- return( create_plist );
- }
- else
- {
- throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed");
- }
+ hid_t create_plist_id = H5Fget_create_plist(id);
+
+ // if H5Fget_create_plist returns a valid id, create and return
+ // the FileCreatPropList object for this property list
+ if (create_plist_id > 0)
+ {
+ FileCreatPropList create_plist(create_plist_id);
+ return(create_plist);
+ }
+ else
+ {
+ throw FileIException("H5File::getCreatePlist", "H5Fget_create_plist failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::getAccessPlist
-///\brief Returns the access property list of this file
-///\return FileAccPropList object
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File::getAccessPlist
+///\brief Returns the access property list of this file
+///\return FileAccPropList object
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList H5File::getAccessPlist() const
{
- hid_t access_plist_id = H5Fget_access_plist( id );
+ hid_t access_plist_id = H5Fget_access_plist(id);
- // if H5Fget_access_plist returns a valid id, create and return
- // the FileAccPropList object for this property list
- if( access_plist_id > 0 )
- {
- FileAccPropList access_plist( access_plist_id );
+ // if H5Fget_access_plist returns a valid id, create and return
+ // the FileAccPropList object for this property list
+ if (access_plist_id > 0)
+ {
+ FileAccPropList access_plist(access_plist_id);
return access_plist;
- }
- else // Raise an exception
- {
- throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed");
- }
+ }
+ else // Raise an exception
+ {
+ throw FileIException("H5File::getAccessPlist", "H5Fget_access_plist failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::getFileInfo
-///\brief Retrieves the general information of this file.
+// Function: H5File::getFileInfo
+///\brief Retrieves the general information of this file.
///
-///\exception H5::FileIException
+///\exception H5::FileIException
///\par Description
-/// The retrieved information may include information about
-/// superblock extension, free space management, and shared object
+/// The retrieved information may include information about
+/// superblock extension, free space management, and shared object
// Programmer Binh-Minh Ribler - February 2017
//--------------------------------------------------------------------------
void H5File::getFileInfo(H5F_info2_t& file_info) const
{
- herr_t ret_value = H5Fget_info2(id, &file_info);
- if (ret_value < 0)
- {
- throw FileIException("H5File::getFileInfo", "H5Fget_info2 failed");
- }
+ herr_t ret_value = H5Fget_info2(id, &file_info);
+ if (ret_value < 0)
+ {
+ throw FileIException("H5File::getFileInfo", "H5Fget_info2 failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::getFreeSpace
-///\brief Returns the amount of free space in the file.
-///\return Amount of free space
-///\exception H5::FileIException
+// Function: H5File::getFreeSpace
+///\brief Returns the amount of free space in the file.
+///\return Amount of free space
+///\exception H5::FileIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
hssize_t H5File::getFreeSpace() const
{
- hssize_t free_space = H5Fget_freespace(id);
- if( free_space < 0 )
- {
- throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed");
- }
- return (free_space);
+ hssize_t free_space = H5Fget_freespace(id);
+ if (free_space < 0)
+ {
+ throw FileIException("H5File::getFreeSpace", "H5Fget_freespace failed");
+ }
+ return (free_space);
}
//--------------------------------------------------------------------------
-// Function: H5File::getObjCount
-///\brief Returns the number of opened object IDs (files, datasets,
-/// groups and datatypes) in the same file.
-///\param types - Type of object to retrieve the count
-///\return Number of opened object IDs
-///\exception H5::FileIException
+// Function: H5File::getObjCount
+///\brief Returns the number of opened object IDs (files, datasets,
+/// groups and datatypes) in the same file.
+///\param types - Type of object to retrieve the count
+///\return Number of opened object IDs
+///\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_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
+/// 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_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
///\par
/// Multiple object types can be combined with the logical OR operator (|).
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ssize_t H5File::getObjCount(unsigned types) const
{
- ssize_t num_objs = H5Fget_obj_count(id, types);
- if( num_objs < 0 )
- {
- throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
- }
- return (num_objs);
+ ssize_t num_objs = H5Fget_obj_count(id, types);
+ if (num_objs < 0)
+ {
+ throw FileIException("H5File::getObjCount", "H5Fget_obj_count failed");
+ }
+ return (num_objs);
}
//--------------------------------------------------------------------------
-// Function: H5File::getObjIDs
-///\brief Retrieves a list of opened object IDs (files, datasets,
-/// 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.
-///\param oid_list - List of open object identifiers
-///\exception H5::FileIException
+// Function: H5File::getObjIDs
+///\brief Retrieves a list of opened object IDs (files, datasets,
+/// 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.
+///\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_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
+/// 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_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
///\par
/// Multiple object types can be combined with the logical OR operator (|).
//
@@ -446,56 +446,56 @@ ssize_t H5File::getObjCount(unsigned types) const
//--------------------------------------------------------------------------
void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const
{
- ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list);
- if( ret_value < 0 )
- {
- throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed");
- }
+ ssize_t ret_value = H5Fget_obj_ids(id, types, max_objs, oid_list);
+ if (ret_value < 0)
+ {
+ throw FileIException("H5File::getObjIDs", "H5Fget_obj_ids failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::getVFDHandle
-///\brief Returns the pointer to the file handle of the low-level file
-/// driver.
-///\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
+// Function: H5File::getVFDHandle
+///\brief Returns the pointer to the file handle of the low-level file
+/// driver.
+///\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
///\par Description
-/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
-/// defined through the property list functions:
-/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
-/// and \c FileAccPropList::setMultiType for the \c MULTI driver.
+/// For the \c FAMILY or \c MULTI drivers, \a fapl should be
+/// defined through the property list functions:
+/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver
+/// and \c FileAccPropList::setMultiType for the \c MULTI driver.
///
-/// The obtained file handle is dynamic and is valid only while
-/// the file remains open; it will be invalid if the file is
-/// closed and reopened or opened during a subsequent session.
+/// The obtained file handle is dynamic and is valid only while
+/// the file remains open; it will be invalid if the file is
+/// closed and reopened or opened during a subsequent session.
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
{
- hid_t fapl_id = fapl.getId();
- herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle);
- if( ret_value < 0 )
- {
- throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
- }
+ hid_t fapl_id = fapl.getId();
+ herr_t ret_value = H5Fget_vfd_handle(id, fapl_id, file_handle);
+ if (ret_value < 0)
+ {
+ throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
+ }
}
//--------------------------------------------------------------------------
-// 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.
+// 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
+// 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
+// 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
//{
@@ -503,103 +503,103 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const
//}
//--------------------------------------------------------------------------
-// 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.
-///\param file_handle - Pointer to the file handle being used by
-/// the low-level virtual file driver
-///\exception H5::FileIException
+// 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.
+///\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
//--------------------------------------------------------------------------
void H5File::getVFDHandle(void **file_handle) const
{
- herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle);
- if( ret_value < 0 )
- {
- throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
- }
+ herr_t ret_value = H5Fget_vfd_handle(id, H5P_DEFAULT, file_handle);
+ if (ret_value < 0)
+ {
+ throw FileIException("H5File::getVFDHandle", "H5Fget_vfd_handle failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5File::getFileSize
-///\brief Returns the file size of the HDF5 file.
-///\return File size
-///\exception H5::FileIException
+// Function: H5File::getFileSize
+///\brief Returns the file size of the HDF5 file.
+///\return File size
+///\exception H5::FileIException
///\par Description
-/// This function is called after an existing file is opened in
-/// order to learn the true size of the underlying file.
+/// This function is called after an existing file is opened in
+/// order to learn the true size of the underlying file.
// Programmer Raymond Lu - June 24, 2004
//--------------------------------------------------------------------------
hsize_t H5File::getFileSize() const
{
- hsize_t file_size;
- herr_t ret_value = H5Fget_filesize(id, &file_size);
- if (ret_value < 0)
- {
- throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
- }
- return (file_size);
+ hsize_t file_size;
+ herr_t ret_value = H5Fget_filesize(id, &file_size);
+ if (ret_value < 0)
+ {
+ throw FileIException("H5File::getFileSize", "H5Fget_filesize failed");
+ }
+ return (file_size);
}
//--------------------------------------------------------------------------
-// Function: H5File::getId
-///\brief Get the id of this file
-///\return File identifier
-// Modification:
+// Function: H5File::getId
+///\brief Get the id of this file
+///\return File identifier
+// Modification
// 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
-// IdComponent::getId now becomes pure virtual function.
-// Programmer Binh-Minh Ribler - May, 2008
+// 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
+// IdComponent::getId now becomes pure virtual function.
+// Programmer Binh-Minh Ribler - May, 2008
//--------------------------------------------------------------------------
hid_t H5File::getId() const
{
- return(id);
+ return(id);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File::reopen
-// Purpose: Reopens this file.
+// Function: H5File::reopen
+// Purpose Reopens this file.
// Exception H5::FileIException
// Description
-// This function is replaced by the above function reOpen.
-// Programmer Binh-Minh Ribler - 2000
+// This function is replaced by the above function reOpen.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::reopen()
{
- H5File::reOpen();
+ H5File::reOpen();
}
//--------------------------------------------------------------------------
-// Function: H5File::getLocId
-// Purpose: Get the id of this file
+// Function: H5File::getLocId
+// 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
+// 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
//--------------------------------------------------------------------------
hid_t H5File::getLocId() const
{
- return( getId() );
+ return(getId());
}
//--------------------------------------------------------------------------
-// Function: H5File::p_setId (protected)
-///\brief Sets the identifier of this object to a new value.
+// Function: H5File::p_setId (protected)
+///\brief Sets the identifier of this object to a new value.
///
-///\exception H5::IdComponentException when the attempt to close the HDF5
-/// object fails
-// Description:
-// The underlaying reference counting in the C library ensures
-// that the current valid id of this object is properly closed.
-// Then the object's id is reset to the new id.
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::IdComponentException when the attempt to close the HDF5
+/// object fails
+// Description
+// The underlaying reference counting in the C library ensures
+// that the current valid id of this object is properly closed.
+// Then the object's id is reset to the new id.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::p_setId(const hid_t new_id)
{
@@ -610,24 +610,24 @@ void H5File::p_setId(const hid_t new_id)
catch (Exception& E) {
throw FileIException("H5File::p_setId", E.getDetailMsg());
}
- // reset object's id to the given id
- id = new_id;
+ // reset object's id to the given id
+ id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5File::close
-///\brief Closes this HDF5 file.
+// Function: H5File::close
+///\brief Closes this HDF5 file.
///
-///\exception H5::FileIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::FileIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void H5File::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Fclose( id );
- if( ret_value < 0 )
+ herr_t ret_value = H5Fclose(id);
+ if (ret_value < 0)
{
throw FileIException("H5File::close", "H5Fclose failed");
}
@@ -637,34 +637,34 @@ void H5File::close()
}
//--------------------------------------------------------------------------
-// Function: H5File::throwException
-///\brief Throws file exception - initially implemented for CommonFG
-///\param func_name - Name of the function where failure occurs
-///\param msg - Message describing the failure
-///\exception H5::FileIException
+// Function: H5File::throwException
+///\brief Throws file exception - initially implemented for CommonFG
+///\param func_name - Name of the function where failure occurs
+///\param msg - Message describing the failure
+///\exception H5::FileIException
// Description
// 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.
-// Programmer Binh-Minh Ribler - 2000
+// proper exception can be thrown for file or group. The
+// "H5File::" will be inserted to indicate the function called is
+// an implementation of H5File.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5File::throwException(const H5std_string& func_name, const H5std_string& msg) const
{
- H5std_string full_name = func_name;
- full_name.insert(0, "H5File::");
- throw FileIException(full_name, msg);
+ H5std_string full_name = func_name;
+ full_name.insert(0, "H5File::");
+ throw FileIException(full_name, msg);
}
//--------------------------------------------------------------------------
-// Function: H5File destructor
-///\brief Properly terminates access to this file.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5File destructor
+///\brief Properly terminates access to this file.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Feb 20, 2005
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Feb 20, 2005
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
H5File::~H5File()
{
diff --git a/c++/src/H5File.h b/c++/src/H5File.h
index 495b4d0..5ac9118 100644
--- a/c++/src/H5File.h
+++ b/c++/src/H5File.h
@@ -28,100 +28,100 @@ namespace H5 {
*/
class H5_DLLCPP H5File : public Group {
public:
- // Creates or opens an HDF5 file.
- H5File( const char* name, unsigned int flags,
- const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
- const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
- H5File( const H5std_string& name, unsigned int flags,
- const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
- const FileAccPropList& access_plist = FileAccPropList::DEFAULT );
+ // Creates or opens an HDF5 file.
+ H5File(const char* name, unsigned int flags,
+ const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
+ const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
+ H5File(const H5std_string& name, unsigned int flags,
+ const FileCreatPropList& create_plist = FileCreatPropList::DEFAULT,
+ const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
- // Open the file
- void openFile(const H5std_string& name, unsigned int flags,
- const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
- void openFile(const char* name, unsigned int flags,
- const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
+ // Open the file
+ void openFile(const H5std_string& name, unsigned int flags,
+ const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
+ void openFile(const char* name, unsigned int flags,
+ const FileAccPropList& access_plist = FileAccPropList::DEFAULT);
- // Close this file.
- virtual void close();
+ // Close this file.
+ virtual void close();
- // Gets the access property list of this file.
- FileAccPropList getAccessPlist() const;
+ // Gets the access property list of this file.
+ FileAccPropList getAccessPlist() const;
- // Gets the creation property list of this file.
- FileCreatPropList getCreatePlist() const;
+ // Gets the creation property list of this file.
+ FileCreatPropList getCreatePlist() const;
- // Gets general information about this file.
- void getFileInfo(H5F_info2_t& file_info) const;
+ // Gets general information about this file.
+ void getFileInfo(H5F_info2_t& file_info) const;
- // Returns the amount of free space in the file.
- hssize_t getFreeSpace() const;
+ // Returns the amount of free space in the file.
+ hssize_t getFreeSpace() const;
- // Returns the number of opened object IDs (files, datasets, groups
- // and datatypes) in the same file.
- ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const;
+ // Returns the number of opened object IDs (files, datasets, groups
+ // and datatypes) in the same file.
+ ssize_t getObjCount(unsigned types = H5F_OBJ_ALL) const;
- // Retrieves a list of opened object IDs (files, datasets, groups
- // and datatypes) in the same file.
- void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const;
+ // Retrieves a list of opened object IDs (files, datasets, groups
+ // and datatypes) in the same file.
+ void getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const;
- // 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
+ // 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
- // Returns the file size of the HDF5 file.
- hsize_t getFileSize() const;
+ // Returns the file size of the HDF5 file.
+ hsize_t getFileSize() const;
- // Determines if a file, specified by its name, is in HDF5 format
- static bool isHdf5(const char* name );
- static bool isHdf5(const H5std_string& name );
+ // Determines if a file, specified by its name, is in HDF5 format
+ static bool isHdf5(const char* name);
+ static bool isHdf5(const H5std_string& name);
- // Reopens this file.
- void reOpen(); // added for better name
+ // Reopens this file.
+ void reOpen(); // added for better name
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- void reopen(); // obsolete in favor of reOpen()
+ void reopen(); // obsolete in favor of reOpen()
- // Creates an H5File using an existing file id. Not recommended
- // in applications.
- H5File(hid_t existing_id);
+ // Creates an H5File using an existing file id. Not recommended
+ // in applications.
+ H5File(hid_t existing_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("H5File"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("H5File"); }
- // Throw file exception.
- virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
+ // Throw file exception.
+ virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
- // for CommonFG to get the file id.
- virtual hid_t getLocId() const;
+ // for CommonFG to get the file id.
+ virtual hid_t getLocId() const;
- // Default constructor
- H5File();
+ // Default constructor
+ H5File();
- // Copy constructor: makes a copy of the original H5File object.
- H5File(const H5File& original);
+ // Copy constructor: makes a copy of the original H5File object.
+ H5File(const H5File& original);
- // Gets the HDF5 file id.
- virtual hid_t getId() const;
+ // Gets the HDF5 file id.
+ virtual hid_t getId() const;
- // H5File destructor.
- virtual ~H5File();
+ // H5File destructor.
+ virtual ~H5File();
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Sets the HDF5 file id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the HDF5 file id.
+ virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- hid_t id; // HDF5 file id
+ hid_t id; // HDF5 file id
- // This function is private and contains common code between the
- // 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 );
+ // This function is private and contains common code between the
+ // 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);
};
}
diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp
index 73e8072..5902cbe 100644
--- a/c++/src/H5FloatType.cpp
+++ b/c++/src/H5FloatType.cpp
@@ -36,73 +36,73 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: FloatType default constructor
-///\brief Default constructor: Creates a stub floating-point datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType default constructor
+///\brief Default constructor: Creates a stub floating-point datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType::FloatType() {}
//--------------------------------------------------------------------------
-// Function: FloatType overloaded constructor
-///\brief Creates a floating-point datatype using a predefined type.
-///\param pred_type - IN: Predefined datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType overloaded constructor
+///\brief Creates a floating-point datatype using a predefined type.
+///\param pred_type - IN: Predefined datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType( const PredType& pred_type ) : AtomType()
+FloatType::FloatType(const PredType& pred_type) : AtomType()
{
- // use DataType::copy to make a copy of this predefined type
- copy( pred_type );
+ // use DataType::copy to make a copy of this predefined type
+ copy(pred_type);
}
//--------------------------------------------------------------------------
-// Function: FloatType overloaded constructor
-///\brief Creates an FloatType object using the id of an existing
-/// datatype.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType overloaded constructor
+///\brief Creates an FloatType object using the id of an existing
+/// datatype.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType( const hid_t existing_id ) : AtomType( existing_id ) {}
+FloatType::FloatType(const hid_t existing_id) : AtomType( existing_id ) {}
//--------------------------------------------------------------------------
-// Function: FloatType copy constructor
-///\brief Copy constructor: makes a copy of the original FloatType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType copy constructor
+///\brief Copy constructor: makes a copy of the original FloatType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType( const FloatType& original ) : AtomType( original ){}
+FloatType::FloatType(const FloatType& original) : AtomType( original ){}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Gets the floating-point datatype of the specified dataset
-///\param dataset - IN: Dataset that this floating-point datatype
-/// associates with
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType overloaded constructor
+///\brief Gets the floating-point datatype of the specified dataset
+///\param dataset - IN: Dataset that this floating-point datatype
+/// associates with
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FloatType::FloatType( const DataSet& dataset ) : AtomType()
+FloatType::FloatType(const DataSet& dataset) : AtomType()
{
- // Calls C function H5Dget_type to get the id of the datatype
- id = H5Dget_type( dataset.getId() );
+ // Calls C function H5Dget_type to get the id of the datatype
+ id = H5Dget_type(dataset.getId());
- if( id < 0 )
- {
- throw DataSetIException("FloatType constructor", "H5Dget_type failed");
- }
+ if (id < 0)
+ {
+ throw DataSetIException("FloatType constructor", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Float type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openFloatType(const char*)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openFloatType(const char*)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
FloatType::FloatType(const H5Location& loc, const char *dtype_name) : AtomType()
{
@@ -110,213 +110,213 @@ 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 dtype_name - IN: Float type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openFloatType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openFloatType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : AtomType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: FloatType::getFields
-///\brief Retrieves floating point datatype bit field information.
-///\param spos - OUT: Retrieved floating-point sign bit
-///\param epos - OUT: Retrieved exponent bit-position
-///\param esize - OUT: Retrieved size of exponent, in bits
-///\param mpos - OUT: Retrieved mantissa bit-position
-///\param msize - OUT: Retrieved size of mantissa, in bits
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const
+// Function: FloatType::getFields
+///\brief Retrieves floating point datatype bit field information.
+///\param spos - OUT: Retrieved floating-point sign bit
+///\param epos - OUT: Retrieved exponent bit-position
+///\param esize - OUT: Retrieved size of exponent, in bits
+///\param mpos - OUT: Retrieved mantissa bit-position
+///\param msize - OUT: Retrieved size of mantissa, in bits
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void FloatType::getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const
{
- herr_t ret_value = H5Tget_fields( id, &spos, &epos, &esize, &mpos, &msize );
- if( ret_value < 0 )
- {
- throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed");
- }
+ herr_t ret_value = H5Tget_fields(id, &spos, &epos, &esize, &mpos, &msize);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("FloatType::getFields", "H5Tget_fields failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FloatType::setFields
-///\brief Sets locations and sizes of floating point bit fields.
-///\param spos - OUT: Sign position, i.e., the bit offset of the
-/// floating-point sign bit.
-///\param epos - OUT: Exponent bit position
-///\param esize - OUT: Size of exponent, in bits
-///\param mpos - OUT: Mantissa bit-position
-///\param msize - OUT: Size of mantissa, in bits
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const
+// Function: FloatType::setFields
+///\brief Sets locations and sizes of floating point bit fields.
+///\param spos - OUT: Sign position, i.e., the bit offset of the
+/// floating-point sign bit.
+///\param epos - OUT: Exponent bit position
+///\param esize - OUT: Size of exponent, in bits
+///\param mpos - OUT: Mantissa bit-position
+///\param msize - OUT: Size of mantissa, in bits
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+void FloatType::setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const
{
- herr_t ret_value = H5Tset_fields( id, spos, epos, esize, mpos, msize );
- if( ret_value < 0 )
- {
- throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed");
- }
+ herr_t ret_value = H5Tset_fields(id, spos, epos, esize, mpos, msize);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("FloatType::setFields", "H5Tset_fields failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FloatType::getEbias
-///\brief Retrieves the exponent bias of a floating-point type.
-///\return Exponent bias
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType::getEbias
+///\brief Retrieves the exponent bias of a floating-point type.
+///\return Exponent bias
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
size_t FloatType::getEbias() const
{
- size_t ebias = H5Tget_ebias( id );
- // Returns the bias if successful
- if( ebias == 0 )
- {
- throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0");
- }
- return( ebias );
+ size_t ebias = H5Tget_ebias(id);
+ // Returns the bias if successful
+ if (ebias == 0)
+ {
+ throw DataTypeIException("FloatType::getEbias", "H5Tget_ebias failed - returned exponent bias as 0");
+ }
+ return(ebias);
}
//--------------------------------------------------------------------------
-// Function: FloatType::setEbias
-///\brief Sets the exponent bias of a floating-point type.
-///\param ebias - Exponent bias value
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType::setEbias
+///\brief Sets the exponent bias of a floating-point type.
+///\param ebias - Exponent bias value
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FloatType::setEbias( size_t ebias ) const
+void FloatType::setEbias(size_t ebias) const
{
- herr_t ret_value = H5Tset_ebias( id, ebias );
- if( ret_value < 0 )
- {
- throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed");
- }
+ herr_t ret_value = H5Tset_ebias(id, ebias);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("FloatType::setEbias", "H5Tset_ebias failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FloatType::getNorm
-///\brief Retrieves mantissa normalization of a floating-point datatype.
-///\param norm_string - OUT: Text string of the normalization type
-///\return Valid normalization type, which can be:
-/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
-/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
-/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
-///\exception H5::DataTypeIException
+// Function: FloatType::getNorm
+///\brief Retrieves mantissa normalization of a floating-point datatype.
+///\param norm_string - OUT: Text string of the normalization type
+///\return Valid normalization type, which can be:
+/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
+/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
+/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
+///\exception H5::DataTypeIException
///\par Description
-/// For your convenience, this function also provides the text
-/// string of the returned normalization type, via parameter
-/// \a norm_string.
-// Programmer Binh-Minh Ribler - 2000
+/// For your convenience, this function also provides the text
+/// string of the returned normalization type, via parameter
+/// \a norm_string.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_norm_t FloatType::getNorm( H5std_string& norm_string ) const
+H5T_norm_t FloatType::getNorm(H5std_string& norm_string) const
{
- H5T_norm_t norm = H5Tget_norm( id ); // C routine
- // Returns a valid normalization type if successful
- if( norm == H5T_NORM_ERROR )
- {
- throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR");
- }
- if( norm == H5T_NORM_IMPLIED )
- norm_string = "H5T_NORM_IMPLIED (0)";
- else if( norm == H5T_NORM_MSBSET )
- norm_string = "H5T_NORM_MSBSET (1)";
- else if( norm == H5T_NORM_NONE )
- norm_string = "H5T_NORM_NONE (2)";
- return( norm );
+ H5T_norm_t norm = H5Tget_norm(id); // C routine
+ // Returns a valid normalization type if successful
+ if (norm == H5T_NORM_ERROR)
+ {
+ throw DataTypeIException("FloatType::getNorm", "H5Tget_norm failed - returned H5T_NORM_ERROR");
+ }
+ if (norm == H5T_NORM_IMPLIED)
+ norm_string = "H5T_NORM_IMPLIED (0)";
+ else if (norm == H5T_NORM_MSBSET)
+ norm_string = "H5T_NORM_MSBSET (1)";
+ else if (norm == H5T_NORM_NONE)
+ norm_string = "H5T_NORM_NONE (2)";
+ return(norm);
}
//--------------------------------------------------------------------------
-// Function: FloatType::setNorm
-///\brief Sets the mantissa normalization of a floating-point datatype.
-///\param norm - IN: Mantissa normalization type
-///\exception H5::DataTypeIException
+// Function: FloatType::setNorm
+///\brief Sets the mantissa normalization of a floating-point datatype.
+///\param norm - IN: Mantissa normalization type
+///\exception H5::DataTypeIException
///\par Description
-/// Valid values for normalization type include:
-/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
-/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
-/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for normalization type include:
+/// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored
+/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1
+/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FloatType::setNorm( H5T_norm_t norm ) const
+void FloatType::setNorm(H5T_norm_t norm) const
{
- herr_t ret_value = H5Tset_norm( id, norm );
- if( ret_value < 0 )
- {
- throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed");
- }
+ herr_t ret_value = H5Tset_norm(id, norm);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("FloatType::setNorm", "H5Tset_norm failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FloatType::getInpad
-///\brief Retrieves the internal padding type for unused bits in
-/// this floating-point datatypes.
-///\return Internal padding type, which can be:
-/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
-/// \li \c H5T_PAD_ONE (1) - Set background to ones
-/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
-///\exception H5::DataTypeIException
+// Function: FloatType::getInpad
+///\brief Retrieves the internal padding type for unused bits in
+/// this floating-point datatypes.
+///\return Internal padding type, which can be:
+/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
+/// \li \c H5T_PAD_ONE (1) - Set background to ones
+/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
+///\exception H5::DataTypeIException
///\par Description
-/// For your convenience, this function also provides the text
-/// string of the returned internal padding type, via parameter
-/// \a pad_string.
-// Programmer Binh-Minh Ribler - 2000
+/// For your convenience, this function also provides the text
+/// string of the returned internal padding type, via parameter
+/// \a pad_string.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_pad_t FloatType::getInpad( H5std_string& pad_string ) const
+H5T_pad_t FloatType::getInpad(H5std_string& pad_string) const
{
- H5T_pad_t pad_type = H5Tget_inpad( id );
- // Returns a valid padding type if successful
- if( pad_type == H5T_PAD_ERROR )
- {
- throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR");
- }
- if( pad_type == H5T_PAD_ZERO )
- pad_string = "H5T_PAD_ZERO (0)";
- else if( pad_type == H5T_PAD_ONE )
- pad_string = "H5T_PAD_ONE (1)";
- else if( pad_type == H5T_PAD_BACKGROUND )
- pad_string = "H5T_PAD_BACKGROUD (2)";
- return( pad_type );
+ H5T_pad_t pad_type = H5Tget_inpad(id);
+ // Returns a valid padding type if successful
+ if (pad_type == H5T_PAD_ERROR)
+ {
+ throw DataTypeIException("FloatType::getInpad", "H5Tget_inpad failed - returned H5T_PAD_ERROR");
+ }
+ if (pad_type == H5T_PAD_ZERO)
+ pad_string = "H5T_PAD_ZERO (0)";
+ else if (pad_type == H5T_PAD_ONE)
+ pad_string = "H5T_PAD_ONE (1)";
+ else if (pad_type == H5T_PAD_BACKGROUND)
+ pad_string = "H5T_PAD_BACKGROUD (2)";
+ return(pad_type);
}
//--------------------------------------------------------------------------
-// Function: FloatType::setInpad
-///\brief Fills unused internal floating point bits.
-///\param inpad - IN: Internal padding type
-///\exception H5::DataTypeIException
+// Function: FloatType::setInpad
+///\brief Fills unused internal floating point bits.
+///\param inpad - IN: Internal padding type
+///\exception H5::DataTypeIException
///\par Description
-/// If any internal bits of a floating point type are unused
-/// (that is, those significant bits which are not part of the
-/// sign, exponent, or mantissa), then they will be filled
-/// according to the padding value provided by \a inpad.
+/// If any internal bits of a floating point type are unused
+/// (that is, those significant bits which are not part of the
+/// sign, exponent, or mantissa), then they will be filled
+/// according to the padding value provided by \a inpad.
///\par
-/// Valid values for normalization type include:
-/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
-/// \li \c H5T_PAD_ONE (1) - Set background to ones
-/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
-// Programmer Binh-Minh Ribler - 2000
+/// Valid values for normalization type include:
+/// \li \c H5T_PAD_ZERO (0) - Set background to zeros
+/// \li \c H5T_PAD_ONE (1) - Set background to ones
+/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FloatType::setInpad( H5T_pad_t inpad ) const
+void FloatType::setInpad(H5T_pad_t inpad) const
{
- herr_t ret_value = H5Tset_inpad( id, inpad );
- if( ret_value < 0 )
- {
- throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed");
- }
+ herr_t ret_value = H5Tset_inpad(id, inpad);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("FloatType::setInpad", "H5Tset_inpad failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: FloatType destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: FloatType destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FloatType::~FloatType() {}
diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h
index 1f4b227..2c925de 100644
--- a/c++/src/H5FloatType.h
+++ b/c++/src/H5FloatType.h
@@ -27,54 +27,54 @@ namespace H5 {
*/
class H5_DLLCPP FloatType : public AtomType {
public:
- // Creates a floating-point type using a predefined type.
- FloatType( const PredType& pred_type );
+ // Creates a floating-point type using a predefined type.
+ FloatType(const PredType& pred_type);
- // Gets the floating-point datatype of the specified dataset.
- FloatType( const DataSet& dataset );
+ // Gets the floating-point datatype of the specified dataset.
+ FloatType(const DataSet& dataset);
- // Constructors that open an HDF5 float datatype, given a location.
- FloatType(const H5Location& loc, const char* name);
- FloatType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open an HDF5 float datatype, given a location.
+ FloatType(const H5Location& loc, const char* name);
+ FloatType(const H5Location& loc, const H5std_string& name);
- // Retrieves the exponent bias of a floating-point type.
- size_t getEbias() const;
+ // Retrieves the exponent bias of a floating-point type.
+ size_t getEbias() const;
- // Sets the exponent bias of a floating-point type.
- void setEbias( size_t ebias ) const;
+ // Sets the exponent bias of a floating-point type.
+ void setEbias(size_t ebias) const;
- // Retrieves floating point datatype bit field information.
- void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const;
+ // Retrieves floating point datatype bit field information.
+ void getFields(size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize) const;
- // Sets locations and sizes of floating point bit fields.
- void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const;
+ // Sets locations and sizes of floating point bit fields.
+ void setFields(size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize) const;
- // Retrieves the internal padding type for unused bits in floating-point datatypes.
- H5T_pad_t getInpad( H5std_string& pad_string ) const;
+ // Retrieves the internal padding type for unused bits in floating-point datatypes.
+ H5T_pad_t getInpad(H5std_string& pad_string) const;
- // Fills unused internal floating point bits.
- void setInpad( H5T_pad_t inpad ) const;
+ // Fills unused internal floating point bits.
+ void setInpad(H5T_pad_t inpad) const;
- // Retrieves mantissa normalization of a floating-point datatype.
- H5T_norm_t getNorm( H5std_string& norm_string ) const;
+ // Retrieves mantissa normalization of a floating-point datatype.
+ H5T_norm_t getNorm(H5std_string& norm_string) const;
- // Sets the mantissa normalization of a floating-point datatype.
- void setNorm( H5T_norm_t norm ) const;
+ // Sets the mantissa normalization of a floating-point datatype.
+ void setNorm(H5T_norm_t norm) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("FloatType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("FloatType"); }
- // Default constructor
- FloatType();
+ // Default constructor
+ FloatType();
- // Creates a floating-point datatype using an existing id.
- FloatType( const hid_t existing_id );
+ // Creates a floating-point datatype using an existing id.
+ FloatType(const hid_t existing_id);
- // Copy constructor: makes a copy of the original FloatType object.
- FloatType( const FloatType& original );
+ // Copy constructor: makes a copy of the original FloatType object.
+ FloatType(const FloatType& original);
- // Noop destructor.
- virtual ~FloatType();
+ // Noop destructor.
+ virtual ~FloatType();
};
}
#endif // __H5FloatType_H
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index c976b00..6b143b5 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -46,17 +46,17 @@ namespace H5 {
using std::endl;
//--------------------------------------------------------------------------
-// Function: Group default constructor
-///\brief Default constructor: creates a stub Group.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Group default constructor
+///\brief Default constructor: creates a stub Group.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group() : H5Object(), CommonFG(), id(H5I_INVALID_HID) {}
//--------------------------------------------------------------------------
-// Function: Group copy constructor
-///\brief Copy constructor: makes a copy of the original Group object.
-///\param original - IN: Original group to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: Group copy constructor
+///\brief Copy constructor: makes a copy of the original Group object.
+///\param original - IN: Original group to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id)
{
@@ -64,26 +64,26 @@ Group::Group(const Group& original) : H5Object(), CommonFG(), id(original.id)
}
//--------------------------------------------------------------------------
-// Function: Group::getLocId
+// Function: Group::getLocId
// Purpose: Get the id of this group
-// Programmer Binh-Minh Ribler - 2000
+// 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.
+// 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
//--------------------------------------------------------------------------
hid_t Group::getLocId() const
{
- return( getId() );
+ return(getId());
}
//--------------------------------------------------------------------------
-// Function: Group overloaded constructor
-///\brief Creates a Group object using the id of an existing group.
-///\param existing_id - IN: Id of an existing group
-// Programmer Binh-Minh Ribler - 2000
+// Function: Group overloaded constructor
+///\brief Creates a Group object using the id of an existing group.
+///\param existing_id - IN: Id of an existing group
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id)
{
@@ -91,17 +91,17 @@ Group::Group(const hid_t existing_id) : H5Object(), CommonFG(), id(existing_id)
}
//--------------------------------------------------------------------------
-// Function: Group overload constructor - dereference
-///\brief Given a reference, ref, to an hdf5 group, creates a Group object
-///\param loc - IN: Specifying location 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
+// Function: Group overload constructor - dereference
+///\brief Given a reference, ref, to an hdf5 group, creates a Group object
+///\param loc - IN: Specifying location 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
///\par Description
-/// \c obj can be DataSet, Group, or named DataType, that
-/// is a datatype that has been named by DataType::commit.
-// Programmer Binh-Minh Ribler - Oct, 2006
+/// \c obj can be DataSet, Group, or named DataType, that
+/// is a datatype that has been named by DataType::commit.
+// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), CommonFG(), id(H5I_INVALID_HID)
{
@@ -109,14 +109,14 @@ 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
-// Programmer Binh-Minh Ribler - Oct, 2006
+// 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
+// Programmer Binh-Minh Ribler - Oct, 2006
//--------------------------------------------------------------------------
/* Group::Group(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist) : H5Object(), id(H5I_INVALID_HID)
{
@@ -126,19 +126,19 @@ Group::Group(const H5Location& loc, const void* ref, H5R_type_t ref_type, const
//--------------------------------------------------------------------------
// Function: Group::getId
-///\brief Get the id of this group
-///\return Group identifier
+///\brief Get the id of this group
+///\return Group identifier
// Modification:
// 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
-// IdComponent::getId now becomes pure virtual function.
+// 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
+// IdComponent::getId now becomes pure virtual function.
// Programmer Binh-Minh Ribler - May, 2008
//--------------------------------------------------------------------------
hid_t Group::getId() const
{
- return(id);
+ return(id);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -147,11 +147,11 @@ hid_t Group::getId() const
///\brief Sets the identifier of this object to a new value.
///
///\exception H5::IdComponentException when the attempt to close the HDF5
-/// object fails
+/// object fails
// Description:
-// The underlaying reference counting in the C library ensures
-// that the current valid id of this object is properly closed.
-// Then the object's id is reset to the new id.
+// The underlaying reference counting in the C library ensures
+// that the current valid id of this object is properly closed.
+// Then the object's id is reset to the new id.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Group::p_setId(const hid_t new_id)
@@ -163,24 +163,24 @@ void Group::p_setId(const hid_t new_id)
catch (Exception& close_error) {
throwException("Group::p_setId", close_error.getDetailMsg());
}
- // reset object's id to the given id
- id = new_id;
+ // reset object's id to the given id
+ id = new_id;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: Group::close
-///\brief Closes this group.
+// Function: Group::close
+///\brief Closes this group.
///
-///\exception H5::GroupIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::GroupIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void Group::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Gclose( id );
- if( ret_value < 0 )
+ herr_t ret_value = H5Gclose(id);
+ if (ret_value < 0)
{
throwException("Group::close", "H5Gclose failed");
}
@@ -190,34 +190,34 @@ void Group::close()
}
//--------------------------------------------------------------------------
-// Function: Group::throwException
-///\brief Throws H5::GroupIException.
-///\param func_name - Name of the function where failure occurs
-///\param msg - Message describing the failure
-///\exception H5::GroupIException
+// Function: Group::throwException
+///\brief Throws H5::GroupIException.
+///\param func_name - Name of the function where failure occurs
+///\param msg - Message describing the failure
+///\exception H5::GroupIException
// Description
-// This function is also used in H5Location's methods so that
-// proper exception can be thrown for file or group. The
-// "Group::" will be inserted to indicate the function called is
-// an implementation of Group.
-// Programmer Binh-Minh Ribler - 2000
+// This function is also used in H5Location's methods so that
+// proper exception can be thrown for file or group. The
+// "Group::" will be inserted to indicate the function called is
+// an implementation of Group.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void Group::throwException(const H5std_string& func_name, const H5std_string& msg) const
{
- H5std_string full_name = func_name;
- full_name.insert(0, "Group::");
- throw GroupIException(full_name, msg);
+ H5std_string full_name = func_name;
+ full_name.insert(0, "Group::");
+ throw GroupIException(full_name, msg);
}
//--------------------------------------------------------------------------
-// Function: Group destructor
-///\brief Properly terminates access to this group.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Group destructor
+///\brief Properly terminates access to this group.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Feb 20, 2005
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Feb 20, 2005
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
Group::~Group()
{
diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h
index 0a9e975..96dc5c1 100644
--- a/c++/src/H5Group.h
+++ b/c++/src/H5Group.h
@@ -30,53 +30,53 @@ class VarLenType;
class H5_DLLCPP Group : public H5Object, public CommonFG {
public:
- // Group constructor to create a group or file (aka root group).
- Group(const char* name, size_t size_hint = 0);
- Group(const H5std_string& name, size_t size_hint = 0);
+ // Group constructor to create a group or file (aka root group).
+ Group(const char* name, size_t size_hint = 0);
+ Group(const H5std_string& name, size_t size_hint = 0);
- // Group constructor to open a group or file (aka root group).
- Group(const char* name);
- Group(const H5std_string& name);
+ // Group constructor to open a group or file (aka root group).
+ Group(const char* name);
+ Group(const H5std_string& name);
- // Close this group.
- virtual void close();
+ // Close this group.
+ virtual void close();
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("Group"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("Group"); }
- // Throw group exception.
- virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
+ // Throw group exception.
+ virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
- // for CommonFG to get the file id.
- virtual hid_t getLocId() const;
+ // for CommonFG to get the file id.
+ virtual hid_t getLocId() const;
- // 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);
+ // 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);
// Group(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT);
- // default constructor
- Group();
+ // default constructor
+ Group();
- // Copy constructor: makes a copy of the original object
- Group(const Group& original);
+ // Copy constructor: makes a copy of the original object
+ Group(const Group& original);
- // Gets the group id.
- virtual hid_t getId() const;
+ // Gets the group id.
+ virtual hid_t getId() const;
- // Destructor
- virtual ~Group();
+ // Destructor
+ virtual ~Group();
- // Creates a copy of an existing group using its id.
- Group( const hid_t group_id );
+ // Creates a copy of an existing group using its id.
+ Group(const hid_t group_id);
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Sets the group id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the group id.
+ virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
private:
- hid_t id; // HDF5 group id
+ hid_t id; // HDF5 group id
};
}
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index ae60c5e..574b28a 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -15,7 +15,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5Library.h"
@@ -34,21 +34,21 @@ bool IdComponent::H5cppinit = false;
bool IdComponent::H5dontAtexit_called = false;
//--------------------------------------------------------------------------
-// Function: IdComponent::incRefCount
-///\brief Increment reference counter for a given id.
-// Programmer Binh-Minh Ribler - May 2005
+// Function: IdComponent::incRefCount
+///\brief Increment reference counter for a given id.
+// Programmer Binh-Minh Ribler - May 2005
//--------------------------------------------------------------------------
void IdComponent::incRefCount(const hid_t obj_id) const
{
if (p_valid_id(obj_id))
- if (H5Iinc_ref(obj_id) < 0)
- throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed");
+ if (H5Iinc_ref(obj_id) < 0)
+ throw IdComponentException(inMemFunc("incRefCount"), "incrementing object ref count failed");
}
//--------------------------------------------------------------------------
-// Function: IdComponent::incRefCount
-///\brief Increment reference counter for the id of this object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IdComponent::incRefCount
+///\brief Increment reference counter for the id of this object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void IdComponent::incRefCount() const
{
@@ -56,31 +56,31 @@ void IdComponent::incRefCount() const
}
//--------------------------------------------------------------------------
-// Function: IdComponent::decRefCount
-///\brief Decrement reference counter for a given id.
-// Programmer Binh-Minh Ribler - May 2005
+// Function: IdComponent::decRefCount
+///\brief Decrement reference counter for a given id.
+// Programmer Binh-Minh Ribler - May 2005
// Modification:
-// Added the check for ref counter to give a little more info
-// on why H5Idec_ref fails in some cases - BMR 5/19/2005
+// Added the check for ref counter to give a little more info
+// on why H5Idec_ref fails in some cases - BMR 5/19/2005
//--------------------------------------------------------------------------
void IdComponent::decRefCount(const hid_t obj_id) const
{
if (p_valid_id(obj_id))
- if (H5Idec_ref(obj_id) < 0)
- {
- if (H5Iget_ref(obj_id) <= 0)
- throw IdComponentException(inMemFunc("decRefCount"),
- "object ref count is 0 or negative");
- else
- throw IdComponentException(inMemFunc("decRefCount"),
- "decrementing object ref count failed");
- }
+ if (H5Idec_ref(obj_id) < 0)
+ {
+ if (H5Iget_ref(obj_id) <= 0)
+ throw IdComponentException(inMemFunc("decRefCount"),
+ "object ref count is 0 or negative");
+ else
+ throw IdComponentException(inMemFunc("decRefCount"),
+ "decrementing object ref count failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: IdComponent::decRefCount
-///\brief Decrement reference counter for the id of this object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IdComponent::decRefCount
+///\brief Decrement reference counter for the id of this object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void IdComponent::decRefCount() const
{
@@ -88,28 +88,28 @@ void IdComponent::decRefCount() const
}
//--------------------------------------------------------------------------
-// Function: IdComponent::getCounter
-///\brief Returns the reference counter for a given id.
-///\return Reference count
-// Programmer Binh-Minh Ribler - May 2005
+// Function: IdComponent::getCounter
+///\brief Returns the reference counter for a given id.
+///\return Reference count
+// Programmer Binh-Minh Ribler - May 2005
//--------------------------------------------------------------------------
int IdComponent::getCounter(const hid_t obj_id) const
{
int counter = 0;
if (p_valid_id(obj_id))
{
- counter = H5Iget_ref(obj_id);
- if (counter < 0)
- throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative");
+ counter = H5Iget_ref(obj_id);
+ if (counter < 0)
+ throw IdComponentException(inMemFunc("incRefCount"), "getting object ref count failed - negative");
}
return (counter);
}
//--------------------------------------------------------------------------
-// Function: IdComponent::getCounter
-///\brief Returns the reference counter for the id of this object.
-///\return Reference count
-// Programmer Binh-Minh Ribler - 2000
+// Function: IdComponent::getCounter
+///\brief Returns the reference counter for the id of this object.
+///\return Reference count
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int IdComponent::getCounter() const
{
@@ -117,43 +117,43 @@ int IdComponent::getCounter() const
}
//--------------------------------------------------------------------------
-// Function: getHDFObjType (static)
-///\brief Given an id, returns the type of the object.
-///\return a valid HDF object type, which may be one of the following:
-/// \li \c H5I_FILE
-/// \li \c H5I_GROUP
-/// \li \c H5I_DATATYPE
-/// \li \c H5I_DATASPACE
-/// \li \c H5I_DATASET
-/// \li \c H5I_ATTR
-/// \li or \c H5I_BADID, if no valid type can be determined or the
-/// input object id is invalid.
+// Function: getHDFObjType (static)
+///\brief Given an id, returns the type of the object.
+///\return a valid HDF object type, which may be one of the following:
+/// \li \c H5I_FILE
+/// \li \c H5I_GROUP
+/// \li \c H5I_DATATYPE
+/// \li \c H5I_DATASPACE
+/// \li \c H5I_DATASET
+/// \li \c H5I_ATTR
+/// \li or \c H5I_BADID, if no valid type can be determined or the
+/// input object id is invalid.
// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id)
{
if (obj_id <= 0)
- return H5I_BADID; // invalid
+ return H5I_BADID; // invalid
H5I_type_t id_type = H5Iget_type(obj_id);
if (id_type <= H5I_BADID || id_type >= H5I_NTYPES)
- return H5I_BADID; // invalid
+ return H5I_BADID; // invalid
else
- return id_type; // valid type
+ return id_type; // valid type
}
//--------------------------------------------------------------------------
-// Function: getHDFObjType
-///\brief Returns the type of the object. It is an overloaded function
-/// of the above function.
-///\return a valid HDF object type, which may be one of the following:
-/// \li \c H5I_FILE
-/// \li \c H5I_GROUP
-/// \li \c H5I_DATATYPE
-/// \li \c H5I_DATASPACE
-/// \li \c H5I_DATASET
-/// \li \c H5I_ATTR
-/// \li or \c H5I_BADID, if no valid type can be determined or the
-/// input object id is invalid.
+// Function: getHDFObjType
+///\brief Returns the type of the object. It is an overloaded function
+/// of the above function.
+///\return a valid HDF object type, which may be one of the following:
+/// \li \c H5I_FILE
+/// \li \c H5I_GROUP
+/// \li \c H5I_DATATYPE
+/// \li \c H5I_DATASPACE
+/// \li \c H5I_DATASET
+/// \li \c H5I_ATTR
+/// \li or \c H5I_BADID, if no valid type can be determined or the
+/// input object id is invalid.
// Programmer Binh-Minh Ribler - Mar, 2014
//--------------------------------------------------------------------------
H5I_type_t IdComponent::getHDFObjType() const
@@ -162,25 +162,25 @@ H5I_type_t IdComponent::getHDFObjType() const
}
//--------------------------------------------------------------------------
-// Function: getNumMembers (static)
-///\brief Returns the number of members of the given type.
-///\return Number of members
+// Function: getNumMembers (static)
+///\brief Returns the number of members of the given type.
+///\return Number of members
///\Description
-/// If there is no member of the given type, getNumMembers will
-/// return 0. Valid types are:
-/// \li \c H5I_FILE (= 1)
-/// \li \c H5I_GROUP
-/// \li \c H5I_DATATYPE
-/// \li \c H5I_DATASPACE
-/// \li \c H5I_DATASET
-/// \li \c H5I_ATTR
-/// \li \c H5I_REFERENCE
-/// \li \c H5I_VFL
-/// \li \c H5I_GENPROP_CLS
-/// \li \c H5I_GENPROP_LST
-/// \li \c H5I_ERROR_CLASS
-/// \li \c H5I_ERROR_MSG
-/// \li \c H5I_ERROR_STACK
+/// If there is no member of the given type, getNumMembers will
+/// return 0. Valid types are:
+/// \li \c H5I_FILE (= 1)
+/// \li \c H5I_GROUP
+/// \li \c H5I_DATATYPE
+/// \li \c H5I_DATASPACE
+/// \li \c H5I_DATASET
+/// \li \c H5I_ATTR
+/// \li \c H5I_REFERENCE
+/// \li \c H5I_VFL
+/// \li \c H5I_GENPROP_CLS
+/// \li \c H5I_GENPROP_LST
+/// \li \c H5I_ERROR_CLASS
+/// \li \c H5I_ERROR_MSG
+/// \li \c H5I_ERROR_STACK
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
hsize_t IdComponent::getNumMembers(H5I_type_t type)
@@ -188,31 +188,31 @@ hsize_t IdComponent::getNumMembers(H5I_type_t type)
hsize_t nmembers = 0;
herr_t ret_value = H5Inmembers(type, &nmembers);
if (ret_value < 0)
- throw IdComponentException("getNumMembers", "H5Inmembers failed");
+ throw IdComponentException("getNumMembers", "H5Inmembers failed");
else
- return(nmembers);
+ return(nmembers);
}
//--------------------------------------------------------------------------
-// Function: typeExists (static)
-///\brief Queries if a given type is currently registered with the
-/// library.
-///\return true if the given type exists, and false, otherwise.
+// Function: typeExists (static)
+///\brief Queries if a given type is currently registered with the
+/// library.
+///\return true if the given type exists, and false, otherwise.
///\Description
-/// Valid types are:
-/// \li \c H5I_FILE (= 1)
-/// \li \c H5I_GROUP
-/// \li \c H5I_DATATYPE
-/// \li \c H5I_DATASPACE
-/// \li \c H5I_DATASET
-/// \li \c H5I_ATTR
-/// \li \c H5I_REFERENCE
-/// \li \c H5I_VFL
-/// \li \c H5I_GENPROP_CLS
-/// \li \c H5I_GENPROP_LST
-/// \li \c H5I_ERROR_CLASS
-/// \li \c H5I_ERROR_MSG
-/// \li \c H5I_ERROR_STACK
+/// Valid types are:
+/// \li \c H5I_FILE (= 1)
+/// \li \c H5I_GROUP
+/// \li \c H5I_DATATYPE
+/// \li \c H5I_DATASPACE
+/// \li \c H5I_DATASET
+/// \li \c H5I_ATTR
+/// \li \c H5I_REFERENCE
+/// \li \c H5I_VFL
+/// \li \c H5I_GENPROP_CLS
+/// \li \c H5I_GENPROP_LST
+/// \li \c H5I_ERROR_CLASS
+/// \li \c H5I_ERROR_MSG
+/// \li \c H5I_ERROR_STACK
// Programmer Binh-Minh Ribler - Feb, 2017
//--------------------------------------------------------------------------
bool IdComponent::typeExists(H5I_type_t type)
@@ -220,82 +220,82 @@ bool IdComponent::typeExists(H5I_type_t type)
// Call C function
htri_t ret_value = H5Itype_exists(type);
if (ret_value > 0)
- return true;
+ return true;
else if (ret_value == 0)
- return false;
+ return false;
else // Raise exception when H5Itype_exists returns a negative value
- throw IdComponentException("typeExists", "H5Itype_exists failed");
+ throw IdComponentException("typeExists", "H5Itype_exists failed");
}
//--------------------------------------------------------------------------
-// Function: IdComponent::operator=
-///\brief Assignment operator.
-///\param rhs - IN: Reference to the existing object
-///\return Reference to IdComponent instance
-///\exception H5::IdComponentException when attempt to close the HDF5
-/// object fails
+// Function: IdComponent::operator=
+///\brief Assignment operator.
+///\param rhs - IN: Reference to the existing object
+///\return Reference to IdComponent instance
+///\exception H5::IdComponentException when attempt to close the HDF5
+/// object fails
// Description
-// First, close the current valid id of this object. Then
-// copy the id from rhs to this object, and increment the
-// reference counter of the id to indicate that another object
-// is referencing that id.
+// First, close the current valid id of this object. Then
+// copy the id from rhs to this object, and increment the
+// reference counter of the id to indicate that another object
+// is referencing that id.
// Modification
-// 2010/5/9 - BMR
-// Removed close() and incRefCount() because setId/p_setId takes
-// care of close() and setId takes care incRefCount().
-// Programmer Binh-Minh Ribler - 2000
+// 2010/5/9 - BMR
+// Removed close() and incRefCount() because setId/p_setId takes
+// care of close() and setId takes care incRefCount().
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IdComponent& IdComponent::operator=( const IdComponent& rhs )
+IdComponent& IdComponent::operator=(const IdComponent& rhs)
{
if (this != &rhs)
{
- // handling references to this id
- try {
- setId(rhs.getId());
- // Note: a = b, so there are two objects with the same hdf5 id
- // that's why incRefCount is needed, and it is called by setId
- }
- catch (Exception& close_error) {
- throw FileIException(inMemFunc("operator="), close_error.getDetailMsg());
- }
+ // handling references to this id
+ try {
+ setId(rhs.getId());
+ // Note: a = b, so there are two objects with the same hdf5 id
+ // that's why incRefCount is needed, and it is called by setId
+ }
+ catch (Exception& close_error) {
+ throw FileIException(inMemFunc("operator="), close_error.getDetailMsg());
+ }
}
return *this;
}
//--------------------------------------------------------------------------
-// Function: IdComponent::setId
-///\brief Sets the identifier of this object to a new value.
-///\param new_id - IN: New identifier to be set to
-///\exception H5::IdComponentException when the attempt to close the HDF5
-/// object fails
+// Function: IdComponent::setId
+///\brief Sets the identifier of this object to a new value.
+///\param new_id - IN: New identifier to be set to
+///\exception H5::IdComponentException when the attempt to close the HDF5
+/// object fails
// Description:
-// p_setId ensures that the current valid id of this object is
-// properly closed before resetting the object's id to the new id.
-// Programmer Binh-Minh Ribler - 2000
+// p_setId ensures that the current valid id of this object is
+// properly closed before resetting the object's id to the new id.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// 2008/7/23 - BMR
-// Changed all subclasses' setId to p_setId and put back setId
-// here. p_setId is used in the library where the id provided
-// by a C API passed on to user's application in the form of a
-// C++ API object, which will be destroyed properly, and so
-// p_setId does not call incRefCount. On the other hand, the
-// public version setId is used by other applications, in which
-// the id passed to setId is that of another C++ API object, so
-// setId must call incRefCount.
+// 2008/7/23 - BMR
+// Changed all subclasses' setId to p_setId and put back setId
+// here. p_setId is used in the library where the id provided
+// by a C API passed on to user's application in the form of a
+// C++ API object, which will be destroyed properly, and so
+// p_setId does not call incRefCount. On the other hand, the
+// public version setId is used by other applications, in which
+// the id passed to setId is that of another C++ API object, so
+// setId must call incRefCount.
//--------------------------------------------------------------------------
void IdComponent::setId(const hid_t new_id)
{
- // set to new_id
- p_setId(new_id);
+ // set to new_id
+ p_setId(new_id);
- // increment the reference counter of the new id
- incRefCount();
+ // increment the reference counter of the new id
+ incRefCount();
}
//--------------------------------------------------------------------------
-// Function: IdComponent destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IdComponent destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IdComponent::~IdComponent() {}
@@ -306,29 +306,29 @@ IdComponent::~IdComponent() {}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: IdComponent::inMemFunc
-///\brief Makes and returns string "<class-name>::<func_name>"
-///\param func_name - Name of the function where failure occurs
+// Function: IdComponent::inMemFunc
+///\brief Makes and returns string "<class-name>::<func_name>"
+///\param func_name - Name of the function where failure occurs
// Description
-/// Concatenates the class name of this object with the
-/// passed-in function name to create a string that indicates
-/// where the failure occurs. The class-name is provided by
-/// fromClass(). This string will be used by a base class when
-/// an exception is thrown.
-// Programmer Binh-Minh Ribler - Aug 6, 2005
+/// Concatenates the class name of this object with the
+/// passed-in function name to create a string that indicates
+/// where the failure occurs. The class-name is provided by
+/// fromClass(). This string will be used by a base class when
+/// an exception is thrown.
+// Programmer Binh-Minh Ribler - Aug 6, 2005
//--------------------------------------------------------------------------
H5std_string IdComponent::inMemFunc(const char* func_name) const
{
- H5std_string full_name = func_name;
- full_name.insert(0, "::");
- full_name.insert(0, fromClass());
- return (full_name);
+ H5std_string full_name = func_name;
+ full_name.insert(0, "::");
+ full_name.insert(0, fromClass());
+ return (full_name);
}
//--------------------------------------------------------------------------
-// Function: IdComponent default constructor - private
-///\brief Default constructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IdComponent default constructor - private
+///\brief Default constructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IdComponent::IdComponent()
{
@@ -342,45 +342,45 @@ IdComponent::IdComponent()
}
//--------------------------------------------------------------------------
-// Function: IdComponent::p_get_file_name (protected)
-// Purpose: Gets the name of the file, in which this object belongs.
-// Exception: H5::IdComponentException
+// Function: IdComponent::p_get_file_name (protected)
+// Purpose Gets the name of the file, in which this object belongs.
+// Exception: H5::IdComponentException
// Description:
-// This function is protected so that the user applications can
-// only have access to its code via allowable classes, namely,
-// Attribute and H5Location subclasses.
-// Programmer Binh-Minh Ribler - Jul, 2004
+// This function is protected so that the user applications can
+// only have access to its code via allowable classes, namely,
+// Attribute and H5Location subclasses.
+// Programmer Binh-Minh Ribler - Jul, 2004
//--------------------------------------------------------------------------
H5std_string IdComponent::p_get_file_name() const
{
- hid_t temp_id = getId();
+ hid_t temp_id = getId();
- // Preliminary call to H5Fget_name to get the length of the file name
- ssize_t name_size = H5Fget_name(temp_id, NULL, 0);
+ // Preliminary call to H5Fget_name to get the length of the file name
+ ssize_t name_size = H5Fget_name(temp_id, NULL, 0);
- // If H5Aget_name returns a negative value, raise an exception,
- if( name_size < 0 )
- {
- throw IdComponentException("", "H5Fget_name failed");
- }
+ // If H5Aget_name returns a negative value, raise an exception,
+ if (name_size < 0)
+ {
+ throw IdComponentException("", "H5Fget_name failed");
+ }
- // Call H5Fget_name again to get the actual file name
- char* name_C = new char[name_size+1]; // temporary C-string for C API
- HDmemset(name_C, 0, name_size+1); // clear buffer
+ // Call H5Fget_name again to get the actual file name
+ char* name_C = new char[name_size+1]; // temporary C-string for C API
+ HDmemset(name_C, 0, name_size+1); // clear buffer
- name_size = H5Fget_name(temp_id, name_C, name_size+1);
+ name_size = H5Fget_name(temp_id, name_C, name_size+1);
- // Check for failure again
- if( name_size < 0 )
- {
+ // Check for failure again
+ if (name_size < 0)
+ {
delete []name_C;
- throw IdComponentException("", "H5Fget_name failed");
- }
+ throw IdComponentException("", "H5Fget_name failed");
+ }
- // Convert the C file name and return
- H5std_string file_name(name_C);
- delete []name_C;
- return(file_name);
+ // Convert the C file name and return
+ H5std_string file_name(name_C);
+ delete []name_C;
+ return(file_name);
}
//
@@ -388,22 +388,22 @@ H5std_string IdComponent::p_get_file_name() const
//
//--------------------------------------------------------------------------
-// Function: p_valid_id
-// Purpose: Verifies that the given id is a valid id so it can be passed
-// into an H5I C function.
-// Return true if id is valid, false, otherwise
-// Programmer Binh-Minh Ribler - May, 2005
+// Function: p_valid_id
+// Purpose Verifies that the given id is a valid id so it can be passed
+// into an H5I C function.
+// Return true if id is valid, false, otherwise
+// Programmer Binh-Minh Ribler - May, 2005
//--------------------------------------------------------------------------
bool IdComponent::p_valid_id(const hid_t obj_id)
{
if (obj_id <= 0)
- return false;
+ return false;
H5I_type_t id_type = H5Iget_type(obj_id);
if (id_type <= H5I_BADID || id_type >= H5I_NTYPES)
- return false;
+ return false;
else
- return true;
+ return true;
}
// Notes about IdComponent::id
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index 70522dc..6f57364 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -30,92 +30,92 @@ class DataSpace;
class H5_DLLCPP IdComponent {
public:
- // Increment reference counter.
- void incRefCount(const hid_t obj_id) const;
- void incRefCount() const;
+ // Increment reference counter.
+ void incRefCount(const hid_t obj_id) const;
+ void incRefCount() const;
- // Decrement reference counter.
- void decRefCount(const hid_t obj_id) const;
- void decRefCount() const;
+ // Decrement reference counter.
+ void decRefCount(const hid_t obj_id) const;
+ void decRefCount() const;
- // Get the reference counter to this identifier.
- int getCounter(const hid_t obj_id) const;
- int getCounter() const;
+ // Get the reference counter to this identifier.
+ int getCounter(const hid_t obj_id) const;
+ int getCounter() const;
- // Returns an HDF5 object type, given the object id.
- static H5I_type_t getHDFObjType(const hid_t obj_id);
+ // Returns an HDF5 object type, given the object id.
+ static H5I_type_t getHDFObjType(const hid_t obj_id);
- // Returns an HDF5 object type of this object.
- H5I_type_t getHDFObjType() const;
+ // Returns an HDF5 object type of this object.
+ H5I_type_t getHDFObjType() const;
- // Returns the number of members in a type.
- static hsize_t getNumMembers(H5I_type_t type);
+ // Returns the number of members in a type.
+ static hsize_t getNumMembers(H5I_type_t type);
- // Determines if an type exists.
- static bool typeExists(H5I_type_t type);
+ // Determines if an type exists.
+ static bool typeExists(H5I_type_t type);
- // Assignment operator.
- IdComponent& operator=( const IdComponent& rhs );
+ // Assignment operator.
+ IdComponent& operator=(const IdComponent& rhs);
- // Sets the identifier of this object to a new value.
- void setId(const hid_t new_id);
+ // Sets the identifier of this object to a new value.
+ void setId(const hid_t new_id);
- // *** Deprecation warning ***
- // The following two constructors are no longer appropriate after the
- // data member "id" had been moved to the sub-classes.
- // The copy constructor is a noop and is removed in 1.8.15 and the
- // other will be removed from 1.10 release, and then from 1.8 if its
- // removal does not raise any problems in two 1.10 releases.
+ // *** Deprecation warning ***
+ // The following two constructors are no longer appropriate after the
+ // data member "id" had been moved to the sub-classes.
+ // The copy constructor is a noop and is removed in 1.8.15 and the
+ // other will be removed from 1.10 release, and then from 1.8 if its
+ // removal does not raise any problems in two 1.10 releases.
- // Creates an object to hold an HDF5 identifier.
- IdComponent( const hid_t h5_id );
+ // Creates an object to hold an HDF5 identifier.
+ // IdComponent(const hid_t h5_id); - removed from 1.10.1
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Copy constructor: makes copy of the original IdComponent object.
- // IdComponent( const IdComponent& original ); - removed from 1.8.15
+ // Copy constructor: makes copy of the original IdComponent object.
+ // IdComponent(const IdComponent& original); - removed from 1.8.15
- // Gets the identifier of this object.
- virtual hid_t getId () const = 0;
+ // Gets the identifier of this object.
+ virtual hid_t getId () const = 0;
- // Pure virtual function for there are various H5*close for the
- // subclasses.
- virtual void close() = 0;
+ // Pure virtual function for there are various H5*close for the
+ // subclasses.
+ virtual void close() = 0;
- // Makes and returns the string "<class-name>::<func_name>";
- // <class-name> is returned by fromClass().
- H5std_string inMemFunc(const char* func_name) const;
+ // Makes and returns the string "<class-name>::<func_name>";
+ // <class-name> is returned by fromClass().
+ H5std_string inMemFunc(const char* func_name) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass() const { return("IdComponent");}
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass() const { return("IdComponent");}
#endif // DOXYGEN_SHOULD_SKIP_THIS
- // Destructor
- virtual ~IdComponent();
+ // Destructor
+ virtual ~IdComponent();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
protected:
- // Default constructor.
- IdComponent();
+ // Default constructor.
+ IdComponent();
- // Gets the name of the file, in which an HDF5 object belongs.
- H5std_string p_get_file_name() const;
+ // Gets the name of the file, in which an HDF5 object belongs.
+ H5std_string p_get_file_name() const;
- // Verifies that the given id is valid.
- static bool p_valid_id(const hid_t obj_id);
+ // Verifies that the given id is valid.
+ static bool p_valid_id(const hid_t obj_id);
- // Sets the identifier of this object to a new value. - this one
- // doesn't increment reference count
- virtual void p_setId(const hid_t new_id) = 0;
+ // Sets the identifier of this object to a new value. - this one
+ // doesn't increment reference count
+ virtual void p_setId(const hid_t new_id) = 0;
- // This flag is used to decide whether H5dont_atexit should be called
- static bool H5dontAtexit_called;
+ // This flag is used to decide whether H5dont_atexit should be called
+ static bool H5dontAtexit_called;
private:
- // This flag indicates whether H5Library::initH5cpp has been called
- // to register various terminating functions with atexit()
+ // This flag indicates whether H5Library::initH5cpp has been called
+ // to register various terminating functions with atexit()
static bool H5cppinit;
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Include.h b/c++/src/H5Include.h
index 1e0e952..ba82d78 100644
--- a/c++/src/H5Include.h
+++ b/c++/src/H5Include.h
@@ -33,10 +33,10 @@ const bool true = 1;
// so re-define them here for now.
/* Initial version of the object header format */
-#define H5O_VERSION_1 1
+#define H5O_VERSION_1 1
/* Revised version - leaves out reserved bytes and alignment padding, and adds
* magic number as prefix and checksum as suffix for all chunks.
*/
-#define H5O_VERSION_2 2
+#define H5O_VERSION_2 2
diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp
index 38e2a7d..c64dae9 100644
--- a/c++/src/H5IntType.cpp
+++ b/c++/src/H5IntType.cpp
@@ -36,72 +36,72 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: IntType default constructor
-///\brief Default constructor: Creates a stub integer datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType default constructor
+///\brief Default constructor: Creates a stub integer datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType::IntType() {}
//--------------------------------------------------------------------------
-// Function: IntType copy constructor
-///\brief Copy constructor: makes a copy of the original IntType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType copy constructor
+///\brief Copy constructor: makes a copy of the original IntType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType( const IntType& original ) : AtomType( original ) {}
+IntType::IntType(const IntType& original) : AtomType( original ) {}
//--------------------------------------------------------------------------
-// Function: IntType overloaded constructor
-///\brief Creates a integer type using a predefined type
-///\param pred_type - IN: Predefined datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType overloaded constructor
+///\brief Creates a integer type using a predefined type
+///\param pred_type - IN: Predefined datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType( const PredType& pred_type ) : AtomType()
+IntType::IntType(const PredType& pred_type) : AtomType()
{
- // use DataType::copy to make a copy of this predefined type
- copy( pred_type );
+ // use DataType::copy to make a copy of this predefined type
+ copy(pred_type);
}
//--------------------------------------------------------------------------
-// Function: IntType overloaded constructor
-///\brief Creates an integer datatype using the id of an existing
-/// datatype.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType overloaded constructor
+///\brief Creates an integer datatype using the id of an existing
+/// datatype.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {}
+IntType::IntType(const hid_t existing_id) : AtomType( existing_id ) {}
//--------------------------------------------------------------------------
-// Function: IntType overloaded constructor
-///\brief Gets the integer datatype of the specified dataset.
-///\param dataset - IN: Dataset that this integer datatype associates with
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType overloaded constructor
+///\brief Gets the integer datatype of the specified dataset.
+///\param dataset - IN: Dataset that this integer datatype associates with
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-IntType::IntType( const DataSet& dataset ) : AtomType()
+IntType::IntType(const DataSet& dataset) : AtomType()
{
- // Calls C function H5Dget_type to get the id of the datatype
- id = H5Dget_type( dataset.getId() );
-
- if( id < 0 )
- {
- throw DataSetIException("IntType constructor", "H5Dget_type failed");
- }
+ // Calls C function H5Dget_type to get the id of the datatype
+ id = H5Dget_type(dataset.getId());
+
+ if (id < 0)
+ {
+ throw DataSetIException("IntType constructor", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: IntType overloaded constructor
-///\brief Creates a IntType instance by opening an HDF5 integer datatype
-/// given its name as a char*.
-///\param dtype_name - IN: Integer type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// Function: IntType overloaded constructor
+///\brief Creates a IntType instance by opening an HDF5 integer datatype
+/// given its name as a char*.
+///\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
-// existing function CommonFG::openIntType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openIntType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType()
{
@@ -109,17 +109,17 @@ 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 dtype_name - IN: Integer type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openArrayType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openArrayType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomType()
{
@@ -127,46 +127,46 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy
}
//--------------------------------------------------------------------------
-// Function: IntType::getSign
-///\brief Retrieves the sign type for an integer type.
-///\return Valid sign type
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType::getSign
+///\brief Retrieves the sign type for an integer type.
+///\return Valid sign type
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_sign_t IntType::getSign() const
{
- H5T_sign_t type_sign = H5Tget_sign( id ); // C routine
-
- // Returns a valid sign type if no errors
- if( type_sign == H5T_SGN_ERROR )
- {
- throw DataTypeIException("IntType::getSign",
- "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type");
- }
- return( type_sign );
+ H5T_sign_t type_sign = H5Tget_sign(id); // C routine
+
+ // Returns a valid sign type if no errors
+ if (type_sign == H5T_SGN_ERROR)
+ {
+ throw DataTypeIException("IntType::getSign",
+ "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type");
+ }
+ return(type_sign);
}
//--------------------------------------------------------------------------
-// Function: IntType::getSign
-///\brief Sets the sign property for an integer type.
-///\param sign - IN: Sign type
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType::getSign
+///\brief Sets the sign property for an integer type.
+///\param sign - IN: Sign type
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void IntType::setSign( H5T_sign_t sign ) const
+void IntType::setSign(H5T_sign_t sign) const
{
- // Call C routine to set the sign property
- herr_t ret_value = H5Tset_sign( id, sign );
- if( ret_value < 0 )
- {
- throw DataTypeIException("IntType::setSign", "H5Tset_sign failed");
- }
+ // Call C routine to set the sign property
+ herr_t ret_value = H5Tset_sign(id, sign);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("IntType::setSign", "H5Tset_sign failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: IntType destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: IntType destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
IntType::~IntType() {}
diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h
index 74786b9..ae4b3df 100644
--- a/c++/src/H5IntType.h
+++ b/c++/src/H5IntType.h
@@ -27,36 +27,36 @@ namespace H5 {
*/
class H5_DLLCPP IntType : public AtomType {
public:
- // Creates an integer type using a predefined type
- IntType(const PredType& pred_type);
+ // Creates an integer type using a predefined type
+ IntType(const PredType& pred_type);
- // Gets the integer datatype of the specified dataset
- IntType(const DataSet& dataset);
+ // Gets the integer datatype of the specified dataset
+ IntType(const DataSet& dataset);
- // Constructors that open an HDF5 integer datatype, given a location.
- IntType(const H5Location& loc, const char* name);
- IntType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open an HDF5 integer datatype, given a location.
+ IntType(const H5Location& loc, const char* name);
+ IntType(const H5Location& loc, const H5std_string& name);
- // Retrieves the sign type for an integer type
- H5T_sign_t getSign() const;
+ // Retrieves the sign type for an integer type
+ H5T_sign_t getSign() const;
- // Sets the sign proprety for an integer type.
- void setSign( H5T_sign_t sign ) const;
+ // Sets the sign proprety for an integer type.
+ void setSign(H5T_sign_t sign) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("IntType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("IntType"); }
- // Default constructor
- IntType();
+ // Default constructor
+ IntType();
- // Creates a integer datatype using an existing id
- IntType(const hid_t existing_id);
+ // Creates a integer datatype using an existing id
+ IntType(const hid_t existing_id);
- // Copy constructor: makes copy of IntType object
- IntType(const IntType& original);
+ // Copy constructor: makes copy of IntType object
+ IntType(const IntType& original);
- // Noop destructor.
- virtual ~IntType();
+ // Noop destructor.
+ virtual ~IntType();
};
}
#endif // __H5IntType_H
diff --git a/c++/src/H5LaccProp.cpp b/c++/src/H5LaccProp.cpp
index e225b36..e9adb12 100644
--- a/c++/src/H5LaccProp.cpp
+++ b/c++/src/H5LaccProp.cpp
@@ -47,7 +47,7 @@ LinkAccPropList* LinkAccPropList::getConstant()
// Tell the C library not to clean up, H5Library::termH5cpp will call
// H5close - more dependency if use H5Library::dontAtExit()
if (!IdComponent::H5dontAtexit_called)
- {
+ {
(void) H5dont_atexit();
IdComponent::H5dontAtexit_called = true;
}
@@ -75,39 +75,39 @@ void LinkAccPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose: Constant for default property
+// Purpose: Constant for default property
//--------------------------------------------------------------------------
const LinkAccPropList& LinkAccPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: Default Constructor
-///\brief Creates a file access property list
-// Programmer: Binh-Minh Ribler - 2000
+// Function: Default Constructor
+///\brief Creates a file access property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-LinkAccPropList::LinkAccPropList() : PropList( H5P_LINK_ACCESS ) {}
+LinkAccPropList::LinkAccPropList() : PropList(H5P_LINK_ACCESS) {}
//--------------------------------------------------------------------------
-// Function: LinkAccPropList copy constructor
-///\brief Copy Constructor: makes a copy of the original
-///\param original - IN: LinkAccPropList instance to copy
-// Programmer: Binh-Minh Ribler - 2000
+// Function: LinkAccPropList copy constructor
+///\brief Copy Constructor: makes a copy of the original
+///\param original - IN: LinkAccPropList instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
LinkAccPropList::LinkAccPropList(const LinkAccPropList& original) : PropList(original) {}
//--------------------------------------------------------------------------
-// Function: LinkAccPropList overloaded constructor
-///\brief Creates a file access property list using the id of an
-/// existing one.
-// Programmer: Binh-Minh Ribler - 2000
+// Function: LinkAccPropList overloaded constructor
+///\brief Creates a file access property list using the id of an
+/// existing one.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
LinkAccPropList::LinkAccPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: LinkAccPropList destructor
-///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: LinkAccPropList destructor
+///\brief Noop destructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
LinkAccPropList::~LinkAccPropList() {}
diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h
index 2a84ffb..8bcdd64 100644
--- a/c++/src/H5LaccProp.h
+++ b/c++/src/H5LaccProp.h
@@ -30,24 +30,24 @@ namespace H5 {
*/
class H5_DLLCPP LinkAccPropList : public PropList {
public:
- ///\brief Default file access property list.
- static const LinkAccPropList& DEFAULT;
+ ///\brief Default file access property list.
+ static const LinkAccPropList& DEFAULT;
- // Creates a file access property list.
- LinkAccPropList();
+ // Creates a file access property list.
+ LinkAccPropList();
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("LinkAccPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("LinkAccPropList"); }
- // Copy constructor: creates a copy of a LinkAccPropList object.
- LinkAccPropList( const LinkAccPropList& original );
+ // Copy constructor: creates a copy of a LinkAccPropList object.
+ LinkAccPropList(const LinkAccPropList& original);
- // Creates a copy of an existing file access property list
- // using the property list id.
- LinkAccPropList (const hid_t plist_id);
+ // Creates a copy of an existing file access property list
+ // using the property list id.
+ LinkAccPropList (const hid_t plist_id);
- // Noop destructor
- virtual ~LinkAccPropList();
+ // Noop destructor
+ virtual ~LinkAccPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp
index 0ee6b4d..dc453b7 100644
--- a/c++/src/H5Library.cpp
+++ b/c++/src/H5Library.cpp
@@ -38,46 +38,46 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: H5Library::open (static)
-///\brief Initializes the HDF5 library.
+// Function: H5Library::open (static)
+///\brief Initializes the HDF5 library.
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::open()
{
- herr_t ret_value = H5open();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::open", "H5open failed");
- }
+ herr_t ret_value = H5open();
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::open", "H5open failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::close (static)
-///\brief Flushes all data to disk, closes files, and cleans up memory.
+// Function: H5Library::close (static)
+///\brief Flushes all data to disk, closes files, and cleans up memory.
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::close()
{
- herr_t ret_value = H5close();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::close", "H5close failed");
- }
+ herr_t ret_value = H5close();
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::close", "H5close failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::dontAtExit (static)
-///\brief Instructs library not to install the C \c atexit cleanup routine
+// Function: H5Library::dontAtExit (static)
+///\brief Instructs library not to install the C \c atexit cleanup routine
///
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Removed the check for failure returned from H5dont_atexit.
-// will be fixed to not fail (HDFFV-9540)
+// Removed the check for failure returned from H5dont_atexit.
+// will be fixed to not fail (HDFFV-9540)
//--------------------------------------------------------------------------
void H5Library::dontAtExit()
{
@@ -85,80 +85,80 @@ void H5Library::dontAtExit()
}
//--------------------------------------------------------------------------
-// Function: H5Library::getLibVersion (static)
-///\brief Returns the HDF library release number.
-///\param majnum - OUT: Major version of the library
-///\param minnum - OUT: Minor version of the library
-///\param relnum - OUT: Release number of the library
-///\exception H5::LibraryIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Library::getLibVersion (static)
+///\brief Returns the HDF library release number.
+///\param majnum - OUT: Major version of the library
+///\param minnum - OUT: Minor version of the library
+///\param relnum - OUT: Release number of the library
+///\exception H5::LibraryIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum )
+void H5Library::getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum)
{
- herr_t ret_value = H5get_libversion( &majnum, &minnum, &relnum );
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed");
- }
+ herr_t ret_value = H5get_libversion(&majnum, &minnum, &relnum);
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::getLibVersion", "H5get_libversion failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::checkVersion (static)
-///\brief Verifies that the arguments match the version numbers
-/// compiled into the library
-///\param majnum - IN: Major version of the library
-///\param minnum - IN: Minor version of the library
-///\param relnum - IN: Release number of the library
-///\exception H5::LibraryIException
+// Function: H5Library::checkVersion (static)
+///\brief Verifies that the arguments match the version numbers
+/// compiled into the library
+///\param majnum - IN: Major version of the library
+///\param minnum - IN: Minor version of the library
+///\param relnum - IN: Release number of the library
+///\exception H5::LibraryIException
///\par Description
-/// For information about library version, please refer to
-/// the C layer Reference Manual at:
+/// For information about library version, please refer to
+/// the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum)
{
- herr_t ret_value = H5check_version(majnum, minnum, relnum);
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::checkVersion", "H5check_version failed");
- }
+ herr_t ret_value = H5check_version(majnum, minnum, relnum);
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::checkVersion", "H5check_version failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Library::garbageCollect (static)
-///\brief Walks through all the garbage collection routines for the
-/// library, which are supposed to free any unused memory they
-/// have allocated.
+// Function: H5Library::garbageCollect (static)
+///\brief Walks through all the garbage collection routines for the
+/// library, which are supposed to free any unused memory they
+/// have allocated.
///
-///\exception H5::LibraryIException
+///\exception H5::LibraryIException
///\par Description
-/// It is not required that H5Library::garbageCollect be called
-/// at any particular time; it is only necessary in certain
-/// situations, such as when the application has performed actions
-/// that cause the library to allocate many objects. The
-/// application should call H5Library::garbageCollect if it
-/// eventually releases those objects and wants to reduce the
-/// memory used by the library from the peak usage required.
+/// It is not required that H5Library::garbageCollect be called
+/// at any particular time; it is only necessary in certain
+/// situations, such as when the application has performed actions
+/// that cause the library to allocate many objects. The
+/// application should call H5Library::garbageCollect if it
+/// eventually releases those objects and wants to reduce the
+/// memory used by the library from the peak usage required.
///\par
-/// The library automatically garbage collects all the free
-/// lists when the application ends.
-// Programmer Binh-Minh Ribler - May, 2004
+/// The library automatically garbage collects all the free
+/// lists when the application ends.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::garbageCollect()
{
- herr_t ret_value = H5garbage_collect();
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed");
- }
+ herr_t ret_value = H5garbage_collect();
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::garbageCollect", "H5garbage_collect failed");
+ }
}
//--------------------------------------------------------------------------
// Function: H5Library::initH5cpp (static)
///\brief Initializes C++ library and registers terminating functions at
-/// exit. Only for the library functions, not for user-defined
-/// functions.
+/// exit. Only for the library functions, not for user-defined
+/// functions.
// Description
// initH5cpp registers the following functions with std::atexit():
// termH5cpp() - calls H5close() after all cleanup in
@@ -231,45 +231,45 @@ void H5Library::termH5cpp()
}
//--------------------------------------------------------------------------
-// Function: H5Library::setFreeListLimits (static)
-///\brief Sets limits on the different kinds of free lists.
-///\param reg_global_lim - IN: Limit on all "regular" free list memory used
-///\param reg_list_lim - IN: Limit on memory used in each "regular" free list
-///\param arr_global_lim - IN: Limit on all "array" free list memory used
-///\param arr_list_lim - IN: Limit on memory used in each "array" free list
-///\param blk_global_lim - IN: Limit on all "block" free list memory used
-///\param blk_list_lim - IN: Limit on memory used in each "block" free list
-///\exception H5::LibraryIException
+// Function: H5Library::setFreeListLimits (static)
+///\brief Sets limits on the different kinds of free lists.
+///\param reg_global_lim - IN: Limit on all "regular" free list memory used
+///\param reg_list_lim - IN: Limit on memory used in each "regular" free list
+///\param arr_global_lim - IN: Limit on all "array" free list memory used
+///\param arr_list_lim - IN: Limit on memory used in each "array" free list
+///\param blk_global_lim - IN: Limit on all "block" free list memory used
+///\param blk_list_lim - IN: Limit on memory used in each "block" free list
+///\exception H5::LibraryIException
///\par Description
-/// Setting a value of -1 for a limit means no limit of that type.
-/// For more information on free list limits, please refer to C
-/// layer Reference Manual at:
+/// Setting a value of -1 for a limit means no limit of that type.
+/// For more information on free list limits, please refer to C
+/// layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits
-// Programmer Binh-Minh Ribler - May, 2004
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim,
- int arr_global_lim, int arr_list_lim, int blk_global_lim,
- int blk_list_lim)
+ int arr_global_lim, int arr_list_lim, int blk_global_lim,
+ int blk_list_lim)
{
- herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
- if( ret_value < 0 )
- {
- throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
- }
+ herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim);
+ if (ret_value < 0)
+ {
+ throw LibraryIException("H5Library::setFreeListLimits", "H5set_free_list_limits failed");
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Library default constructor - private
-///\brief Default constructor: Creates a stub H5Library object
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Library default constructor - private
+///\brief Default constructor: Creates a stub H5Library object
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Library::H5Library(){}
//--------------------------------------------------------------------------
-// Function: H5Library destructor
-///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Library destructor
+///\brief Noop destructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Library::~H5Library(){}
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h
index 694b052..018ba38 100644
--- a/c++/src/H5Library.h
+++ b/c++/src/H5Library.h
@@ -27,32 +27,32 @@ namespace H5 {
*/
class H5_DLLCPP H5Library {
public:
- // Initializes the HDF5 library.
- static void open();
+ // Initializes the HDF5 library.
+ static void open();
- // Flushes all data to disk, closes files, and cleans up memory.
- static void close();
+ // Flushes all data to disk, closes files, and cleans up memory.
+ static void close();
- // Instructs library not to install atexit cleanup routine
- static void dontAtExit();
+ // Instructs library not to install atexit cleanup routine
+ static void dontAtExit();
- // Returns the HDF library release number.
- static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum );
+ // Returns the HDF library release number.
+ static void getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum);
- // Verifies that the arguments match the version numbers compiled
- // into the library
- static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum );
+ // Verifies that the arguments match the version numbers compiled
+ // into the library
+ static void checkVersion(unsigned majnum, unsigned minnum, unsigned relnum);
- // Walks through all the garbage collection routines for the library,
- // which are supposed to free any unused memory they have allocated.
- static void garbageCollect();
+ // Walks through all the garbage collection routines for the library,
+ // which are supposed to free any unused memory they have allocated.
+ static void garbageCollect();
- // Sets limits on the different kinds of free lists.
- static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
- arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
+ // Sets limits on the different kinds of free lists.
+ static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
+ arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
// Initializes C++ library and registers terminating functions at exit.
- // Only for the library functions, not for user-defined functions.
+ // Only for the library functions, not for user-defined functions.
static void initH5cpp(void);
// Sends request for terminating the HDF5 library.
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index a3e6738..5a0bb73 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -15,7 +15,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -40,17 +40,17 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location default constructor (protected)
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location default constructor (protected)
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Location::H5Location() : IdComponent() {}
//--------------------------------------------------------------------------
-// Function: H5Location overloaded constructor (protected)
-// Purpose Creates an H5Location object using the id of an existing HDF5
-// object.
-// Parameters object_id - IN: Id of an existing HDF5 object
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location overloaded constructor (protected)
+// Purpose Creates an H5Location object using the id of an existing HDF5
+// object.
+// Parameters object_id - IN: Id of an existing HDF5 object
+// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
@@ -62,11 +62,11 @@ H5Location::H5Location() : IdComponent() {}
// H5Location::H5Location(const hid_t object_id) : IdComponent() {}
//--------------------------------------------------------------------------
-// Function: H5Location copy constructor
-// Purpose: This noop copy constructor is removed as a result of the data
-// member "id" being moved down to sub-classes. (Mar 2015)
-///\param original - IN: H5Location instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location copy constructor
+// Purpose This noop copy constructor is removed as a result of the data
+// member "id" being moved down to sub-classes. (Mar 2015)
+///\param original - IN: H5Location instance to copy
+// Programmer Binh-Minh Ribler - 2000
//
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
@@ -78,34 +78,34 @@ H5Location::H5Location() : IdComponent() {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::exists
-///\brief Checks if a link of a given name exists in a location
-///\param name - IN: Searched name
-///\param lapl - IN: Link access property list
-///\exception H5::LocationException
-// Programmer Binh-Minh Ribler - Nov, 2016
+// Function: H5Location::exists
+///\brief Checks if a link of a given name exists in a location
+///\param name - IN: Searched name
+///\param lapl - IN: Link access property list
+///\exception H5::LocationException
+// Programmer Binh-Minh Ribler - Nov, 2016
// Modification
//--------------------------------------------------------------------------
bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const
{
htri_t ret_value = H5Lexists(getId(), name, lapl.getId());
if (ret_value > 0)
- return true;
+ return true;
else if (ret_value == 0)
- return false;
+ return false;
else // Raise exception when H5Lexists returns a negative value
{
- throwException("exists", "H5Lexists failed");
+ throwException("exists", "H5Lexists failed");
}
}
//--------------------------------------------------------------------------
-// Function: H5Location::exists
-///\brief Checks if a link of a given name exists in a location
-///\param name - IN: Searched name
-///\param lapl - IN: Link access property list
-///\exception H5::LocationException
-// Programmer Binh-Minh Ribler - Dec, 2016
+// Function: H5Location::exists
+///\brief Checks if a link of a given name exists in a location
+///\param name - IN: Searched name
+///\param lapl - IN: Link access property list
+///\exception H5::LocationException
+// Programmer Binh-Minh Ribler - Dec, 2016
// Modification
//--------------------------------------------------------------------------
bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) const
@@ -114,156 +114,156 @@ bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) c
}
//--------------------------------------------------------------------------
-// Function: H5Location::flush
-///\brief Flushes all buffers associated with a location to disk.
-///\param scope - IN: Specifies the scope of the flushing action,
-/// which can be either of these values:
-/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
-/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
-///\exception H5::Exception
+// Function: H5Location::flush
+///\brief Flushes all buffers associated with a location to disk.
+///\param scope - IN: Specifies the scope of the flushing action,
+/// which can be either of these values:
+/// \li \c H5F_SCOPE_GLOBAL - Flushes the entire virtual file
+/// \li \c H5F_SCOPE_LOCAL - Flushes only the specified file
+///\exception H5::Exception
///\par Description
-/// This location is used to identify the file to be flushed.
-// Programmer Binh-Minh Ribler - 2012
+/// This location is used to identify the file to be flushed.
+// Programmer Binh-Minh Ribler - 2012
// Modification
-// Sep 2012 - BMR
-// Moved from H5File/H5Object
+// Sep 2012 - BMR
+// Moved from H5File/H5Object
//--------------------------------------------------------------------------
void H5Location::flush(H5F_scope_t scope) const
{
- herr_t ret_value = H5Fflush(getId(), scope);
- if( ret_value < 0 )
- {
- throw LocationException(inMemFunc("flush"), "H5Fflush failed");
- }
+ herr_t ret_value = H5Fflush(getId(), scope);
+ if (ret_value < 0)
+ {
+ throw LocationException(inMemFunc("flush"), "H5Fflush failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Location::getFileName
-///\brief Gets the name of the file, in which this HDF5 object belongs.
-///\return File name
-///\exception H5::LocationException
-// Programmer Binh-Minh Ribler - Jul, 2004
+// Function: H5Location::getFileName
+///\brief Gets the name of the file, in which this HDF5 object belongs.
+///\return File name
+///\exception H5::LocationException
+// Programmer Binh-Minh Ribler - Jul, 2004
//--------------------------------------------------------------------------
H5std_string H5Location::getFileName() const
{
- try {
+ try {
return(p_get_file_name());
- }
- catch (LocationException& E) {
- throw FileIException(inMemFunc("getFileName"), E.getDetailMsg());
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Location::setComment
-///\brief Sets or resets the comment for an object specified by its name.
-///\param name - IN: Name of the object
-///\param comment - IN: New comment
-///\exception H5::LocationException
-///\par Description
-/// If \a comment is an empty string or a null pointer, the comment
-/// message is removed from the object.
-/// Comments should be relatively short, null-terminated, ASCII
-/// strings. They can be attached to any object that has an
-/// object header, e.g., data sets, groups, named data types,
-/// and data spaces, but not symbolic links.
-// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
+ }
+ catch (LocationException& E) {
+ throw FileIException(inMemFunc("getFileName"), E.getDetailMsg());
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::setComment
+///\brief Sets or resets the comment for an object specified by its name.
+///\param name - IN: Name of the object
+///\param comment - IN: New comment
+///\exception H5::LocationException
+///\par Description
+/// If \a comment is an empty string or a null pointer, the comment
+/// message is removed from the object.
+/// Comments should be relatively short, null-terminated, ASCII
+/// strings. They can be attached to any object that has an
+/// object header, e.g., data sets, groups, named data types,
+/// and data spaces, but not symbolic links.
+// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
// Modification
-// 2007: QAK modified to use H5O APIs; however the first parameter is
-// no longer just file or group, this function should be moved
-// to another class to accommodate attribute, dataset, and named
-// datatype. - BMR
+// 2007: QAK modified to use H5O APIs; however the first parameter is
+// no longer just file or group, this function should be moved
+// to another class to accommodate attribute, dataset, and named
+// datatype. - BMR
//--------------------------------------------------------------------------
void H5Location::setComment(const char* name, const char* comment) const
{
- herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT);
- if( ret_value < 0 )
- throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
+ herr_t ret_value = H5Oset_comment_by_name(getId(), name, comment, H5P_DEFAULT);
+ if (ret_value < 0)
+ throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::setComment
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name and \a comment.
-// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
+// Function: H5Location::setComment
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name and \a comment.
+// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
//--------------------------------------------------------------------------
void H5Location::setComment(const H5std_string& name, const H5std_string& comment) const
{
- setComment(name.c_str(), comment.c_str());
+ setComment(name.c_str(), comment.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Location::setComment
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it doesn't take
-/// an object name.
-// Programmer Binh-Minh Ribler - Sep 2013
+// Function: H5Location::setComment
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it doesn't take
+/// an object name.
+// Programmer Binh-Minh Ribler - Sep 2013
// Modification
//--------------------------------------------------------------------------
void H5Location::setComment(const char* comment) const
{
- herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT);
- if( ret_value < 0 )
- throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
+ herr_t ret_value = H5Oset_comment_by_name(getId(), ".", comment, H5P_DEFAULT);
+ if (ret_value < 0)
+ throw LocationException(inMemFunc("setComment"), "H5Oset_comment_by_name failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::setComment
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a comment.
-// Programmer Binh-Minh Ribler - Sep 2013
+// Function: H5Location::setComment
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a comment.
+// Programmer Binh-Minh Ribler - Sep 2013
//--------------------------------------------------------------------------
void H5Location::setComment(const H5std_string& comment) const
{
- setComment(comment.c_str());
+ setComment(comment.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Location::removeComment
-///\brief Removes the comment from an object specified by its name.
-///\param name - IN: Name of the object
-///\exception H5::LocationException
-// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
-// 2007: QAK modified to use H5O APIs; however the first parameter is
-// no longer just file or group, this function should be moved
-// to another class to accommodate attribute, dataset, and named
-// datatype. - BMR
+// Function: H5Location::removeComment
+///\brief Removes the comment from an object specified by its name.
+///\param name - IN: Name of the object
+///\exception H5::LocationException
+// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
+// 2007: QAK modified to use H5O APIs; however the first parameter is
+// no longer just file or group, this function should be moved
+// to another class to accommodate attribute, dataset, and named
+// datatype. - BMR
//--------------------------------------------------------------------------
void H5Location::removeComment(const char* name) const
{
- herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT);
- if( ret_value < 0 )
- throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed");
+ herr_t ret_value = H5Oset_comment_by_name(getId(), name, NULL, H5P_DEFAULT);
+ if (ret_value < 0)
+ throw LocationException(inMemFunc("removeComment"), "H5Oset_comment_by_name failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::removeComment
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
+// Function: H5Location::removeComment
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - May 2005 (moved from CommonFG, Sep 2013)
//--------------------------------------------------------------------------
void H5Location::removeComment(const H5std_string& name) const
{
- removeComment (name.c_str());
+ removeComment (name.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Location::getComment
-///\brief Retrieves the comment for this location, returning its length.
-///\param name - IN: Name of the object
-///\param buf_size - IN: Length of the comment to retrieve
-///\param comment - OUT: Retrieved comment
-///\return Actual length of the comment
-///\exception H5::LocationException
+// Function: H5Location::getComment
+///\brief Retrieves the comment for this location, returning its length.
+///\param name - IN: Name of the object
+///\param buf_size - IN: Length of the comment to retrieve
+///\param comment - OUT: Retrieved comment
+///\return Actual length of the comment
+///\exception H5::LocationException
///\par Description
-/// This function retrieves \a buf_size characters of the comment
-/// including the null terminator. Thus, if the actual length
-/// of the comment is more than buf_size-1, the retrieved comment
-/// will be truncated to accommodate the null terminator.
-// Programmer Binh-Minh Ribler - Mar 2014
+/// This function retrieves \a buf_size characters of the comment
+/// including the null terminator. Thus, if the actual length
+/// of the comment is more than buf_size-1, the retrieved comment
+/// will be truncated to accommodate the null terminator.
+// Programmer Binh-Minh Ribler - Mar 2014
//--------------------------------------------------------------------------
ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment) const
{
@@ -274,27 +274,27 @@ ssize_t H5Location::getComment(const char* name, size_t buf_size, char* comment)
// If H5Oget_comment_by_name returns a negative value, raise an exception
if (comment_len < 0)
- {
+ {
throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed");
}
// If the comment is longer than the provided buffer size, the C library
// will not null terminate it
if (static_cast<size_t>(comment_len) >= buf_size)
- comment[buf_size-1] = '\0';
+ comment[buf_size-1] = '\0';
// Return the actual comment length, which might be different from buf_size
return(comment_len);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getComment
-///\brief Returns the comment as \a string for this location,
-/// returning its length.
-///\param name - IN: Name of the object
-///\param buf_size - IN: Length of the comment to retrieve, default to 0
-///\return Comment string
-///\exception H5::LocationException
-// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
+// Function: H5Location::getComment
+///\brief Returns the comment as \a string for this location,
+/// returning its length.
+///\param name - IN: Name of the object
+///\param buf_size - IN: Length of the comment to retrieve, default to 0
+///\return Comment string
+///\exception H5::LocationException
+// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
//--------------------------------------------------------------------------
H5std_string H5Location::getComment(const char* name, size_t buf_size) const
{
@@ -307,36 +307,36 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const
// If H5Oget_comment_by_name returns a negative value, raise an exception
if (comment_len < 0)
- {
+ {
throw LocationException("H5Location::getComment", "H5Oget_comment_by_name failed");
}
// If comment exists, calls C routine again to get it
else if (comment_len > 0)
- {
- size_t tmp_len = buf_size;
-
- // If buffer size is not provided, use comment length
- if (tmp_len == 0)
- tmp_len = comment_len;
-
- // Temporary buffer for char* comment
- char* comment_C = new char[tmp_len+1];
- HDmemset(comment_C, 0, tmp_len+1); // clear buffer
-
- // Used overloaded function
- 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");
- }
-
- // Convert the C comment to return
- comment = comment_C;
-
- // Clean up resource
- delete []comment_C;
+ {
+ size_t tmp_len = buf_size;
+
+ // If buffer size is not provided, use comment length
+ if (tmp_len == 0)
+ tmp_len = comment_len;
+
+ // Temporary buffer for char* comment
+ char* comment_C = new char[tmp_len+1];
+ HDmemset(comment_C, 0, tmp_len+1); // clear buffer
+
+ // Used overloaded function
+ 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");
+ }
+
+ // Convert the C comment to return
+ comment = comment_C;
+
+ // Clean up resource
+ delete []comment_C;
}
// Return the string comment
@@ -344,11 +344,11 @@ H5std_string H5Location::getComment(const char* name, size_t buf_size) const
}
//--------------------------------------------------------------------------
-// Function: H5Location::getComment
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
+// Function: H5Location::getComment
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000 (moved from CommonFG, Sep 2013)
//--------------------------------------------------------------------------
H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) const
{
@@ -357,112 +357,112 @@ H5std_string H5Location::getComment(const H5std_string& name, size_t buf_size) c
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::p_reference (protected)
-// Purpose Creates a reference to an HDF5 object or a dataset region.
+// Function: H5Location::p_reference (protected)
+// Purpose Creates a reference to an HDF5 object or a dataset region.
// Parameters
-// name - IN: Name of the object to be referenced
-// dataspace - IN: Dataspace with selection
-// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
-// Exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// name - IN: Name of the object to be referenced
+// dataspace - IN: Dataspace with selection
+// ref_type - IN: Type of reference; default to \c H5R_DATASET_REGION
+// Exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Location::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const
{
- herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id);
- if (ret_value < 0)
- {
- throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed");
- }
+ herr_t ret_value = H5Rcreate(ref, getId(), name, ref_type, space_id);
+ if (ret_value < 0)
+ {
+ throw ReferenceException(inMemFunc("reference"), "H5Rcreate failed");
+ }
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::reference
-///\brief Creates a reference to an HDF5 object or a dataset region.
-///\param ref - IN: Reference pointer
-///\param name - IN: Name of the object to be referenced
-///\param dataspace - IN: Dataspace with selection
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference.
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region
-/// reference. (default)
-///\exception H5::ReferenceException
-///\note This method is more suitable for a dataset region reference.
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::reference
+///\brief Creates a reference to an HDF5 object or a dataset region.
+///\param ref - IN: Reference pointer
+///\param name - IN: Name of the object to be referenced
+///\param dataspace - IN: Dataspace with selection
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference.
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region
+/// reference. (default)
+///\exception H5::ReferenceException
+///\note This method is more suitable for a dataset region reference.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Location::reference(void* ref, const char* name, const DataSpace& dataspace, H5R_type_t ref_type) const
{
- try {
- p_reference(ref, name, dataspace.getId(), ref_type);
- }
- catch (ReferenceException& E) {
- throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
- }
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Location::reference
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-///\param ref - IN: Reference pointer
-///\param name - IN: Name of the object to be referenced
-///\param dataspace - IN: Dataspace with selection
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference.
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region
-/// reference. (default)
-///\exception H5::ReferenceException
-///\note This method is more suitable for a dataset region reference.
-// Programmer Binh-Minh Ribler - May, 2004
+ try {
+ p_reference(ref, name, dataspace.getId(), ref_type);
+ }
+ catch (ReferenceException& E) {
+ throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
+ }
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::reference
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+///\param ref - IN: Reference pointer
+///\param name - IN: Name of the object to be referenced
+///\param dataspace - IN: Dataspace with selection
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference.
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region
+/// reference. (default)
+///\exception H5::ReferenceException
+///\note This method is more suitable for a dataset region reference.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Location::reference(void* ref, const H5std_string& name, const DataSpace& dataspace, H5R_type_t ref_type) const
{
- try {
- p_reference(ref, name.c_str(), dataspace.getId(), ref_type);
- }
- catch (ReferenceException& E) {
- throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
- }
+ try {
+ p_reference(ref, name.c_str(), dataspace.getId(), ref_type);
+ }
+ catch (ReferenceException& E) {
+ throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Location::reference
-///\brief This is an overloaded function, provided for your convenience.
-/// It differs from the above function in that it does not take
-/// a DataSpace object and the reference type must be specified.
-///\param ref - IN: Reference pointer
-///\param name - IN: Name of the object to be referenced
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference (default)
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region
-///\exception H5::ReferenceException
-///\note This method is more suitable for an object reference.
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::reference
+///\brief This is an overloaded function, provided for your convenience.
+/// It differs from the above function in that it does not take
+/// a DataSpace object and the reference type must be specified.
+///\param ref - IN: Reference pointer
+///\param name - IN: Name of the object to be referenced
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference (default)
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region
+///\exception H5::ReferenceException
+///\note This method is more suitable for an object reference.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Location::reference(void* ref, const char* name, H5R_type_t ref_type) const
{
- try {
- p_reference(ref, name, -1, ref_type);
- }
- catch (ReferenceException& E) {
- throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
- }
+ try {
+ p_reference(ref, name, -1, ref_type);
+ }
+ catch (ReferenceException& E) {
+ throw ReferenceException(inMemFunc("reference"), E.getDetailMsg());
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Location::reference
-///\brief This is an overloaded function, provided for your convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for the object's name.
-///\param ref - IN: Reference pointer
-///\param name - IN: Name of the object to be referenced - \c H5std_string
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference (default)
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region
-///\note This method is more suitable for an object reference.
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::reference
+///\brief This is an overloaded function, provided for your convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for the object's name.
+///\param ref - IN: Reference pointer
+///\param name - IN: Name of the object to be referenced - \c H5std_string
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference (default)
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region
+///\note This method is more suitable for an object reference.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_type) const
{
@@ -471,69 +471,69 @@ void H5Location::reference(void* ref, const H5std_string& name, H5R_type_t ref_t
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::p_dereference (protected)
-// Purpose Dereference a ref into an hdf5 object.
+// Function: H5Location::p_dereference (protected)
+// Purpose Dereference a ref into an hdf5 object.
// Parameters
-// loc_id - IN: An hdf5 identifier specifying the location of the
-// referenced object
-// ref - IN: Reference pointer
-// ref_type - IN: Reference type
-// plist - IN: Property list - default to PropList::DEFAULT
-// from_func - IN: Name of the calling function
-// Exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - Oct, 2006
+// loc_id - IN: An hdf5 identifier specifying the location of the
+// referenced object
+// ref - IN: Reference pointer
+// ref_type - IN: Reference type
+// plist - IN: Property list - default to PropList::DEFAULT
+// from_func - IN: Name of the calling function
+// Exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - Oct, 2006
// Modification
-// May 2008 - BMR
-// Moved from IdComponent.
+// May 2008 - BMR
+// Moved from IdComponent.
//--------------------------------------------------------------------------
hid_t H5Location::p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func)
{
- hid_t plist_id;
- if (p_valid_id(plist.getId()))
- plist_id = plist.getId();
- else
- plist_id = H5P_DEFAULT;
+ hid_t plist_id;
+ if (p_valid_id(plist.getId()))
+ plist_id = plist.getId();
+ else
+ plist_id = H5P_DEFAULT;
- hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref);
- if (temp_id < 0)
- {
- throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed");
- }
+ hid_t temp_id = H5Rdereference2(loc_id, plist_id, ref_type, ref);
+ if (temp_id < 0)
+ {
+ throw ReferenceException(inMemFunc(from_func), "H5Rdereference failed");
+ }
- return(temp_id);
+ return(temp_id);
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::dereference
-///\brief Dereferences a reference into an HDF5 object, given an HDF5 object.
-///\param loc - IN: 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
+// Function: H5Location::dereference
+///\brief Dereferences a reference into an HDF5 object, given an HDF5 object.
+///\param loc - IN: 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
+// May, 2008
+// Corrected missing parameters. - BMR
//--------------------------------------------------------------------------
void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t ref_type, const PropList& plist)
{
- p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference"));
+ p_setId(p_dereference(loc.getId(), ref, ref_type, plist, "dereference"));
}
//--------------------------------------------------------------------------
-// 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
-// Programmer Binh-Minh Ribler - Oct, 2006
+// 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
+// Programmer Binh-Minh Ribler - Oct, 2006
// Modification
-// May, 2008
-// Corrected missing parameters. - BMR
+// May, 2008
+// Corrected missing parameters. - BMR
//--------------------------------------------------------------------------
/* void H5Location::dereference(const Attribute& attr, const void* ref, H5R_type_t ref_type, const PropList& plist)
{
@@ -543,153 +543,152 @@ void H5Location::dereference(const H5Location& loc, const void* ref, H5R_type_t
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------
-// Function: H5Location::getObjType
-///\brief Retrieves the type of object that an object reference points to.
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference.
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
-///\param ref - IN: Reference to query
-///\return An object type, which can be one of the following:
-/// \li \c H5G_UNKNOWN - A failure occurs. (-1)
-/// \li \c H5G_GROUP - Object is a group.
-/// \li \c H5G_DATASET - Object is a dataset.
-/// \li \c H5G_TYPE Object - is a named datatype
-/// \li \c H5G_LINK - Object is a symbolic link.
-/// \li \c H5G_UDLINK - Object is a user-defined link.
-///\exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::getObjType
+///\brief Retrieves the type of object that an object reference points to.
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference.
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
+///\param ref - IN: Reference to query
+///\return An object type, which can be one of the following:
+/// \li \c H5G_UNKNOWN - A failure occurs. (-1)
+/// \li \c H5G_GROUP - Object is a group.
+/// \li \c H5G_DATASET - Object is a dataset.
+/// \li \c H5G_TYPE Object - is a named datatype
+/// \li \c H5G_LINK - Object is a symbolic link.
+/// \li \c H5G_UDLINK - Object is a user-defined link.
+///\exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
// Modification
-// Sep 2012: Moved up from H5File, Group, DataSet, and DataType
+// Sep 2012: Moved up from H5File, Group, DataSet, and DataType
//--------------------------------------------------------------------------
H5G_obj_t H5Location::getObjType(void *ref, H5R_type_t ref_type) const
{
- try {
- return(p_get_obj_type(ref, ref_type));
- }
- catch (ReferenceException& E) {
- throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg());
- }
+ try {
+ return(p_get_obj_type(ref, ref_type));
+ }
+ catch (ReferenceException& E) {
+ throw ReferenceException(inMemFunc("getObjType"), E.getDetailMsg());
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::p_get_obj_type (protected)
-// Purpose Retrieves the type of object that an object reference points to.
+// Function: H5Location::p_get_obj_type (protected)
+// Purpose Retrieves the type of object that an object reference points to.
// Parameters
-// ref - IN: Reference to query
-// ref_type - IN: Type of reference to query
-// Return An object type, which can be one of the following:
-// H5G_UNKNOWN \tFailure occurs (-1)
-// H5G_GROUP \tObject is a group.
-// H5G_DATASET \tObject is a dataset.
-// H5G_TYPE Object \tis a named datatype.
-// H5G_LINK \tObject is a symbolic link.
-// H5G_UDLINK \tObject is a user-defined link.
-// Exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// ref - IN: Reference to query
+// ref_type - IN: Type of reference to query
+// Return An object type, which can be one of the following:
+// H5G_UNKNOWN \tFailure occurs (-1)
+// H5G_GROUP \tObject is a group.
+// H5G_DATASET \tObject is a dataset.
+// H5G_TYPE Object \tis a named datatype.
+// H5G_LINK \tObject is a symbolic link.
+// H5G_UDLINK \tObject is a user-defined link.
+// Exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
H5G_obj_t H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const
{
H5G_obj_t obj_type = H5Rget_obj_type1(getId(), ref_type, ref);
-
if (obj_type == H5G_UNKNOWN)
- {
- throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed");
- }
+ {
+ throw ReferenceException(inMemFunc("getObjType"), "H5Rget_obj_type1 failed");
+ }
return(obj_type);
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
-// Function: H5Location::getRefObjType
-///\brief Retrieves the type of object that an object reference points to.
-///\param ref - IN: Reference to query
-///\param ref_type - IN: Type of reference to query, valid values are:
-/// \li \c H5R_OBJECT - Reference is an object reference.
-/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
-///\return An object type, which can be one of the following:
-/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1)
-/// \li \c H5O_TYPE_GROUP - Object is a group
-/// \li \c H5O_TYPE_DATASET - Object is a dataset
-/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
-/// \li \c H5O_TYPE_NTYPES - Number of different object types
-///\exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::getRefObjType
+///\brief Retrieves the type of object that an object reference points to.
+///\param ref - IN: Reference to query
+///\param ref_type - IN: Type of reference to query, valid values are:
+/// \li \c H5R_OBJECT - Reference is an object reference.
+/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference.
+///\return An object type, which can be one of the following:
+/// \li \c H5O_TYPE_UNKNOWN - Unknown object type (-1)
+/// \li \c H5O_TYPE_GROUP - Object is a group
+/// \li \c H5O_TYPE_DATASET - Object is a dataset
+/// \li \c H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
+/// \li \c H5O_TYPE_NTYPES - Number of different object types
+///\exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
H5O_type_t H5Location::getRefObjType(void *ref, H5R_type_t ref_type) const
{
- try {
+ try {
return(p_get_ref_obj_type(ref, ref_type));
- }
- catch (ReferenceException& E) {
- throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg());
- }
+ }
+ catch (ReferenceException& E) {
+ throw ReferenceException(inMemFunc("getRefObjType"), E.getDetailMsg());
+ }
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::p_get_ref_obj_type (protected)
-// Purpose Retrieves the type of object that an object reference points to.
+// Function: H5Location::p_get_ref_obj_type (protected)
+// Purpose Retrieves the type of object that an object reference points to.
// Parameters
-// ref - IN: Reference to query
-// ref_type - IN: Type of reference to query
-// Return An object type, which can be one of the following:
-// H5O_TYPE_UNKNOWN - Unknown object type (-1)
-// H5O_TYPE_GROUP - Object is a group
-// H5O_TYPE_DATASET - Object is a dataset
-// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
-// H5O_TYPE_NTYPES - Number of object types
-// Exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// ref - IN: Reference to query
+// ref_type - IN: Type of reference to query
+// Return An object type, which can be one of the following:
+// H5O_TYPE_UNKNOWN - Unknown object type (-1)
+// H5O_TYPE_GROUP - Object is a group
+// H5O_TYPE_DATASET - Object is a dataset
+// H5O_TYPE_NAMED_DATATYPE - Object is a named datatype
+// H5O_TYPE_NTYPES - Number of object types
+// Exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
H5O_type_t H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const
{
- H5O_type_t obj_type = H5O_TYPE_UNKNOWN;
- herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type);
- if (ret_value < 0)
- {
- throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed");
- }
- if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES)
- {
- throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type");
- }
- return(obj_type);
+ H5O_type_t obj_type = H5O_TYPE_UNKNOWN;
+ herr_t ret_value = H5Rget_obj_type2(getId(), ref_type, ref, &obj_type);
+ if (ret_value < 0)
+ {
+ throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 failed");
+ }
+ if (obj_type == H5O_TYPE_UNKNOWN || obj_type >= H5O_TYPE_NTYPES)
+ {
+ throw ReferenceException(inMemFunc("getRefObjType"), "H5Rget_obj_type2 returned invalid type");
+ }
+ return(obj_type);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getRegion
-///\brief Retrieves a dataspace with the region pointed to selected.
-///\param ref - IN: Reference to get region of
-///\param ref_type - IN: Type of reference to get region of - default
-// to H5R_DATASET_REGION
-///\return DataSpace object
-///\exception H5::ReferenceException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: H5Location::getRegion
+///\brief Retrieves a dataspace with the region pointed to selected.
+///\param ref - IN: Reference to get region of
+///\param ref_type - IN: Type of reference to get region of - default
+// to H5R_DATASET_REGION
+///\return DataSpace object
+///\exception H5::ReferenceException
+// Programmer Binh-Minh Ribler - May, 2004
// Modification
-// Mar 29, 2015
-// Used friend function to set id for DataSpace instead of the
-// existing id constructor or the setId method to avoid incrementing
-// ref count, as a work-around for a problem described in the JIRA
-// issue HDFFV-7947. -BMR
+// Mar 29, 2015
+// Used friend function to set id for DataSpace instead of the
+// existing id constructor or the setId method to avoid incrementing
+// ref count, as a work-around for a problem described in the JIRA
+// issue HDFFV-7947. -BMR
//--------------------------------------------------------------------------
DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
{
- hid_t space_id = H5Rget_region(getId(), ref_type, ref);
- if (space_id < 0)
- {
- throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed");
- }
- try {
- DataSpace dataspace;
- f_DataSpace_setId(&dataspace, space_id);
- return(dataspace);
- }
- catch (DataSpaceIException& E) {
- throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg());
- }
+ hid_t space_id = H5Rget_region(getId(), ref_type, ref);
+ if (space_id < 0)
+ {
+ throw ReferenceException(inMemFunc("getRegion"), "H5Rget_region failed");
+ }
+ try {
+ DataSpace dataspace;
+ f_DataSpace_setId(&dataspace, space_id);
+ return(dataspace);
+ }
+ catch (DataSpaceIException& E) {
+ throw ReferenceException(inMemFunc("getRegion"), E.getDetailMsg());
+ }
}
@@ -705,11 +704,11 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
// to call the right getId() - although, as the structure of the
// library at this time, getId() is basically the IdComponent::getId()
// ***Updated: after the classes are rearranged (HDFFV-9920), functions
-// in CommonFG are moved to Group, and they can call getId()
-// instead of getLocId(). getLocId() is kept for backward
-// compatibility on user applications. Aug 18, 2016 -BMR
+// in CommonFG are moved to Group, and they can call getId()
+// instead of getLocId(). getLocId() is kept for backward
+// compatibility on user applications. Aug 18, 2016 -BMR
// ***Updated: Moving to Group was a mistake, now to H5Location
-// Aug 24, 2016 -BMR
+// Aug 24, 2016 -BMR
// - when a failure returned by the C API, the functions will call
// throwException, which is a pure virtual function and is implemented
// by H5File to throw a FileIException and by Group to throw a
@@ -722,29 +721,29 @@ DataSpace H5Location::getRegion(void *ref, H5R_type_t ref_type) const
// is kept in those methods as well. Sep 17, 2016 -BMR
//--------------------------------------------------------------------------
-// Function: H5Location::createGroup
-///\brief Creates a new group at this location which can be a file
-/// or another group.
-///\param name - IN: Name of the group to create
-///\param size_hint - IN: Indicates the number of bytes to reserve for
-/// the names that will appear in the group
-///\return Group instance
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::createGroup
+///\brief Creates a new group at this location which can be a file
+/// or another group.
+///\param name - IN: Name of the group to create
+///\param size_hint - IN: Indicates the number of bytes to reserve for
+/// the names that will appear in the group
+///\return Group instance
+///\exception H5::FileIException or H5::GroupIException
///\par Description
-/// The optional \a size_hint specifies how much file space to
-/// reserve for storing the names that will appear in this new
-/// group. If a non-positive value is provided for the \a size_hint
-/// then a default size is chosen.
-// Programmer Binh-Minh Ribler - 2000
+/// The optional \a size_hint specifies how much file space to
+/// reserve for storing the names that will appear in this new
+/// group. If a non-positive value is provided for the \a size_hint
+/// then a default size is chosen.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group H5Location::createGroup( const char* name, size_t size_hint ) const
+Group H5Location::createGroup(const char* name, size_t size_hint) const
{
// Group creation property list for size hint
hid_t gcpl_id = 0;
// Set the local heap size hint
if (size_hint > 0)
- {
+ {
// If the creation of the property list failed, throw an exception
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
throwException("createGroup", "H5Pcreate failed");
@@ -755,351 +754,351 @@ Group H5Location::createGroup( const char* name, size_t size_hint ) const
}
}
- // Call C routine H5Gcreate2 to create the named group, giving the
- // location id which can be a file id or a group id
- hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT );
+ // Call C routine H5Gcreate2 to create the named group, giving the
+ // location id which can be a file id or a group id
+ hid_t group_id = H5Gcreate2(getId(), name, H5P_DEFAULT, gcpl_id, H5P_DEFAULT);
- // Close the group creation property list, if necessary
- if(gcpl_id > 0)
+ // Close the group creation property list, if necessary
+ if(gcpl_id > 0)
H5Pclose(gcpl_id);
- // If the creation of the group failed, throw an exception
- if( group_id < 0 )
- throwException("createGroup", "H5Gcreate2 failed");
+ // If the creation of the group failed, throw an exception
+ if (group_id < 0)
+ throwException("createGroup", "H5Gcreate2 failed");
- // No failure, create and return the Group object
- Group group;
- //group.p_setId(group_id);
- H5Location *ptr = &group;
- ptr->p_setId(group_id);
- return( group );
+ // No failure, create and return the Group object
+ Group group;
+ //group.p_setId(group_id);
+ H5Location *ptr = &group;
+ ptr->p_setId(group_id);
+ return(group);
}
//--------------------------------------------------------------------------
-// Function: H5Location::createGroup
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::createGroup
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group H5Location::createGroup( const H5std_string& name, size_t size_hint ) const
+Group H5Location::createGroup(const H5std_string& name, size_t size_hint) const
{
- return( createGroup( name.c_str(), size_hint ));
+ return(createGroup( name.c_str(), size_hint));
}
//--------------------------------------------------------------------------
-// Function: H5Location::openGroup
-///\brief Opens an existing group in a location which can be a file
-/// or another group.
-///\param name - IN: Name of the group to open
-///\return Group instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::openGroup
+///\brief Opens an existing group in a location which can be a file
+/// or another group.
+///\param name - IN: Name of the group to open
+///\return Group instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group H5Location::openGroup( const char* name ) const
+Group H5Location::openGroup(const char* name) const
{
- // Call C routine H5Gopen2 to open the named group, giving the
- // location id which can be a file id or a group id
- hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT );
+ // Call C routine H5Gopen2 to open the named group, giving the
+ // location id which can be a file id or a group id
+ hid_t group_id = H5Gopen2(getId(), name, H5P_DEFAULT);
- // If the opening of the group failed, throw an exception
- if( group_id < 0 )
- throwException("openGroup", "H5Gopen2 failed");
+ // If the opening of the group failed, throw an exception
+ if (group_id < 0)
+ throwException("openGroup", "H5Gopen2 failed");
- // No failure, create and return the Group object
- Group group;
- //group.p_setId(group_id);
- H5Location *ptr = &group;
- ptr->p_setId(group_id);
- return( group );
+ // No failure, create and return the Group object
+ Group group;
+ //group.p_setId(group_id);
+ H5Location *ptr = &group;
+ ptr->p_setId(group_id);
+ return(group);
}
//--------------------------------------------------------------------------
-// Function: H5Location::openGroup
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::openGroup
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Group H5Location::openGroup( const H5std_string& name ) const
+Group H5Location::openGroup(const H5std_string& name) const
{
- return( openGroup( name.c_str() ));
+ return(openGroup( name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: H5Location::createDataSet
-///\brief Creates a new dataset at this location.
-///\param name - IN: Name of the dataset to create
-///\param data_type - IN: Datatype of the dataset
-///\param data_space - IN: Dataspace for the dataset
-///\param create_plist - IN: Creation properly list for the dataset
-///\return DataSet instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::createDataSet
+///\brief Creates a new dataset at this location.
+///\param name - IN: Name of the dataset to create
+///\param data_type - IN: Datatype of the dataset
+///\param data_space - IN: Dataspace for the dataset
+///\param create_plist - IN: Creation properly list for the dataset
+///\return DataSet instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSet H5Location::createDataSet( const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
+DataSet H5Location::createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist) const
{
// Obtain identifiers for C API
- hid_t type_id = data_type.getId();
- hid_t space_id = data_space.getId();
- hid_t create_plist_id = create_plist.getId();
+ hid_t type_id = data_type.getId();
+ hid_t space_id = data_space.getId();
+ hid_t create_plist_id = create_plist.getId();
- // Call C routine H5Dcreate2 to create the named dataset
- hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT );
+ // Call C routine H5Dcreate2 to create the named dataset
+ hid_t dataset_id = H5Dcreate2(getId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT);
- // If the creation of the dataset failed, throw an exception
- if( dataset_id < 0 )
- throwException("createDataSet", "H5Dcreate2 failed");
+ // If the creation of the dataset failed, throw an exception
+ if (dataset_id < 0)
+ throwException("createDataSet", "H5Dcreate2 failed");
- // No failure, create and return the DataSet object
- DataSet dataset;
- f_DataSet_setId(&dataset, dataset_id);
- return( dataset );
+ // No failure, create and return the DataSet object
+ DataSet dataset;
+ f_DataSet_setId(&dataset, dataset_id);
+ return(dataset);
}
//--------------------------------------------------------------------------
-// Function: H5Location::createDataSet
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::createDataSet
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSet H5Location::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const
+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));
}
//--------------------------------------------------------------------------
-// Function: H5Location::openDataSet
-///\brief Opens an existing dataset at this location.
-///\param name - IN: Name of the dataset to open
-///\return DataSet instance
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::openDataSet
+///\brief Opens an existing dataset at this location.
+///\param name - IN: Name of the dataset to open
+///\return DataSet instance
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSet H5Location::openDataSet( const char* name ) const
+DataSet H5Location::openDataSet(const char* name) const
{
- // Call C function H5Dopen2 to open the specified dataset, giving
- // the location id and the dataset's name
- hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT );
+ // Call C function H5Dopen2 to open the specified dataset, giving
+ // the location id and the dataset's name
+ hid_t dataset_id = H5Dopen2(getId(), name, H5P_DEFAULT);
- // If the dataset's opening failed, throw an exception
- if(dataset_id < 0)
- throwException("openDataSet", "H5Dopen2 failed");
+ // If the dataset's opening failed, throw an exception
+ if(dataset_id < 0)
+ throwException("openDataSet", "H5Dopen2 failed");
- // No failure, create and return the DataSet object
- DataSet dataset;
- f_DataSet_setId(&dataset, dataset_id);
- return( dataset );
+ // No failure, create and return the DataSet object
+ DataSet dataset;
+ f_DataSet_setId(&dataset, dataset_id);
+ return(dataset);
}
//--------------------------------------------------------------------------
-// Function: H5Location::openDataSet
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::openDataSet
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-DataSet H5Location::openDataSet( const H5std_string& name ) const
+DataSet H5Location::openDataSet(const H5std_string& name) const
{
- return( openDataSet( name.c_str() ));
+ return(openDataSet( name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: H5Location::link
-///\brief Creates a link of the specified type from \a new_name to
-/// \a curr_name.
-///\param link_type - IN: Link type; possible values are
-/// \li \c H5G_LINK_HARD
-/// \li \c H5G_LINK_SOFT
-///\param curr_name - IN: Name of the existing object if link is a hard
-/// link; can be anything for the soft link
-///\param new_name - IN: New name for the object
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::link
+///\brief Creates a link of the specified type from \a new_name to
+/// \a curr_name.
+///\param link_type - IN: Link type; possible values are
+/// \li \c H5G_LINK_HARD
+/// \li \c H5G_LINK_SOFT
+///\param curr_name - IN: Name of the existing object if link is a hard
+/// link; can be anything for the soft link
+///\param new_name - IN: New name for the object
+///\exception H5::FileIException or H5::GroupIException
///\par Description
-/// Note that both names are interpreted relative to the
-/// specified location.
-/// For information on creating hard link and soft link, please
-/// refer to the C layer Reference Manual at:
+/// Note that both names are interpreted relative to the
+/// specified location.
+/// For information on creating hard link and soft link, please
+/// refer to the C layer Reference Manual at:
/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateHard and
/// http://hdfgroup.org/HDF5/doc/RM/RM_H5L.html#Link-CreateSoft
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// 2007: QAK modified to use H5L APIs - BMR
+// 2007: QAK modified to use H5L APIs - BMR
//--------------------------------------------------------------------------
-void H5Location::link( H5L_type_t link_type, const char* curr_name, const char* new_name ) const
+void H5Location::link(H5L_type_t link_type, const char* curr_name, const char* new_name) const
{
herr_t ret_value = -1;
switch(link_type) {
case H5L_TYPE_HARD:
- ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT );
+ ret_value = H5Lcreate_hard(getId(), curr_name, H5L_SAME_LOC, new_name, H5P_DEFAULT, H5P_DEFAULT);
break;
case H5L_TYPE_SOFT:
- ret_value = H5Lcreate_soft( curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT );
+ ret_value = H5Lcreate_soft(curr_name,getId(), new_name, H5P_DEFAULT, H5P_DEFAULT);
break;
- case H5L_TYPE_ERROR:
- case H5L_TYPE_EXTERNAL:
- case H5L_TYPE_MAX:
+ case H5L_TYPE_ERROR:
+ case H5L_TYPE_EXTERNAL:
+ case H5L_TYPE_MAX:
default:
throwException("link", "unknown link type");
break;
} /* end switch */
- if( ret_value < 0 )
- throwException("link", "creating link failed");
+ if (ret_value < 0)
+ throwException("link", "creating link failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::link
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a curr_name and \a new_name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::link
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a curr_name and \a new_name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const
+void H5Location::link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const
{
- link( link_type, curr_name.c_str(), new_name.c_str() );
+ link(link_type, curr_name.c_str(), new_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Location::unlink
-///\brief Removes the specified name at this location.
-///\param name - IN: Name of the object to be removed
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::unlink
+///\brief Removes the specified name at this location.
+///\param name - IN: Name of the object to be removed
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// 2007: QAK modified to use H5L APIs - BMR
+// 2007: QAK modified to use H5L APIs - BMR
//--------------------------------------------------------------------------
-void H5Location::unlink( const char* name ) const
+void H5Location::unlink(const char* name) const
{
- herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT );
- if( ret_value < 0 )
- throwException("unlink", "H5Ldelete failed");
+ herr_t ret_value = H5Ldelete(getId(), name, H5P_DEFAULT);
+ if (ret_value < 0)
+ throwException("unlink", "H5Ldelete failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::unlink
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::unlink
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::unlink( const H5std_string& name ) const
+void H5Location::unlink(const H5std_string& name) const
{
- unlink( name.c_str() );
+ unlink(name.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Location::move
-///\brief Renames an object at this location.
-///\param src - IN: Object's original name
-///\param dst - IN: Object's new name
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::move
+///\brief Renames an object at this location.
+///\param src - IN: Object's original name
+///\param dst - IN: Object's new name
+///\exception H5::FileIException or H5::GroupIException
///\note
-/// Exercise care in moving groups as it is possible to render
-/// data in a file inaccessible with H5Location::move. Please refer
-/// to the Group Interface in the HDF5 User's Guide for details at:
+/// Exercise care in moving groups as it is possible to render
+/// data in a file inaccessible with H5Location::move. Please refer
+/// to the Group Interface in the HDF5 User's Guide for details at:
/// https://www.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FGroups%2FHDF5_Groups.htm
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// 2007: QAK modified to use H5L APIs - BMR
+// 2007: QAK modified to use H5L APIs - BMR
//--------------------------------------------------------------------------
-void H5Location::move( const char* src, const char* dst ) const
+void H5Location::move(const char* src, const char* dst) const
{
- herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT );
- if( ret_value < 0 )
- throwException("move", "H5Lmove failed");
+ herr_t ret_value = H5Lmove(getId(), src, H5L_SAME_LOC, dst, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret_value < 0)
+ throwException("move", "H5Lmove failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::move
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a src and \a dst.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::move
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a src and \a dst.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::move( const H5std_string& src, const H5std_string& dst ) const
+void H5Location::move(const H5std_string& src, const H5std_string& dst) const
{
- move( src.c_str(), dst.c_str() );
+ move(src.c_str(), dst.c_str());
}
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------
-// Function: H5Location::getObjinfo
-///\brief Returns information about an object.
-///\param name - IN: Name of the object
-///\param follow_link - IN: Link flag
-///\param statbuf - OUT: Buffer to return information about the object
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::getObjinfo
+///\brief Returns information about an object.
+///\param name - IN: Name of the object
+///\param follow_link - IN: Link flag
+///\param statbuf - OUT: Buffer to return information about the object
+///\exception H5::FileIException or H5::GroupIException
///\par Description
-/// For more information, please refer to the C layer Reference
-/// Manual at:
+/// For more information, please refer to the C layer Reference
+/// Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const
+void H5Location::getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const
{
- herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf );
- if( ret_value < 0 )
- throwException("getObjinfo", "H5Gget_objinfo failed");
+ herr_t ret_value = H5Gget_objinfo(getId(), name, follow_link, &statbuf);
+ if (ret_value < 0)
+ throwException("getObjinfo", "H5Gget_objinfo failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjinfo
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::getObjinfo
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const
+void H5Location::getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const
{
- getObjinfo( name.c_str(), follow_link, statbuf );
+ getObjinfo(name.c_str(), follow_link, statbuf);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjinfo
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above functions in that it doesn't have
-/// the paramemter \a follow_link.
-// Programmer Binh-Minh Ribler - Nov, 2005
+// Function: H5Location::getObjinfo
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above functions in that it doesn't have
+/// the paramemter \a follow_link.
+// Programmer Binh-Minh Ribler - Nov, 2005
// Note: need to modify to use H5Oget_info and H5Lget_info - BMR
//--------------------------------------------------------------------------
-void H5Location::getObjinfo( const char* name, H5G_stat_t& statbuf ) const
+void H5Location::getObjinfo(const char* name, H5G_stat_t& statbuf) const
{
- herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf );
- if( ret_value < 0 )
- throwException("getObjinfo", "H5Gget_objinfo failed");
+ herr_t ret_value = H5Gget_objinfo(getId(), name, 0, &statbuf);
+ if (ret_value < 0)
+ throwException("getObjinfo", "H5Gget_objinfo failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjinfo
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - Nov, 2005
+// Function: H5Location::getObjinfo
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - Nov, 2005
//--------------------------------------------------------------------------
-void H5Location::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const
+void H5Location::getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const
{
- getObjinfo( name.c_str(), statbuf );
+ getObjinfo(name.c_str(), statbuf);
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
-// Function: H5Location::getLinkval
-///\brief Returns the name of the object that the symbolic link points to.
-///\param name - IN: Symbolic link to the object
-///\param size - IN: Maximum number of characters of value to be returned
-///\return Name of the object
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::getLinkval
+///\brief Returns the name of the object that the symbolic link points to.
+///\param name - IN: Symbolic link to the object
+///\param size - IN: Maximum number of characters of value to be returned
+///\return Name of the object
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string H5Location::getLinkval( const char* name, size_t size ) const
+H5std_string H5Location::getLinkval(const char* name, size_t size) const
{
H5L_info_t linkinfo;
- char *value_C; // value in C string
+ char *value_C; // value in C string
size_t val_size = size;
H5std_string value = "";
herr_t ret_value;
@@ -1107,81 +1106,81 @@ H5std_string H5Location::getLinkval( const char* name, size_t size ) const
// if user doesn't provide buffer size, determine it
if (size == 0)
{
- ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT);
- if( ret_value < 0 )
- throwException("getLinkval", "H5Lget_info to find buffer size failed");
+ ret_value = H5Lget_info(getId(), name, &linkinfo, H5P_DEFAULT);
+ if (ret_value < 0)
+ throwException("getLinkval", "H5Lget_info to find buffer size failed");
- val_size = linkinfo.u.val_size;
+ val_size = linkinfo.u.val_size;
}
// if link has value, retrieve the value, otherwise, return null string
if (val_size > 0)
{
- value_C = new char[val_size+1]; // temporary C-string for C API
- HDmemset(value_C, 0, val_size+1); // clear buffer
-
- ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT);
- if( ret_value < 0 )
- {
- delete []value_C;
- throwException("getLinkval", "H5Lget_val failed");
- }
-
- value = H5std_string(value_C);
- delete []value_C;
+ value_C = new char[val_size+1]; // temporary C-string for C API
+ HDmemset(value_C, 0, val_size+1); // clear buffer
+
+ ret_value = H5Lget_val(getId(), name, value_C, val_size, H5P_DEFAULT);
+ if (ret_value < 0)
+ {
+ delete []value_C;
+ throwException("getLinkval", "H5Lget_val failed");
+ }
+
+ value = H5std_string(value_C);
+ delete []value_C;
}
return(value);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getLinkval
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::getLinkval
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5std_string H5Location::getLinkval( const H5std_string& name, size_t size ) const
+H5std_string H5Location::getLinkval(const H5std_string& name, size_t size) const
{
- return( getLinkval( name.c_str(), size ));
+ return(getLinkval( name.c_str(), size));
}
//--------------------------------------------------------------------------
-// Function: H5Location::mount
-///\brief Mounts the file \a child onto this group.
-///\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 - 2014 (original 2000)
+// Function: H5Location::mount
+///\brief Mounts the file \a child onto this group.
+///\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 - 2014 (original 2000)
//--------------------------------------------------------------------------
-void H5Location::mount(const char* name, const H5File& child, const PropList& plist ) const
+void H5Location::mount(const char* name, const H5File& child, const PropList& plist) const
{
- // Obtain identifiers for C API
- hid_t plist_id = plist.getId();
- hid_t child_id = child.getId();
+ // Obtain identifiers for C API
+ hid_t plist_id = plist.getId();
+ hid_t child_id = child.getId();
- // Call C routine H5Fmount to do the mouting
- herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id );
+ // Call C routine H5Fmount to do the mouting
+ herr_t ret_value = H5Fmount(getId(), name, child_id, plist_id);
- // Raise exception if H5Fmount returns negative value
- if( ret_value < 0 )
- throwException("mount", "H5Fmount failed");
+ // Raise exception if H5Fmount returns negative value
+ if (ret_value < 0)
+ throwException("mount", "H5Fmount failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::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
+// Function: H5Location::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
+// 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 H5Location::mount(const char* name, H5File& child, PropList& plist) const
//{
@@ -1189,26 +1188,26 @@ void H5Location::mount(const char* name, const H5File& child, const PropList& pl
//}
//--------------------------------------------------------------------------
-// Function: H5Location::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
+// Function: H5Location::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
//--------------------------------------------------------------------------
void H5Location::mount(const H5std_string& name, const H5File& child, const PropList& plist) const
{
- mount(name.c_str(), child, plist);
+ mount(name.c_str(), child, plist);
}
//--------------------------------------------------------------------------
-// Function: H5Location::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
+// Function: H5Location::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
+// 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 H5Location::mount(const H5std_string& name, H5File& child, PropList& plist) const
//{
@@ -1216,109 +1215,109 @@ void H5Location::mount(const H5std_string& name, const H5File& child, const Prop
//}
//--------------------------------------------------------------------------
-// Function: H5Location::unmount
-///\brief Unmounts the specified file.
-///\param name - IN: Name of the file to unmount
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::unmount
+///\brief Unmounts the specified file.
+///\param name - IN: Name of the file to unmount
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::unmount( const char* name ) const
+void H5Location::unmount(const char* name) const
{
- // Call C routine H5Fmount to do the mouting
- herr_t ret_value = H5Funmount(getId(), name );
+ // Call C routine H5Fmount to do the mouting
+ herr_t ret_value = H5Funmount(getId(), name);
- // Raise exception if H5Funmount returns negative value
- if( ret_value < 0 )
- throwException("unmount", "H5Funmount failed");
+ // Raise exception if H5Funmount returns negative value
+ if (ret_value < 0)
+ throwException("unmount", "H5Funmount failed");
}
//--------------------------------------------------------------------------
-// Function: H5Location::unmount
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::unmount
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Location::unmount( const H5std_string& name ) const
+void H5Location::unmount(const H5std_string& name) const
{
- unmount( name.c_str() );
+ unmount(name.c_str());
}
#ifndef H5_NO_DEPRECATED_SYMBOLS
//--------------------------------------------------------------------------
-// Function: H5Location::iterateElems
-///\brief Iterates a user's function over the entries of a group.
-///\param name - IN : Name of group to iterate over
-///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
-///\param op - IN : User's function to operate on each entry
-///\param op_data - IN/OUT: Data associated with the operation
-///\return The return value of the first operator that returns non-zero,
-/// or zero if all members were processed with no operator
-/// returning non-zero.
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::iterateElems
+///\brief Iterates a user's function over the entries of a group.
+///\param name - IN : Name of group to iterate over
+///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices
+///\param op - IN : User's function to operate on each entry
+///\param op_data - IN/OUT: Data associated with the operation
+///\return The return value of the first operator that returns non-zero,
+/// or zero if all members were processed with no operator
+/// returning non-zero.
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int H5Location::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* op_data )
+int H5Location::iterateElems(const char* name, int *idx, H5G_iterate_t op , void* op_data)
{
- int ret_value = H5Giterate(getId(), name, idx, op, op_data );
- if( ret_value < 0 )
- {
- throwException("iterateElems", "H5Giterate failed");
- }
- return( ret_value );
+ int ret_value = H5Giterate(getId(), name, idx, op, op_data);
+ if (ret_value < 0)
+ {
+ throwException("iterateElems", "H5Giterate failed");
+ }
+ return(ret_value);
}
//--------------------------------------------------------------------------
-// Function: H5Location::iterateElems
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location::iterateElems
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int H5Location::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data )
+int H5Location::iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data)
{
- return( iterateElems( name.c_str(), idx, op, op_data ));
+ return(iterateElems( name.c_str(), idx, op, op_data));
}
#endif /* H5_NO_DEPRECATED_SYMBOLS */
//--------------------------------------------------------------------------
-// Function: H5Location::getNumObjs
-///\brief Returns the number of objects in this group.
-///\return Number of objects
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - January, 2003
+// Function: H5Location::getNumObjs
+///\brief Returns the number of objects in this group.
+///\return Number of objects
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
//--------------------------------------------------------------------------
hsize_t H5Location::getNumObjs() const
{
- H5G_info_t ginfo; /* Group information */
+ H5G_info_t ginfo; // Group information
- herr_t ret_value = H5Gget_info(getId(), &ginfo);
- if(ret_value < 0)
- throwException("getNumObjs", "H5Gget_info failed");
- return (ginfo.nlinks);
+ herr_t ret_value = H5Gget_info(getId(), &ginfo);
+ if(ret_value < 0)
+ throwException("getNumObjs", "H5Gget_info failed");
+ return (ginfo.nlinks);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjnameByIdx
-///\brief Returns the name of an object in this group, given the
-/// object's index.
-///\param idx - IN: Transient index of the object
-///\return Object name
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::getObjnameByIdx
+///\brief Returns the name of an object in this group, given the
+/// object's index.
+///\param idx - IN: Transient index of the object
+///\return Object name
+///\exception H5::FileIException or H5::GroupIException
///\par Description
-/// The value of idx can be any nonnegative number less than the
-/// total number of objects in the group, which is returned by
-/// the function \c H5Location::getNumObjs. Note that this is a
-/// transient index; thus, an object may have a different index
-/// each time the group is opened.
-// Programmer Binh-Minh Ribler - Mar, 2005
+/// The value of idx can be any nonnegative number less than the
+/// total number of objects in the group, which is returned by
+/// the function \c H5Location::getNumObjs. Note that this is a
+/// transient index; thus, an object may have a different index
+/// each time the group is opened.
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
H5std_string H5Location::getObjnameByIdx(hsize_t idx) const
{
// call H5Lget_name_by_idx with name as NULL to get its length
ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, NULL, 0, H5P_DEFAULT);
if(name_len < 0)
- throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
+ throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
// now, allocate C buffer to get the name
char* name_C = new char[name_len+1];
@@ -1328,8 +1327,8 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const
if (name_len < 0)
{
- delete []name_C;
- throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
+ delete []name_C;
+ throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
}
// clean up and return the string
@@ -1339,74 +1338,74 @@ H5std_string H5Location::getObjnameByIdx(hsize_t idx) const
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjnameByIdx
-///\brief Retrieves the name of an object in this group, given the
-/// object's index.
-///\param idx - IN: Transient index of the object
-///\param name - IN/OUT: Retrieved name of the object
-///\param size - IN: Length to retrieve
-///\return Actual size of the object name or 0, if object has no name
-///\exception H5::FileIException or H5::GroupIException
+// Function: H5Location::getObjnameByIdx
+///\brief Retrieves the name of an object in this group, given the
+/// object's index.
+///\param idx - IN: Transient index of the object
+///\param name - IN/OUT: Retrieved name of the object
+///\param size - IN: Length to retrieve
+///\return Actual size of the object name or 0, if object has no name
+///\exception H5::FileIException or H5::GroupIException
///\par Description
-/// The value of idx can be any nonnegative number less than the
-/// total number of objects in the group, which is returned by
-/// the function \c H5Location::getNumObjs. Note that this is a
-/// transient index; thus, an object may have a different index
-/// each time the group is opened.
-// Programmer Binh-Minh Ribler - January, 2003
+/// The value of idx can be any nonnegative number less than the
+/// total number of objects in the group, which is returned by
+/// the function \c H5Location::getNumObjs. Note that this is a
+/// transient index; thus, an object may have a different index
+/// each time the group is opened.
+// Programmer Binh-Minh Ribler - January, 2003
//--------------------------------------------------------------------------
ssize_t H5Location::getObjnameByIdx(hsize_t idx, char* name, size_t size) const
{
- ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT);
- if(name_len < 0)
- throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
+ ssize_t name_len = H5Lget_name_by_idx(getId(), ".", H5_INDEX_NAME, H5_ITER_INC, idx, name, size, H5P_DEFAULT);
+ if(name_len < 0)
+ throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
- return (name_len);
+ return (name_len);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjnameByIdx
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes an
-/// \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - January, 2003
+// Function: H5Location::getObjnameByIdx
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes an
+/// \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - January, 2003
//--------------------------------------------------------------------------
ssize_t H5Location::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const
{
- char* name_C = new char[size+1]; // temporary C-string for object name
- HDmemset(name_C, 0, size+1); // clear buffer
+ char* name_C = new char[size+1]; // temporary C-string for object name
+ HDmemset(name_C, 0, size+1); // clear buffer
- // call overloaded function to get the name
- ssize_t name_len = getObjnameByIdx(idx, name_C, size+1);
- if(name_len < 0)
- {
+ // call overloaded function to get the name
+ ssize_t name_len = getObjnameByIdx(idx, name_C, size+1);
+ if(name_len < 0)
+ {
delete []name_C;
- throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
- }
-
- // clean up and return the string
- name = H5std_string(name_C);
- delete []name_C;
- return (name_len);
-}
-
-//--------------------------------------------------------------------------
-// Function: H5Location::childObjType
-///\brief Returns the type of an object in this file/group, given the
-/// object's name.
-///\param objname - IN: Name of the object
-///\return Object type, which can have the following values for group,
-/// dataset, and named datatype
-/// \li \c H5O_TYPE_GROUP
-/// \li \c H5O_TYPE_DATASET
-/// \li \c H5O_TYPE_NAMED_DATATYPE
-/// Refer to the C API documentation for more details:
-/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
-///\exception H5::FileIException or H5::GroupIException
-/// Exception will be thrown when:
-/// - an error returned by the C API
-/// - object type is not one of the valid values above
-// Programmer Binh-Minh Ribler - April, 2014
+ throwException("getObjnameByIdx", "H5Lget_name_by_idx failed");
+ }
+
+ // clean up and return the string
+ name = H5std_string(name_C);
+ delete []name_C;
+ return (name_len);
+}
+
+//--------------------------------------------------------------------------
+// Function: H5Location::childObjType
+///\brief Returns the type of an object in this file/group, given the
+/// object's name.
+///\param objname - IN: Name of the object
+///\return Object type, which can have the following values for group,
+/// dataset, and named datatype
+/// \li \c H5O_TYPE_GROUP
+/// \li \c H5O_TYPE_DATASET
+/// \li \c H5O_TYPE_NAMED_DATATYPE
+/// Refer to the C API documentation for more details:
+/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
+///\exception H5::FileIException or H5::GroupIException
+/// Exception will be thrown when:
+/// - an error returned by the C API
+/// - object type is not one of the valid values above
+// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
H5O_type_t H5Location::childObjType(const char* objname) const
{
@@ -1418,33 +1417,33 @@ H5O_type_t H5Location::childObjType(const char* objname) const
// Throw exception if C API returns failure
if (ret_value < 0)
- throwException("childObjType", "H5Oget_info_by_name failed");
+ throwException("childObjType", "H5Oget_info_by_name failed");
// Return a valid type or throw an exception for unknown type
else
- switch (objinfo.type)
- {
- case H5O_TYPE_GROUP:
- case H5O_TYPE_DATASET:
- case H5O_TYPE_NAMED_DATATYPE:
- objtype = objinfo.type;
- break;
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- throwException("childObjType", "Unknown type of object");
- }
+ switch (objinfo.type)
+ {
+ case H5O_TYPE_GROUP:
+ case H5O_TYPE_DATASET:
+ case H5O_TYPE_NAMED_DATATYPE:
+ objtype = objinfo.type;
+ break;
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ throwException("childObjType", "Unknown type of object");
+ }
return(objtype);
}
//--------------------------------------------------------------------------
-// Function: H5Location::childObjType
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes an \a H5std_string for the object's name.
-///\brief Returns the type of an object in this group, given the
-/// object's name.
-///\param objname - IN: Name of the object (H5std_string&)
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - April, 2014
+// Function: H5Location::childObjType
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes an \a H5std_string for the object's name.
+///\brief Returns the type of an object in this group, given the
+/// object's name.
+///\param objname - IN: Name of the object (H5std_string&)
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
H5O_type_t H5Location::childObjType(const H5std_string& objname) const
{
@@ -1454,33 +1453,33 @@ H5O_type_t H5Location::childObjType(const H5std_string& objname) const
}
//--------------------------------------------------------------------------
-// Function: H5Location::childObjType
-///\brief Returns the type of an object in this file/group, given the
-/// object's index and its type and order.
-///\param index - IN: Position of the object
-///\param index_type - IN: Type of the index, default to H5_INDEX_NAME
-///\param order - IN: Traversing order, default to H5_ITER_INC
-///\param objname - IN: Name of the object, default to "."
-///\return Object type, which can have the following values for group,
-/// dataset, and named datatype
-/// \li \c H5O_TYPE_GROUP
-/// \li \c H5O_TYPE_DATASET
-/// \li \c H5O_TYPE_NAMED_DATATYPE
-/// Refer to the C API documentation for more details:
-/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
-///\exception H5::FileIException or H5::GroupIException
-/// Exception will be thrown when:
-/// - an error returned by the C API
-/// - object type is not one of the valid values above
+// Function: H5Location::childObjType
+///\brief Returns the type of an object in this file/group, given the
+/// object's index and its type and order.
+///\param index - IN: Position of the object
+///\param index_type - IN: Type of the index, default to H5_INDEX_NAME
+///\param order - IN: Traversing order, default to H5_ITER_INC
+///\param objname - IN: Name of the object, default to "."
+///\return Object type, which can have the following values for group,
+/// dataset, and named datatype
+/// \li \c H5O_TYPE_GROUP
+/// \li \c H5O_TYPE_DATASET
+/// \li \c H5O_TYPE_NAMED_DATATYPE
+/// Refer to the C API documentation for more details:
+/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5O.html#Object-GetInfo
+///\exception H5::FileIException or H5::GroupIException
+/// Exception will be thrown when:
+/// - an error returned by the C API
+/// - object type is not one of the valid values above
// Developer's Notes:
-// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name
-// like the previous childObjType()
-// - index is the required argument so, first
-// - objname is last because it's more likely the location is already
-// fully specified
-// - Leave property list out for now because C API is not using it, it
-// can be added later when needed.
-// Programmer Binh-Minh Ribler - April, 2014
+// - this overload uses H5Oget_info_by_idx instead of H5Oget_info_by_name
+// like the previous childObjType()
+// - index is the required argument so, first
+// - objname is last because it's more likely the location is already
+// fully specified
+// - Leave property list out for now because C API is not using it, it
+// can be added later when needed.
+// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t order, const char* objname) const
{
@@ -1493,37 +1492,37 @@ H5O_type_t H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_ite
// Throw exception if C API returns failure
if (ret_value < 0)
- throwException("childObjType", "H5Oget_info_by_idx failed");
+ throwException("childObjType", "H5Oget_info_by_idx failed");
// Return a valid type or throw an exception for unknown type
else
- switch (objinfo.type)
- {
- case H5O_TYPE_GROUP:
- case H5O_TYPE_DATASET:
- case H5O_TYPE_NAMED_DATATYPE:
- objtype = objinfo.type;
- break;
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- throwException("childObjType", "Unknown type of object");
- }
+ switch (objinfo.type)
+ {
+ case H5O_TYPE_GROUP:
+ case H5O_TYPE_DATASET:
+ case H5O_TYPE_NAMED_DATATYPE:
+ objtype = objinfo.type;
+ break;
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ throwException("childObjType", "Unknown type of object");
+ }
return(objtype);
}
//--------------------------------------------------------------------------
-// Function: H5Location::childObjVersion
-///\brief Returns the object header version of an object in this file/group,
-/// given the object's name.
-///\param objname - IN: Name of the object
-///\return Object version, which can have the following values:
-/// \li \c H5O_VERSION_1
-/// \li \c H5O_VERSION_2
-///\exception H5::FileIException or H5::GroupIException
-/// Exception will be thrown when:
-/// - an error returned by the C API
-/// - version number is not one of the valid values above
-// Programmer Binh-Minh Ribler - April, 2014
+// Function: H5Location::childObjVersion
+///\brief Returns the object header version of an object in this file/group,
+/// given the object's name.
+///\param objname - IN: Name of the object
+///\return Object version, which can have the following values:
+/// \li \c H5O_VERSION_1
+/// \li \c H5O_VERSION_2
+///\exception H5::FileIException or H5::GroupIException
+/// Exception will be thrown when:
+/// - an error returned by the C API
+/// - version number is not one of the valid values above
+// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
unsigned H5Location::childObjVersion(const char* objname) const
{
@@ -1535,26 +1534,26 @@ unsigned H5Location::childObjVersion(const char* objname) const
// Throw exception if C API returns failure
if (ret_value < 0)
- throwException("childObjVersion", "H5Oget_info_by_name failed");
+ throwException("childObjVersion", "H5Oget_info_by_name failed");
// Return a valid version or throw an exception for invalid value
else
{
- version = objinfo.hdr.version;
- if (version != H5O_VERSION_1 && version != H5O_VERSION_2)
- throwException("childObjVersion", "Invalid version for object");
+ version = objinfo.hdr.version;
+ if (version != H5O_VERSION_1 && version != H5O_VERSION_2)
+ throwException("childObjVersion", "Invalid version for object");
}
return(version);
}
//--------------------------------------------------------------------------
-// Function: H5Location::childObjVersion
-///\brief This is an overloaded member function, provided for convenience.
-/// It takes an \a H5std_string for the object's name.
-///\brief Returns the type of an object in this group, given the
-/// object's name.
-///\param objname - IN: Name of the object (H5std_string&)
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - April, 2014
+// Function: H5Location::childObjVersion
+///\brief This is an overloaded member function, provided for convenience.
+/// It takes an \a H5std_string for the object's name.
+///\brief Returns the type of an object in this group, given the
+/// object's name.
+///\param objname - IN: Name of the object (H5std_string&)
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - April, 2014
//--------------------------------------------------------------------------
unsigned H5Location::childObjVersion(const H5std_string& objname) const
{
@@ -1566,35 +1565,35 @@ unsigned H5Location::childObjVersion(const H5std_string& objname) const
#ifndef H5_NO_DEPRECATED_SYMBOLS
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Location::getObjTypeByIdx
-///\brief Returns the type of an object in this group, given the
-/// object's index.
-///\param idx - IN: Transient index of the object
-///\return Object type
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - January, 2003
+// Function: H5Location::getObjTypeByIdx
+///\brief Returns the type of an object in this group, given the
+/// object's index.
+///\param idx - IN: Transient index of the object
+///\return Object type
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
//--------------------------------------------------------------------------
H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx) const
{
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx);
if (obj_type == H5G_UNKNOWN)
- throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
+ throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
return (obj_type);
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjTypeByIdx
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function because it also provides
-/// the returned object type in text (char*)
-///\param idx - IN: Transient index of the object
-///\param type_name - OUT: Object type in text
-///\return Object type
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - May, 2010
+// Function: H5Location::getObjTypeByIdx
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function because it also provides
+/// the returned object type in text (char*)
+///\param idx - IN: Transient index of the object
+///\param type_name - OUT: Object type in text
+///\return Object type
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - May, 2010
// Modification
-// Modified to use the other function. -BMR, 2016/03/07
+// Modified to use the other function. -BMR, 2016/03/07
//--------------------------------------------------------------------------
H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const
{
@@ -1602,32 +1601,32 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, char* type_name) const
return(getObjTypeByIdx(idx, stype_name));
}
//--------------------------------------------------------------------------
-// Function: H5Location::getObjTypeByIdx
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function because it also provides
-/// the returned object type in text (H5std_string&)
-///\param idx - IN: Transient index of the object
-///\param type_name - OUT: Object type in text
-///\return Object type
-///\exception H5::FileIException or H5::GroupIException
-// Programmer Binh-Minh Ribler - January, 2003
+// Function: H5Location::getObjTypeByIdx
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function because it also provides
+/// the returned object type in text (H5std_string&)
+///\param idx - IN: Transient index of the object
+///\param type_name - OUT: Object type in text
+///\return Object type
+///\exception H5::FileIException or H5::GroupIException
+// Programmer Binh-Minh Ribler - January, 2003
//--------------------------------------------------------------------------
H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const
{
H5G_obj_t obj_type = H5Gget_objtype_by_idx(getId(), idx);
switch (obj_type)
{
- case H5G_LINK: type_name = H5std_string("symbolic link"); break;
- case H5G_GROUP: type_name = H5std_string("group"); break;
- case H5G_DATASET: type_name = H5std_string("dataset"); break;
- case H5G_TYPE: type_name = H5std_string("datatype"); break;
- case H5G_UNKNOWN:
- case H5G_UDLINK:
- case H5G_RESERVED_5:
- case H5G_RESERVED_6:
- case H5G_RESERVED_7:
- default:
- throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
+ case H5G_LINK: type_name = H5std_string("symbolic link"); break;
+ case H5G_GROUP: type_name = H5std_string("group"); break;
+ case H5G_DATASET: type_name = H5std_string("dataset"); break;
+ case H5G_TYPE: type_name = H5std_string("datatype"); break;
+ case H5G_UNKNOWN:
+ case H5G_UDLINK:
+ case H5G_RESERVED_5:
+ case H5G_RESERVED_6:
+ case H5G_RESERVED_7:
+ default:
+ throwException("getObjTypeByIdx", "H5Gget_objtype_by_idx failed");
}
return (obj_type);
}
@@ -1645,34 +1644,34 @@ H5G_obj_t H5Location::getObjTypeByIdx(hsize_t idx, H5std_string& type_name) cons
//--------------------------------------------------------------------------
void H5Location::throwException(const H5std_string& func_name, const H5std_string& msg) const
{
- throwException(func_name, msg);
+ throwException(func_name, msg);
}
//--------------------------------------------------------------------------
-// Function: f_DataSet_setId - friend
+// Function: f_DataSet_setId - friend
// Modification:
-// Moved to H5CommonFG.cpp after the rearrangement of classes
-// -BMR, Dec 2016
+// Moved to H5CommonFG.cpp after the rearrangement of classes
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
// end of From H5CommonFG.cpp
//--------------------------------------------------------------------------
-// Function: f_Attribute_setId - friend
+// Function: f_Attribute_setId - friend
// Modification:
-// Moved to H5Object.cpp after the rearrangement of classes
-// -BMR, Dec 2016
+// Moved to H5Object.cpp after the rearrangement of classes
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
-// Function: f_DataSpace_setId - friend
-// Purpose: This function is friend to class H5::DataSpace so that it can
-// can set DataSpace::id in order to work around a problem
-// described in the JIRA issue HDFFV-7947.
-// Applications shouldn't need to use it.
-// param dspace - IN/OUT: DataSpace object to be changed
-// param new_id - IN: New id to set
-// Programmer Binh-Minh Ribler - 2015
+// Function: f_DataSpace_setId - friend
+// Purpose This function is friend to class H5::DataSpace so that it can
+// can set DataSpace::id in order to work around a problem
+// described in the JIRA issue HDFFV-7947.
+// Applications shouldn't need to use it.
+// param dspace - IN/OUT: DataSpace object to be changed
+// param new_id - IN: New id to set
+// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void f_DataSpace_setId(DataSpace* dspace, hid_t new_id)
{
@@ -1680,9 +1679,9 @@ void f_DataSpace_setId(DataSpace* dspace, hid_t new_id)
}
//--------------------------------------------------------------------------
-// Function: H5Location destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Location destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Location::~H5Location() {}
diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h
index 6a449dc..337a2b3 100644
--- a/c++/src/H5Location.h
+++ b/c++/src/H5Location.h
@@ -17,7 +17,7 @@
#ifndef __H5Location_H
#define __H5Location_H
-#include "H5Classes.h" // constains forward class declarations
+#include "H5Classes.h" // constains forward class declarations
namespace H5 {
@@ -37,188 +37,188 @@ class H5_DLLCPP LinkAccPropList;
class H5_DLLCPP VarLenType;
class H5_DLLCPP H5Location : public IdComponent {
public:
- // Checks if a link of a given name exists in a location
- bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ // Checks if a link of a given name exists in a location
+ bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
+ bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const;
- // Flushes all buffers associated with this location to disk.
- void flush( H5F_scope_t scope ) const;
+ // Flushes all buffers associated with this location to disk.
+ void flush(H5F_scope_t scope) const;
- // Gets the name of the file, specified by this location.
- H5std_string getFileName() const;
+ // Gets the name of the file, specified by this location.
+ H5std_string getFileName() const;
#ifndef H5_NO_DEPRECATED_SYMBOLS
- // Retrieves the type of object that an object reference points to.
- H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
+ // Retrieves the type of object that an object reference points to.
+ H5G_obj_t getObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- // Retrieves the type of object that an object reference points to.
- H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
- // Note: getRefObjType deprecates getObjType, but getObjType's name is
- // misleading, so getRefObjType is used in the new function instead.
-
- // Sets the comment for an HDF5 object specified by its name.
- void setComment(const char* name, const char* comment) const;
- void setComment(const H5std_string& name, const H5std_string& comment) const;
- void setComment(const char* comment) const;
- void setComment(const H5std_string& comment) const;
-
- // Retrieves comment for the HDF5 object specified by its name.
- ssize_t getComment(const char* name, size_t buf_size, char* comment) const;
- H5std_string getComment(const char* name, size_t buf_size=0) const;
- H5std_string getComment(const H5std_string& name, size_t buf_size=0) const;
-
- // Removes the comment for the HDF5 object specified by its name.
- void removeComment(const char* name) const;
- void removeComment(const H5std_string& name) const;
-
- // Creates a reference to a named object or to a dataset region
- // in this object.
- void reference(void* ref, const char* name,
- H5R_type_t ref_type = H5R_OBJECT) const;
- void reference(void* ref, const H5std_string& name,
- H5R_type_t ref_type = H5R_OBJECT) const;
- void reference(void* ref, const char* name, const DataSpace& dataspace,
- H5R_type_t ref_type = H5R_DATASET_REGION) const;
- void reference(void* ref, const H5std_string& name, const DataSpace& dataspace,
- H5R_type_t ref_type = H5R_DATASET_REGION) const;
-
- // 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);
- //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.
- DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
+ // Retrieves the type of object that an object reference points to.
+ H5O_type_t getRefObjType(void *ref, H5R_type_t ref_type = H5R_OBJECT) const;
+ // Note: getRefObjType deprecates getObjType, but getObjType's name is
+ // misleading, so getRefObjType is used in the new function instead.
+
+ // Sets the comment for an HDF5 object specified by its name.
+ void setComment(const char* name, const char* comment) const;
+ void setComment(const H5std_string& name, const H5std_string& comment) const;
+ void setComment(const char* comment) const;
+ void setComment(const H5std_string& comment) const;
+
+ // Retrieves comment for the HDF5 object specified by its name.
+ ssize_t getComment(const char* name, size_t buf_size, char* comment) const;
+ H5std_string getComment(const char* name, size_t buf_size=0) const;
+ H5std_string getComment(const H5std_string& name, size_t buf_size=0) const;
+
+ // Removes the comment for the HDF5 object specified by its name.
+ void removeComment(const char* name) const;
+ void removeComment(const H5std_string& name) const;
+
+ // Creates a reference to a named object or to a dataset region
+ // in this object.
+ void reference(void* ref, const char* name,
+ H5R_type_t ref_type = H5R_OBJECT) const;
+ void reference(void* ref, const H5std_string& name,
+ H5R_type_t ref_type = H5R_OBJECT) const;
+ void reference(void* ref, const char* name, const DataSpace& dataspace,
+ H5R_type_t ref_type = H5R_DATASET_REGION) const;
+ void reference(void* ref, const H5std_string& name, const DataSpace& dataspace,
+ H5R_type_t ref_type = H5R_DATASET_REGION) const;
+
+ // 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);
+ //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.
+ DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
// From CommonFG
- // Creates a new group at this location which can be a file
- // or another group.
- Group createGroup(const char* name, size_t size_hint = 0) const;
- Group createGroup(const H5std_string& name, size_t size_hint = 0) const;
-
- // Opens an existing group in a location which can be a file
- // or another group.
- Group openGroup(const char* name) const;
- Group openGroup(const H5std_string& name) const;
-
- // Creates a new dataset in this group.
- DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
- DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
-
- // Opens an existing dataset at this location.
- DataSet openDataSet(const char* name) const;
- DataSet openDataSet(const H5std_string& name) const;
-
- // Returns the value of a symbolic link.
- H5std_string getLinkval(const char* link_name, size_t size=0) const;
- H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const;
-
- // Returns the number of objects in this group.
- hsize_t getNumObjs() const;
-
- // Retrieves the name of an object in this group, given the
- // object's index.
- H5std_string getObjnameByIdx(hsize_t idx) const;
- ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const;
- ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
-
- // Retrieves the type of an object in this file or group, given the
- // object's name
- H5O_type_t childObjType(const H5std_string& objname) const;
- H5O_type_t childObjType(const char* objname) const;
- H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const;
-
- // Returns the object header version of an object in this file or group,
- // given the object's name.
- unsigned childObjVersion(const char* objname) const;
- unsigned childObjVersion(const H5std_string& objname) const;
+ // Creates a new group at this location which can be a file
+ // or another group.
+ Group createGroup(const char* name, size_t size_hint = 0) const;
+ Group createGroup(const H5std_string& name, size_t size_hint = 0) const;
+
+ // Opens an existing group in a location which can be a file
+ // or another group.
+ Group openGroup(const char* name) const;
+ Group openGroup(const H5std_string& name) const;
+
+ // Creates a new dataset in this group.
+ DataSet createDataSet(const char* name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
+ DataSet createDataSet(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist = DSetCreatPropList::DEFAULT) const;
+
+ // Opens an existing dataset at this location.
+ DataSet openDataSet(const char* name) const;
+ DataSet openDataSet(const H5std_string& name) const;
+
+ // Returns the value of a symbolic link.
+ H5std_string getLinkval(const char* link_name, size_t size=0) const;
+ H5std_string getLinkval(const H5std_string& link_name, size_t size=0) const;
+
+ // Returns the number of objects in this group.
+ hsize_t getNumObjs() const;
+
+ // Retrieves the name of an object in this group, given the
+ // object's index.
+ H5std_string getObjnameByIdx(hsize_t idx) const;
+ ssize_t getObjnameByIdx(hsize_t idx, char* name, size_t size) const;
+ ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
+
+ // Retrieves the type of an object in this file or group, given the
+ // object's name
+ H5O_type_t childObjType(const H5std_string& objname) const;
+ H5O_type_t childObjType(const char* objname) const;
+ H5O_type_t childObjType(hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char* objname=".") const;
+
+ // Returns the object header version of an object in this file or group,
+ // given the object's name.
+ unsigned childObjVersion(const char* objname) const;
+ unsigned childObjVersion(const H5std_string& objname) const;
#ifndef H5_NO_DEPRECATED_SYMBOLS
- // Returns the type of an object in this group, given the
- // object's index.
- H5G_obj_t getObjTypeByIdx(hsize_t idx) const;
- H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const;
- H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const;
-
- // Returns information about an HDF5 object, given by its name,
- // at this location.
- void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
- void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
- void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
- void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const;
-
- // Iterates over the elements of this group - not implemented in
- // C++ style yet.
- int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
- int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data);
+ // Returns the type of an object in this group, given the
+ // object's index.
+ H5G_obj_t getObjTypeByIdx(hsize_t idx) const;
+ H5G_obj_t getObjTypeByIdx(hsize_t idx, char* type_name) const;
+ H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const;
+
+ // Returns information about an HDF5 object, given by its name,
+ // at this location.
+ void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
+ void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
+ void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
+ void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const;
+
+ // Iterates over the elements of this group - not implemented in
+ // C++ style yet.
+ int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
+ int iterateElems(const H5std_string& name, int *idx, H5G_iterate_t op, void *op_data);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- // Creates a link of the specified type from new_name to current_name;
- // both names are interpreted relative to the specified location id.
- void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const;
- void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const;
+ // Creates a link of the specified type from new_name to current_name;
+ // both names are interpreted relative to the specified location id.
+ void link(H5L_type_t link_type, const char* curr_name, const char* new_name) const;
+ void link(H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name) const;
- // Removes the specified name at this location.
- void unlink(const char* name) const;
- void unlink(const H5std_string& name) const;
+ // Removes the specified name at this location.
+ void unlink(const char* name) const;
+ void unlink(const H5std_string& name) const;
- // 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; // 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; // removed from 1.8.18 and 1.10.1
+ // 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; // 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; // removed from 1.8.18 and 1.10.1
- // Unmounts the file named 'name' from this parent location.
- void unmount(const char* name) const;
- void unmount(const H5std_string& name) const;
+ // Unmounts the file named 'name' from this parent location.
+ void unmount(const char* name) const;
+ void unmount(const H5std_string& name) const;
- // Renames an object at this location.
- void move(const char* src, const char* dst) const;
- void move(const H5std_string& src, const H5std_string& dst) const;
+ // Renames an object at this location.
+ void move(const char* src, const char* dst) const;
+ void move(const H5std_string& src, const H5std_string& dst) const;
// end From CommonFG
- /// For subclasses, H5File and Group, to throw appropriate exception.
- virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
+ /// For subclasses, H5File and Group, to throw appropriate exception.
+ virtual void throwException(const H5std_string& func_name, const H5std_string& msg) const;
- // Default constructor
- H5Location();
+ // Default constructor
+ H5Location();
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // *** Deprecation warning ***
- // The following two constructors are no longer appropriate after the
- // data member "id" had been moved to the sub-classes.
- // The copy constructor is a noop and is removed in 1.8.15 and the
- // other will be removed from 1.10 release, and then from 1.8 if its
- // removal does not raise any problems in two 1.10 releases.
+ // *** Deprecation warning ***
+ // The following two constructors are no longer appropriate after the
+ // data member "id" had been moved to the sub-classes.
+ // The copy constructor is a noop and is removed in 1.8.15 and the
+ // other will be removed from 1.10 release, and then from 1.8 if its
+ // removal does not raise any problems in two 1.10 releases.
- // Creates a copy of an existing object giving the location id.
- H5Location(const hid_t loc_id);
+ // Creates a copy of an existing object giving the location id.
+ H5Location(const hid_t loc_id);
- // Creates a reference to an HDF5 object or a dataset region.
- void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
+ // Creates a reference to an HDF5 object or a dataset region.
+ void p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ref_type) const;
- // Dereferences a ref into an HDF5 id.
- hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func);
+ // Dereferences a ref into an HDF5 id.
+ hid_t p_dereference(hid_t loc_id, const void* ref, H5R_type_t ref_type, const PropList& plist, const char* from_func);
#ifndef H5_NO_DEPRECATED_SYMBOLS
- // Retrieves the type of object that an object reference points to.
- H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
+ // Retrieves the type of object that an object reference points to.
+ H5G_obj_t p_get_obj_type(void *ref, H5R_type_t ref_type) const;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
- // Retrieves the type of object that an object reference points to.
- H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const;
+ // Retrieves the type of object that an object reference points to.
+ H5O_type_t p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const;
- // Sets the identifier of this object to a new value. - this one
- // doesn't increment reference count
- //virtual void p_setId(const hid_t new_id);
+ // Sets the identifier of this object to a new value. - this one
+ // doesn't increment reference count
+ //virtual void p_setId(const hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
- // Noop destructor.
- virtual ~H5Location();
+ // Noop destructor.
+ virtual ~H5Location();
}; /* end class H5Location */
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index 48d81f8..b5d0f88 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -15,7 +15,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -46,25 +46,25 @@ namespace H5 {
extern "C" herr_t userAttrOpWrpr(hid_t loc_id, const char *attr_name,
const H5A_info_t *ainfo, void *op_data)
{
- H5std_string s_attr_name = H5std_string( attr_name );
+ H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate* myData = reinterpret_cast<UserData4Aiterate *> (op_data);
- myData->op( *myData->location, s_attr_name, myData->opData );
+ myData->op(*myData->location, s_attr_name, myData->opData);
return 0;
}
#endif
//--------------------------------------------------------------------------
-// Function: H5Object default constructor (protected)
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object default constructor (protected)
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Object::H5Object() : H5Location() {}
//--------------------------------------------------------------------------
-// Function: H5Object overloaded constructor (protected)
-// Purpose Creates an H5Object object using the id of an existing HDF5
-// object.
-// Parameters object_id - IN: Id of an existing HDF5 object
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object overloaded constructor (protected)
+// Purpose Creates an H5Object object using the id of an existing HDF5
+// object.
+// Parameters object_id - IN: Id of an existing HDF5 object
+// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It will be removed in 1.10 release. If its
@@ -75,11 +75,11 @@ H5Object::H5Object() : H5Location() {}
//H5Object::H5Object(const hid_t object_id) : H5Location() {}
//--------------------------------------------------------------------------
-// Function: H5Object copy constructor
-///\brief Copy constructor: makes a copy of the original H5Object
-/// instance.
-///\param original - IN: H5Object instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object copy constructor
+///\brief Copy constructor: makes a copy of the original H5Object
+/// instance.
+///\param original - IN: H5Object instance to copy
+// Programmer Binh-Minh Ribler - 2000
// *** Deprecation warning ***
// This constructor is no longer appropriate because the data member "id" had
// been moved to the sub-classes. It is removed from 1.8.15 because it is
@@ -103,158 +103,157 @@ void f_Attribute_setId(Attribute* attr, hid_t new_id)
}
//--------------------------------------------------------------------------
-// Function: H5Object::createAttribute
-///\brief Creates an attribute for a group, dataset, or named datatype.
-///\param name - IN: Name of the attribute
-///\param data_type - IN: Datatype for the attribute
-///\param data_space - IN: Dataspace for the attribute - only simple
-/// dataspaces are allowed at this time
-///\param create_plist - IN: Creation property list - default to
-/// PropList::DEFAULT
-///\return Attribute instance
-///\exception H5::AttributeIException
+// Function: H5Object::createAttribute
+///\brief Creates an attribute for a group, dataset, or named datatype.
+///\param name - IN: Name of the attribute
+///\param data_type - IN: Datatype for the attribute
+///\param data_space - IN: Dataspace for the attribute - only simple
+/// dataspaces are allowed at this time
+///\param create_plist - IN: Creation property list - default to
+/// PropList::DEFAULT
+///\return Attribute instance
+///\exception H5::AttributeIException
///\par Description
-/// The attribute name specified in \a name must be unique.
-/// Attempting to create an attribute with the same name as an
-/// existing attribute will raise an exception, leaving the
-/// pre-existing attribute intact. To overwrite an existing
-/// attribute with a new attribute of the same name, first
-/// delete the existing one with \c H5Object::removeAttr, then
-/// recreate it with this function.
-// Programmer Binh-Minh Ribler - 2000
-//--------------------------------------------------------------------------
-Attribute H5Object::createAttribute( const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
+/// The attribute name specified in \a name must be unique.
+/// Attempting to create an attribute with the same name as an
+/// existing attribute will raise an exception, leaving the
+/// pre-existing attribute intact. To overwrite an existing
+/// attribute with a new attribute of the same name, first
+/// delete the existing one with \c H5Object::removeAttr, then
+/// recreate it with this function.
+// Programmer Binh-Minh Ribler - 2000
+//--------------------------------------------------------------------------
+Attribute H5Object::createAttribute(const char* name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const
{
- hid_t type_id = data_type.getId();
- hid_t space_id = data_space.getId();
- hid_t plist_id = create_plist.getId();
- hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT );
-
- // If the attribute id is valid, create and return the Attribute object
- if( attr_id > 0 )
- {
- Attribute attr;
- f_Attribute_setId(&attr, attr_id);
- return( attr );
- }
- else
- throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
+ hid_t type_id = data_type.getId();
+ hid_t space_id = data_space.getId();
+ hid_t plist_id = create_plist.getId();
+ hid_t attr_id = H5Acreate2(getId(), name, type_id, space_id, plist_id, H5P_DEFAULT);
+
+ // If the attribute id is valid, create and return the Attribute object
+ if (attr_id > 0)
+ {
+ Attribute attr;
+ f_Attribute_setId(&attr, attr_id);
+ return(attr);
+ }
+ else
+ throw AttributeIException(inMemFunc("createAttribute"), "H5Acreate2 failed");
}
//--------------------------------------------------------------------------
-// Function: H5Object::createAttribute
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::createAttribute
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute H5Object::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const
+Attribute H5Object::createAttribute(const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist) const
{
- return( createAttribute( name.c_str(), data_type, data_space, create_plist ));
+ return(createAttribute( name.c_str(), data_type, data_space, create_plist));
}
//--------------------------------------------------------------------------
-// Function: H5Object::openAttribute
-///\brief Opens an attribute given its name.
-///\param name - IN: Name of the attribute
-///\return Attribute instance
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::openAttribute
+///\brief Opens an attribute given its name.
+///\param name - IN: Name of the attribute
+///\return Attribute instance
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute H5Object::openAttribute( const char* name ) const
+Attribute H5Object::openAttribute(const char* name) const
{
- hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT);
- if( attr_id > 0 )
- {
- Attribute attr;
- f_Attribute_setId(&attr, attr_id);
- return( attr );
- }
- else
- {
- throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed");
- }
+ hid_t attr_id = H5Aopen(getId(), name, H5P_DEFAULT);
+ if (attr_id > 0)
+ {
+ Attribute attr;
+ f_Attribute_setId(&attr, attr_id);
+ return(attr);
+ }
+ else
+ {
+ throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Object::openAttribute
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::openAttribute
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute H5Object::openAttribute( const H5std_string& name ) const
+Attribute H5Object::openAttribute(const H5std_string& name) const
{
- return( openAttribute( name.c_str()) );
+ return(openAttribute( name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: H5Object::openAttribute
-///\brief Opens an attribute given its index.
-///\param idx - IN: Index of the attribute, a 0-based, non-negative integer
-///\return Attribute instance
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::openAttribute
+///\brief Opens an attribute given its index.
+///\param idx - IN: Index of the attribute, a 0-based, non-negative integer
+///\return Attribute instance
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-Attribute H5Object::openAttribute( const unsigned int idx ) const
+Attribute H5Object::openAttribute(const unsigned int idx) const
{
- hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER,
- H5_ITER_INC, static_cast<hsize_t>(idx), H5P_DEFAULT, H5P_DEFAULT);
- if( attr_id > 0 )
- {
- Attribute attr;
- f_Attribute_setId(&attr, attr_id);
- return(attr);
- }
- else
- {
- throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
- }
+ hid_t attr_id = H5Aopen_by_idx(getId(), ".", H5_INDEX_CRT_ORDER,
+ H5_ITER_INC, static_cast<hsize_t>(idx), H5P_DEFAULT, H5P_DEFAULT);
+ if (attr_id > 0)
+ {
+ Attribute attr;
+ f_Attribute_setId(&attr, attr_id);
+ return(attr);
+ }
+ else
+ {
+ throw AttributeIException(inMemFunc("openAttribute"), "H5Aopen_by_idx failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: H5Object::iterateAttrs
-///\brief Iterates a user's function over all the attributes of an H5
-/// object, which may be a group, dataset or named datatype.
-///\param user_op - IN: User's function to operate on each attribute
-///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
-///\param op_data - IN: User's data to pass to user's operator function
-///\return Returned value of the last operator if it was non-zero, or
-/// zero if all attributes were processed
-///\exception H5::AttributeIException
+// Function: H5Object::iterateAttrs
+///\brief Iterates a user's function over all the attributes of an H5
+/// object, which may be a group, dataset or named datatype.
+///\param user_op - IN: User's function to operate on each attribute
+///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices
+///\param op_data - IN: User's data to pass to user's operator function
+///\return Returned value of the last operator if it was non-zero, or
+/// zero if all attributes were processed
+///\exception H5::AttributeIException
///\par Description
-/// The signature of user_op is
-/// void (*)(H5::H5Location&, H5std_string, void*).
-/// For information, please refer to the C layer Reference Manual
-/// at:
+/// The signature of user_op is
+/// void (*)(H5::H5Location&, H5std_string, void*).
+/// For information, please refer to the C layer Reference Manual
+/// at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data )
+int H5Object::iterateAttrs(attr_operator_t user_op, unsigned *_idx, void *op_data)
{
- // store the user's function and data
- UserData4Aiterate* userData = new UserData4Aiterate;
- userData->opData = op_data;
- userData->op = user_op;
- userData->location = this;
-
- // call the C library routine H5Aiterate2 to iterate the attributes
- hsize_t idx = _idx ? static_cast<hsize_t>(*_idx) : 0;
- int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
- userAttrOpWrpr, reinterpret_cast<void *>(userData));
-
- // release memory
- delete userData;
-
- if( ret_value >= 0 ) {
- /* Pass back update index value to calling code */
- if (_idx)
- *_idx = static_cast<unsigned>(idx);
-
- return( ret_value );
- }
- else // raise exception when H5Aiterate returns a negative value
- throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
+ // store the user's function and data
+ UserData4Aiterate* userData = new UserData4Aiterate;
+ userData->opData = op_data;
+ userData->op = user_op;
+ userData->location = this;
+
+ // call the C library routine H5Aiterate2 to iterate the attributes
+ hsize_t idx = _idx ? static_cast<hsize_t>(*_idx) : 0;
+ int ret_value = H5Aiterate2(getId(), H5_INDEX_NAME, H5_ITER_INC, &idx,
+ userAttrOpWrpr, reinterpret_cast<void *>(userData));
+
+ // release memory
+ delete userData;
+
+ if (ret_value >= 0) {
+ /* Pass back update index value to calling code */
+ if (_idx)
+ *_idx = static_cast<unsigned>(idx);
+ return(ret_value);
+ }
+ else // raise exception when H5Aiterate returns a negative value
+ throw AttributeIException(inMemFunc("iterateAttrs"), "H5Aiterate2 failed");
}
//--------------------------------------------------------------------------
@@ -291,106 +290,106 @@ unsigned H5Object::objVersion() const
}
//--------------------------------------------------------------------------
-// Function: H5Object::getNumAttrs
-///\brief Returns the number of attributes attached to this HDF5 object.
-///\return Number of attributes
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::getNumAttrs
+///\brief Returns the number of attributes attached to this HDF5 object.
+///\return Number of attributes
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int H5Object::getNumAttrs() const
{
- H5O_info_t oinfo; /* Object info */
+ H5O_info_t oinfo; /* Object info */
- if(H5Oget_info(getId(), &oinfo) < 0)
- throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
- else
- return(static_cast<int>(oinfo.num_attrs));
+ if(H5Oget_info(getId(), &oinfo) < 0)
+ throw AttributeIException(inMemFunc("getNumAttrs"), "H5Oget_info failed");
+ else
+ return(static_cast<int>(oinfo.num_attrs));
}
//--------------------------------------------------------------------------
-// Function: H5Object::attrExists
-///\brief Checks whether the named attribute exists at this location.
-///\param name - IN: Name of the attribute to be queried
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2013
+// Function: H5Object::attrExists
+///\brief Checks whether the named attribute exists at this location.
+///\param name - IN: Name of the attribute to be queried
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2013
//--------------------------------------------------------------------------
bool H5Object::attrExists(const char* name) const
{
- // Call C routine H5Aexists to determine whether an attribute exists
- // at this location, which could be specified by a file, group, dataset,
- // or named datatype.
- herr_t ret_value = H5Aexists(getId(), name);
- if( ret_value > 0 )
- return true;
- else if(ret_value == 0)
- return false;
- else // Raise exception when H5Aexists returns a negative value
- throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed");
+ // Call C routine H5Aexists to determine whether an attribute exists
+ // at this location, which could be specified by a file, group, dataset,
+ // or named datatype.
+ herr_t ret_value = H5Aexists(getId(), name);
+ if (ret_value > 0)
+ return true;
+ else if(ret_value == 0)
+ return false;
+ else // Raise exception when H5Aexists returns a negative value
+ throw AttributeIException(inMemFunc("attrExists"), "H5Aexists failed");
}
//--------------------------------------------------------------------------
-// Function: H5Object::attrExists
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::attrExists
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool H5Object::attrExists(const H5std_string& name) const
{
- return(attrExists(name.c_str()));
+ return(attrExists(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: H5Object::removeAttr
-///\brief Removes the named attribute from this object.
-///\param name - IN: Name of the attribute to be removed
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::removeAttr
+///\brief Removes the named attribute from this object.
+///\param name - IN: Name of the attribute to be removed
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Object::removeAttr( const char* name ) const
+void H5Object::removeAttr(const char* name) const
{
- herr_t ret_value = H5Adelete(getId(), name);
- if( ret_value < 0 )
- throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed");
+ herr_t ret_value = H5Adelete(getId(), name);
+ if (ret_value < 0)
+ throw AttributeIException(inMemFunc("removeAttr"), "H5Adelete failed");
}
//--------------------------------------------------------------------------
-// Function: H5Object::removeAttr
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for \a name.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object::removeAttr
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void H5Object::removeAttr( const H5std_string& name ) const
+void H5Object::removeAttr(const H5std_string& name) const
{
- removeAttr( name.c_str() );
+ removeAttr(name.c_str());
}
//--------------------------------------------------------------------------
-// Function: H5Object::renameAttr
-///\brief Renames the named attribute from this object.
-///\param oldname - IN: Name of the attribute to be renamed
-///\param newname - IN: New name ame of the attribute
-///\exception H5::AttributeIException
-// Programmer Binh-Minh Ribler - Mar, 2005
+// Function: H5Object::renameAttr
+///\brief Renames the named attribute from this object.
+///\param oldname - IN: Name of the attribute to be renamed
+///\param newname - IN: New name ame of the attribute
+///\exception H5::AttributeIException
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
void H5Object::renameAttr(const char* oldname, const char* newname) const
{
- herr_t ret_value = H5Arename(getId(), oldname, newname);
- if (ret_value < 0)
- throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed");
+ herr_t ret_value = H5Arename(getId(), oldname, newname);
+ if (ret_value < 0)
+ throw AttributeIException(inMemFunc("renameAttr"), "H5Arename failed");
}
//--------------------------------------------------------------------------
-// Function: H5Object::renameAttr
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function in that it takes
-/// a reference to an \c H5std_string for the names.
-// Programmer Binh-Minh Ribler - Mar, 2005
+// Function: H5Object::renameAttr
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function in that it takes
+/// a reference to an \c H5std_string for the names.
+// Programmer Binh-Minh Ribler - Mar, 2005
//--------------------------------------------------------------------------
void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const
{
- renameAttr (oldname.c_str(), newname.c_str());
+ renameAttr (oldname.c_str(), newname.c_str());
}
//--------------------------------------------------------------------------
// Function: getObjName
@@ -405,11 +404,11 @@ ssize_t H5Object::getObjName(char *obj_name, size_t buf_size) const
// If H5Iget_name returns a negative value, raise an exception
if (name_size < 0)
- {
+ {
throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
}
else if (name_size == 0)
- {
+ {
throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
}
// Return length of the name
@@ -433,16 +432,16 @@ H5std_string H5Object::getObjName() const
// If H5Iget_name failed, throw exception
if (name_size < 0)
- {
+ {
throw Exception(inMemFunc("getObjName"), "H5Iget_name failed");
}
else if (name_size == 0)
- {
+ {
throw Exception(inMemFunc("getObjName"), "Object must have a name, but name length is 0");
}
// Object's name exists, retrieve it
else if (name_size > 0)
- {
+ {
char* name_C = new char[name_size+1]; // temporary C-string
HDmemset(name_C, 0, name_size+1); // clear buffer
@@ -478,13 +477,13 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const
// If no length is provided, get the entire object name
if (len == 0)
- {
+ {
obj_name = getObjName();
name_size = obj_name.length();
}
// If length is provided, get that number of characters in name
else
- {
+ {
char* name_C = new char[len+1]; // temporary C-string
HDmemset(name_C, 0, len+1); // clear buffer
@@ -505,9 +504,9 @@ ssize_t H5Object::getObjName(H5std_string& obj_name, size_t len) const
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: H5Object destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: H5Object destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5Object::~H5Object() {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h
index 5ea8937..866d739 100644
--- a/c++/src/H5Object.h
+++ b/c++/src/H5Object.h
@@ -24,20 +24,20 @@ namespace H5 {
and Group.
Modification:
- Sept 18, 2012: Added class H5Location in between IdComponent and
- H5Object. An H5File now inherits from H5Location. All HDF5
- wrappers in H5Object are moved up to H5Location. H5Object
- is left mostly empty for future wrappers that are only for
- group, dataset, and named datatype. Note that the reason for
- adding H5Location instead of simply moving H5File to be under
- H5Object is H5File is not an HDF5 object, and renaming H5Object
- to H5Location will risk breaking user applications.
- -BMR
- Apr 2, 2014: Added wrapper getObjName for H5Iget_name
- Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back
- into H5Object. This way, C functions that takes attribute id
- can be in H5Location and those that cannot take attribute id
- can be in H5Object.
+ Sept 18, 2012: Added class H5Location in between IdComponent and
+ H5Object. An H5File now inherits from H5Location. All HDF5
+ wrappers in H5Object are moved up to H5Location. H5Object
+ is left mostly empty for future wrappers that are only for
+ group, dataset, and named datatype. Note that the reason for
+ adding H5Location instead of simply moving H5File to be under
+ H5Object is H5File is not an HDF5 object, and renaming H5Object
+ to H5Location will risk breaking user applications.
+ -BMR
+ Apr 2, 2014: Added wrapper getObjName for H5Iget_name
+ Sep 21, 2016: Rearranging classes (HDFFV-9920) moved H5A wrappers back
+ into H5Object. This way, C functions that takes attribute id
+ can be in H5Location and those that cannot take attribute id
+ can be in H5Object.
Inheritance: H5Location -> IdComponent
*/
@@ -46,88 +46,88 @@ class H5_DLLCPP H5Object;
class H5_DLLCPP Attribute;
// Define the operator function pointer for H5Aiterate().
-typedef void (*attr_operator_t)( H5Object& loc/*in*/,
+typedef void (*attr_operator_t)(H5Object& loc/*in*/,
const H5std_string attr_name/*in*/,
void *operator_data/*in,out*/);
// User data for attribute iteration
class UserData4Aiterate {
public:
- attr_operator_t op;
- void* opData;
- H5Object* location;
+ attr_operator_t op;
+ void* opData;
+ H5Object* location;
};
class H5_DLLCPP H5Object : public H5Location {
public:
- // Creates an attribute for the specified object
- // PropList is currently not used, so always be default.
- Attribute createAttribute( const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
- Attribute createAttribute( const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT ) const;
+ // Creates an attribute for the specified object
+ // PropList is currently not used, so always be default.
+ Attribute createAttribute(const char* name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const;
+ Attribute createAttribute(const H5std_string& name, const DataType& type, const DataSpace& space, const PropList& create_plist = PropList::DEFAULT) const;
- // Given its name, opens the attribute that belongs to an object at
- // this location.
- Attribute openAttribute( const char* name ) const;
- Attribute openAttribute( const H5std_string& name ) const;
+ // Given its name, opens the attribute that belongs to an object at
+ // this location.
+ Attribute openAttribute(const char* name) const;
+ Attribute openAttribute(const H5std_string& name) const;
- // Given its index, opens the attribute that belongs to an object at
- // this location.
- Attribute openAttribute( const unsigned int idx ) const;
+ // Given its index, opens the attribute that belongs to an object at
+ // this location.
+ Attribute openAttribute(const unsigned int idx) const;
- // Iterate user's function over the attributes of this object.
- int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL);
+ // Iterate user's function over the attributes of this object.
+ int iterateAttrs(attr_operator_t user_op, unsigned* idx = NULL, void* op_data = NULL);
- // Returns the object header version of an object
- unsigned objVersion() const;
+ // Returns the object header version of an object
+ unsigned objVersion() const;
- // Determines the number of attributes belong to this object.
- int getNumAttrs() const;
+ // Determines the number of attributes belong to this object.
+ int getNumAttrs() const;
- // Checks whether the named attribute exists for this object.
- bool attrExists(const char* name) const;
- bool attrExists(const H5std_string& name) const;
+ // Checks whether the named attribute exists for this object.
+ bool attrExists(const char* name) const;
+ bool attrExists(const H5std_string& name) const;
- // Renames the named attribute to a new name.
- void renameAttr(const char* oldname, const char* newname) const;
- void renameAttr(const H5std_string& oldname, const H5std_string& newname) const;
+ // Renames the named attribute to a new name.
+ void renameAttr(const char* oldname, const char* newname) const;
+ void renameAttr(const H5std_string& oldname, const H5std_string& newname) const;
- // Removes the named attribute from this object.
- void removeAttr(const char* name) const;
- void removeAttr(const H5std_string& name) const;
+ // Removes the named attribute from this object.
+ void removeAttr(const char* name) const;
+ void removeAttr(const H5std_string& name) const;
- // Returns an identifier.
- virtual hid_t getId() const = 0;
+ // Returns an identifier.
+ virtual hid_t getId() const = 0;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Gets the name of this HDF5 object, i.e., Group, DataSet, or
- // 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;
+ // Gets the name of this HDF5 object, i.e., Group, DataSet, or
+ // 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;
protected:
- // Default constructor
- H5Object();
+ // Default constructor
+ H5Object();
- // *** Deprecation warning ***
- // The following two constructors are no longer appropriate after the
- // data member "id" had been moved to the sub-classes.
- // The copy constructor is a noop and is removed in 1.8.15 and the
- // other will be removed from 1.10 release, and then from 1.8 if its
- // removal does not raise any problems in two 1.10 releases.
+ // *** Deprecation warning ***
+ // The following two constructors are no longer appropriate after the
+ // data member "id" had been moved to the sub-classes.
+ // The copy constructor is a noop and is removed in 1.8.15 and the
+ // other will be removed from 1.10 release, and then from 1.8 if its
+ // removal does not raise any problems in two 1.10 releases.
- // Creates a copy of an existing object giving the object id
- H5Object( const hid_t object_id );
+ // Creates a copy of an existing object giving the object id
+ H5Object(const hid_t object_id);
- // Copy constructor: makes copy of an H5Object object.
- // H5Object(const H5Object& original);
+ // Copy constructor: makes copy of an H5Object object.
+ // H5Object(const H5Object& original);
- // Sets the identifier of this object to a new value. - this one
- // doesn't increment reference count
- virtual void p_setId(const hid_t new_id) = 0;
+ // Sets the identifier of this object to a new value. - this one
+ // doesn't increment reference count
+ virtual void p_setId(const hid_t new_id) = 0;
- // Noop destructor.
- virtual ~H5Object();
+ // Noop destructor.
+ virtual ~H5Object();
#endif // DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5OcreatProp.cpp b/c++/src/H5OcreatProp.cpp
index 397a96f..6fdd9dc 100644
--- a/c++/src/H5OcreatProp.cpp
+++ b/c++/src/H5OcreatProp.cpp
@@ -75,49 +75,49 @@ void ObjCreatPropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose: Constant for default property
+// Purpose: Constant for default property
//--------------------------------------------------------------------------
const ObjCreatPropList& ObjCreatPropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: Default Constructor
-///\brief Creates a file access property list
-// Programmer: Binh-Minh Ribler - 2000
+// Function: Default Constructor
+///\brief Creates a file access property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
ObjCreatPropList::ObjCreatPropList() : PropList(H5P_OBJECT_CREATE) {}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList copy constructor
-///\brief Copy Constructor: makes a copy of the original
-///\param original - IN: ObjCreatPropList instance to copy
-// Programmer: Binh-Minh Ribler - 2000
+// Function: ObjCreatPropList copy constructor
+///\brief Copy Constructor: makes a copy of the original
+///\param original - IN: ObjCreatPropList instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
ObjCreatPropList::ObjCreatPropList(const ObjCreatPropList& original) : PropList(original) {}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList overloaded constructor
-///\brief Creates a file access property list using the id of an
-/// existing one.
-// Programmer: Binh-Minh Ribler - 2000
+// Function: ObjCreatPropList overloaded constructor
+///\brief Creates a file access property list using the id of an
+/// existing one.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
ObjCreatPropList::ObjCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList::setAttrPhaseChange
-///\brief Sets attribute storage phase change thresholds.
-///\param max_compact - IN: Maximum number of attributes to be stored in
-/// compact storage. Default to 8
-///\param min_dense - IN: Minimum number of attributes to be stored in
-/// dense storage. Default to 6
-///\exception H5::PropListIException
+// Function: ObjCreatPropList::setAttrPhaseChange
+///\brief Sets attribute storage phase change thresholds.
+///\param max_compact - IN: Maximum number of attributes to be stored in
+/// compact storage. Default to 8
+///\param min_dense - IN: Minimum number of attributes to be stored in
+/// dense storage. Default to 6
+///\exception H5::PropListIException
///\par Description
-/// If \c max_compact is set to 0, dense storage will be used.
-/// For more detail about on attribute storage, please refer to the
-/// C layer Reference Manual at:
+/// If \c max_compact is set to 0, dense storage will be used.
+/// For more detail about on attribute storage, please refer to the
+/// C layer Reference Manual at:
/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrPhaseChange
-// Programmer: Binh-Minh Ribler - September 2015
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_dense) const
{
@@ -129,19 +129,19 @@ void ObjCreatPropList::setAttrPhaseChange(unsigned max_compact, unsigned min_den
}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList::getAttrPhaseChange
-///\brief Gets attribute storage phase change thresholds.
-///\param max_compact - OUT: Maximum number of attributes to be stored in
-/// compact storage.
-///\param min_dense - OUT: Minimum number of attributes to be stored in
-/// dense storage.
-///\exception H5::PropListIException
+// Function: ObjCreatPropList::getAttrPhaseChange
+///\brief Gets attribute storage phase change thresholds.
+///\param max_compact - OUT: Maximum number of attributes to be stored in
+/// compact storage.
+///\param min_dense - OUT: Minimum number of attributes to be stored in
+/// dense storage.
+///\exception H5::PropListIException
///\par Description
-/// If \c max_compact is set to 0, dense storage will be used.
-/// For more detail about on attribute storage, please refer to the
-/// C layer Reference Manual at:
+/// If \c max_compact is set to 0, dense storage will be used.
+/// For more detail about on attribute storage, please refer to the
+/// C layer Reference Manual at:
/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrPhaseChange
-// Programmer: Binh-Minh Ribler - September 2015
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const
{
@@ -154,23 +154,23 @@ void ObjCreatPropList::getAttrPhaseChange(unsigned& max_compact, unsigned& min_d
}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList::setAttrCrtOrder
-///\brief Sets tracking and indexing of attribute creation order.
-///\param crt_order_flags - IN: Flags specifying whether to track and
-/// index attribute creation order. Default: No flag set
-///\exception H5::PropListIException
+// Function: ObjCreatPropList::setAttrCrtOrder
+///\brief Sets tracking and indexing of attribute creation order.
+///\param crt_order_flags - IN: Flags specifying whether to track and
+/// index attribute creation order. Default: No flag set
+///\exception H5::PropListIException
///\par Description
-/// Valid flags are:
-/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked
-/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is
-/// indexed (requires H5P_CRT_ORDER_TRACKED).
-/// When no flag is set, attribute creation order is neither
-/// tracked not indexed. Note that HDF5 currently provides no
-/// mechanism to turn on attribute creation order tracking at object
-/// creation time and to build the index later.
-/// The C layer Reference Manual at can be found at:
+/// Valid flags are:
+/// \li \c H5P_CRT_ORDER_TRACKED - Attribute creation order is tracked
+/// \li \c H5P_CRT_ORDER_INDEXED - Attribute creation order is
+/// indexed (requires H5P_CRT_ORDER_TRACKED).
+/// When no flag is set, attribute creation order is neither
+/// tracked not indexed. Note that HDF5 currently provides no
+/// mechanism to turn on attribute creation order tracking at object
+/// creation time and to build the index later.
+/// The C layer Reference Manual at can be found at:
/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAttrCreationOrder
-// Programmer: Binh-Minh Ribler - September 2015
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
void ObjCreatPropList::setAttrCrtOrder(unsigned crt_order_flags) const
{
@@ -182,18 +182,18 @@ 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
-///\exception H5::PropListIException
+// 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
+///\exception H5::PropListIException
///\par Description
-/// When no flag is set, i.e. crt_order_flags = 0, attribute
-/// creation order is neither tracked not indexed.
-/// The C layer Reference Manual at can be found at:
+/// When no flag is set, i.e. crt_order_flags = 0, attribute
+/// creation order is neither tracked not indexed.
+/// The C layer Reference Manual at can be found at:
/// https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetAttrCreationOrder
-// Programmer: Binh-Minh Ribler - September 2015
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
unsigned ObjCreatPropList::getAttrCrtOrder() const
{
@@ -208,9 +208,9 @@ unsigned ObjCreatPropList::getAttrCrtOrder() const
}
//--------------------------------------------------------------------------
-// Function: ObjCreatPropList destructor
-///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Function: ObjCreatPropList destructor
+///\brief Noop destructor
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
ObjCreatPropList::~ObjCreatPropList() {}
diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h
index bfba1c4..4858e07 100644
--- a/c++/src/H5OcreatProp.h
+++ b/c++/src/H5OcreatProp.h
@@ -27,37 +27,37 @@ namespace H5 {
*/
class H5_DLLCPP ObjCreatPropList : public PropList {
public:
- ///\brief Default object creation property list.
- static const ObjCreatPropList& DEFAULT;
+ ///\brief Default object creation property list.
+ static const ObjCreatPropList& DEFAULT;
- // Creates a object creation property list.
- ObjCreatPropList();
+ // Creates a object creation property list.
+ ObjCreatPropList();
- // Sets attribute storage phase change thresholds.
- void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const;
+ // Sets attribute storage phase change thresholds.
+ void setAttrPhaseChange(unsigned max_compact = 8, unsigned min_dense = 6) const;
- // Gets attribute storage phase change thresholds.
- void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const;
+ // Gets attribute storage phase change thresholds.
+ void getAttrPhaseChange(unsigned& max_compact, unsigned& min_dense) const;
- // Sets tracking and indexing of attribute creation order.
- void setAttrCrtOrder(unsigned crt_order_flags) const;
+ // Sets tracking and indexing of attribute creation order.
+ void setAttrCrtOrder(unsigned crt_order_flags) const;
- // Gets tracking and indexing settings for attribute creation order.
- unsigned getAttrCrtOrder() const;
+ // Gets tracking and indexing settings for attribute creation order.
+ unsigned getAttrCrtOrder() const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("ObjCreatPropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("ObjCreatPropList"); }
- // Copy constructor: creates a copy of a ObjCreatPropList object.
- ObjCreatPropList( const ObjCreatPropList& original );
+ // Copy constructor: creates a copy of a ObjCreatPropList object.
+ ObjCreatPropList(const ObjCreatPropList& original);
- // Creates a copy of an existing object creation property list
- // using the property list id.
- ObjCreatPropList (const hid_t plist_id);
+ // Creates a copy of an existing object creation property list
+ // using the property list id.
+ ObjCreatPropList (const hid_t plist_id);
- // Noop destructor
- virtual ~ObjCreatPropList();
+ // Noop destructor
+ virtual ~ObjCreatPropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp
index e2eed18..03327c8 100644
--- a/c++/src/H5PredType.cpp
+++ b/c++/src/H5PredType.cpp
@@ -32,14 +32,14 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: PredType overloaded constructor
-///\brief Creates a PredType object using the id of an existing
-/// predefined datatype.
-///\param predtype_id - IN: Id of a predefined datatype
+// Function: PredType overloaded constructor
+///\brief Creates a PredType object using the id of an existing
+/// predefined datatype.
+///\param predtype_id - IN: Id of a predefined datatype
// Description
-// This constructor creates a PredType object by copying
-// the provided HDF5 predefined datatype.
-// Programmer Binh-Minh Ribler - 2000
+// This constructor creates a PredType object by copying
+// the provided HDF5 predefined datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id)
{
@@ -47,69 +47,69 @@ PredType::PredType(const hid_t predtype_id) : AtomType(predtype_id)
}
//--------------------------------------------------------------------------
-// Function: PredType default constructor
-///\brief Default constructor: Creates a stub predefined datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: PredType default constructor
+///\brief Default constructor: Creates a stub predefined datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PredType::PredType() : AtomType() {}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: PredType copy constructor
-///\brief Copy constructor: makes a copy of the original PredType object.
-///\param original - IN: PredType instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: PredType copy constructor
+///\brief Copy constructor: makes a copy of the original PredType object.
+///\param original - IN: PredType instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PredType::PredType(const PredType& original) : AtomType(original) {}
//--------------------------------------------------------------------------
-// Function: PredType::operator=
-///\brief Assignment operator.
-///\param rhs - IN: Reference to the predefined datatype
-///\return Reference to PredType instance
-///\exception H5::DataTypeIException
+// Function: PredType::operator=
+///\brief Assignment operator.
+///\param rhs - IN: Reference to the predefined datatype
+///\return Reference to PredType instance
+///\exception H5::DataTypeIException
// Description
-// Makes a copy of the type on the right hand side and stores
-// the new id in the left hand side object.
-// Programmer Binh-Minh Ribler - 2000
+// Makes a copy of the type on the right hand side and stores
+// the new id in the left hand side object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PredType& PredType::operator=( const PredType& rhs )
+PredType& PredType::operator=(const PredType& rhs)
{
if (this != &rhs)
- copy(rhs);
+ copy(rhs);
return(*this);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// These dummy functions do not inherit from DataType - they'll
// throw an DataTypeIException if invoked.
-void PredType::commit(H5Location& loc, const char* name )
+void PredType::commit(H5Location& loc, const char* name)
{
- throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!" );
+ throw DataTypeIException("PredType::commit", "Error: Attempted to commit a predefined datatype. Invalid operation!");
}
-void PredType::commit(H5Location& loc, const H5std_string& name )
+void PredType::commit(H5Location& loc, const H5std_string& name)
{
- commit( loc, name.c_str());
+ commit(loc, name.c_str());
}
bool PredType::committed()
{
- throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." );
+ throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype.");
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
// Default destructor
//--------------------------------------------------------------------------
-// Function: PredType destructor
-///\brief Noop destructor.
-// Programmer Binh-Minh Ribler - 2000
+// Function: PredType destructor
+///\brief Noop destructor.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PredType::~PredType() {}
/*****************************************************************************
- The following section is regarding the global constants PredType,
- DataSpace, and PropList.
+ The following section is regarding the global constants PredType,
+ DataSpace, and PropList.
*****************************************************************************/
@@ -292,18 +292,18 @@ PredType* PredType::NATIVE_UINT_FAST64_;
#endif /* H5_SIZEOF_UINT_FAST64_T */
//--------------------------------------------------------------------------
-// Function: PredType::getPredTypes
-// Purpose: Returns the dummy PredType constant object pointer
-// Return: PredType object pointer
+// Function: PredType::getPredTypes
+// Purpose Returns the dummy PredType constant object pointer
+// Return: PredType object pointer
// Description
-// If the dummy constant PREDTYPE_CONST_ is not allocated yet,
-// call makePredTypes() to allocate all of the PredType constants.
-// Otherwise, just simply return the object pointer PREDTYPE_CONST_.
+// If the dummy constant PREDTYPE_CONST_ is not allocated yet,
+// call makePredTypes() to allocate all of the PredType constants.
+// Otherwise, just simply return the object pointer PREDTYPE_CONST_.
//
-// Note that, there is a similar function to getPredTypes() in
-// other classes, that have global constants, is called getConstant().
+// Note that, there is a similar function to getPredTypes() in
+// other classes, that have global constants, is called getConstant().
//
-// Programmer Binh-Minh Ribler - September 2015
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
PredType* PredType::getPredTypes()
{
@@ -318,16 +318,16 @@ PredType* PredType::getPredTypes()
// If the dummy constant pointer is not allocated, allocate all PredType
// constant pointers. Otherwise, throw because it shouldn't be.
if (PREDTYPE_CONST_ == 0)
- makePredTypes();
+ makePredTypes();
else
- throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_");
+ throw H5::DataTypeIException("PredType::getPredTypes", "PredType::getPredTypes is being invoked on an allocated PREDTYPE_CONST_");
return PREDTYPE_CONST_;
}
//--------------------------------------------------------------------------
-// Function: PredType::makePredTypes
-// Purpose: Allocate all PredType constants.
-// Programmer Binh-Minh Ribler - September 2015
+// Function: PredType::makePredTypes
+// Purpose Allocate all PredType constants.
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
void PredType::makePredTypes()
{
@@ -515,9 +515,9 @@ void PredType::makePredTypes()
//--------------------------------------------------------------------------
-// Function: PredType::deleteConstants
-// Purpose: Deletes all PredType constant pointers.
-// Programmer Binh-Minh Ribler - September 2015
+// Function: PredType::deleteConstants
+// Purpose Deletes all PredType constant pointers.
+// Programmer Binh-Minh Ribler - September 2015
//--------------------------------------------------------------------------
void PredType::deleteConstants()
{
@@ -891,206 +891,205 @@ const PredType& PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_;
} // end namespace
/***************************************************************************
- Design Note
- ===========
+ Design Note
+ ===========
September 2015:
- The C++ library has several types of global constants from different
- classes, such as PropList, PredType, DataSpace, etc... Previously,
- these global constants were declared statically and the C++ library used
- a constant, called PredType::AtExit, to detect when all the global
- contants are destroyed then close the C library (H5close). This method
- relied on the order of the constants being created and destroyed and
- that PredType constants be the last to be destroyed. In September
- 2015, it was recognized that the order in which the global constants were
- created and destroyed was actually undefined, thus can be different
- between different compilers. This resulted in failure when compilers
- destroy PredType constants before others because when PredType::AtExit
- was destroyed, the C library was closed, so when the constants of other
- classes such as PropList or DataSpace were being deleted, the C library
- would not be available.
-
- These are the classes that have global constants:
- + PredType
- + DataSpace
- + PropList (and its subclasses below)
- + FileAccPropList
- + FileCreatPropList
- + DSetMemXferPropList
- + DSetCreatPropList
-
-
- The new method includes these main points:
-
- - The C++ library uses dynamically allocated constants to have the
- control in which order the global constants are created/destroyed.
-
- - The previous static constants are changed to be the references to
- the dynamically allocated constants to avoid impact on applications.
-
- - The first time an IdComponent default constructor is invoked, it
- will call the function H5Library::initH5cpp which registers the
- terminating functions from each class that has the global constants
- so that these functions can destroy those constants at the exit of the
- application. IdComponent is a baseclass of any object class that has
- an identifier, such as Group, DataSet, DataType,... The classes which
- have the global constants are all derived from IdComponent.
-
- - At the normal termination of the application, each registered function
- for each constant type will delete all the allocated constants in
- that type class, then a different terminating function, which was also
- registered with atexit() by initH5cpp, will call H5close to close the
- C library.
-
- The following list presents the differences between the old and new
- methods and the changes implemented for the new method.
-
- 1. The following items are added to class H5Library:
- // Private instance to be created by H5Library only
- static H5Library* instance;
-
- // Returns a singleton H5Library to initialize the global
- // constants, invoked in IdComponent default constructor
- static H5Library* getInstance(); // public
-
- // Registers cleanup and terminating functions with atexit(),
- // called in IdComponent default constructor
- static void initH5cpp(void); // public
-
- // Calls H5close to terminate the library, registered with
- // atexit(), as the last thing to be done.
- static void termH5cpp(void); // public
-
- 2. The following shows the differences between the old and new methods
- for allocating the PredType constants. There are more than 100
- constants, but only one is shown here for examples.
-
- Old Method:
- ----------
- // Declaration of the constant - in "H5PredType.h"
- static const PredType NATIVE_INT;
-
- // Definition of the constant - in "H5PredType.cpp"
- const PredType PredType::NATIVE_INT(H5T_NATIVE_INT);
-
- New Method:
- ----------
- // Declare pointer for a constant - in "H5PredType.h"
- static PredType* NATIVE_INT_; // "H5PredType.h"
-
- // Change previous constant to reference - in "H5PredType.h"
- static const PredType& NATIVE_INT;
-
- // The assignment of the first static constant, named
- // PREDTYPE_CONST, calls makePredTypes() which allocates the
- // dynamic memory for every PredType constant.
-
- // Creates a dynamic PredType object representing a C constant
- // - in makePredTypes()
- NATIVE_INT_ = new PredType(H5T_NATIVE_INT);
-
- // Assign the constant reference to the dynamic object
- // - in "H5PredType.cpp"
- const PredType& PredType::NATIVE_INT = *NATIVE_INT_;
-
- Functions added to class PredType:
-
- // Creates the constants
- static void makePredTypes(); // private
-
- // Calls makePredTypes to create the constants and returns
- // the dummy constant PREDTYPE_CONST;
- static PredType* getPredTypes(); // private
-
- // Deletes the constants
- static void deleteConstants(); // public
-
- 3. This section shows the differences between the old and new methods
- for allocating the DataSpace constant, DataSpace::ALL.
+ The C++ library has several types of global constants from different
+ classes, such as PropList, PredType, DataSpace, etc... Previously,
+ these global constants were declared statically and the C++ library used
+ a constant, called PredType::AtExit, to detect when all the global
+ contants are destroyed then close the C library (H5close). This method
+ relied on the order of the constants being created and destroyed and
+ that PredType constants be the last to be destroyed. In September
+ 2015, it was recognized that the order in which the global constants were
+ created and destroyed was actually undefined, thus can be different
+ between different compilers. This resulted in failure when compilers
+ destroy PredType constants before others because when PredType::AtExit
+ was destroyed, the C library was closed, so when the constants of other
+ classes such as PropList or DataSpace were being deleted, the C library
+ would not be available.
+
+ These are the classes that have global constants:
+ + PredType
+ + DataSpace
+ + PropList (and its subclasses below)
+ + FileAccPropList
+ + FileCreatPropList
+ + DSetMemXferPropList
+ + DSetCreatPropList
+
+ The new method includes these main points:
+
+ - The C++ library uses dynamically allocated constants to have the
+ control in which order the global constants are created/destroyed.
+
+ - The previous static constants are changed to be the references to
+ the dynamically allocated constants to avoid impact on applications.
+
+ - The first time an IdComponent default constructor is invoked, it
+ will call the function H5Library::initH5cpp which registers the
+ terminating functions from each class that has the global constants
+ so that these functions can destroy those constants at the exit of the
+ application. IdComponent is a baseclass of any object class that has
+ an identifier, such as Group, DataSet, DataType,... The classes which
+ have the global constants are all derived from IdComponent.
+
+ - At the normal termination of the application, each registered function
+ for each constant type will delete all the allocated constants in
+ that type class, then a different terminating function, which was also
+ registered with atexit() by initH5cpp, will call H5close to close the
+ C library.
+
+ The following list presents the differences between the old and new
+ methods and the changes implemented for the new method.
+
+ 1. The following items are added to class H5Library:
+ // Private instance to be created by H5Library only
+ static H5Library* instance;
+
+ // Returns a singleton H5Library to initialize the global
+ // constants, invoked in IdComponent default constructor
+ static H5Library* getInstance(); // public
+
+ // Registers cleanup and terminating functions with atexit(),
+ // called in IdComponent default constructor
+ static void initH5cpp(void); // public
+
+ // Calls H5close to terminate the library, registered with
+ // atexit(), as the last thing to be done.
+ static void termH5cpp(void); // public
+
+ 2. The following shows the differences between the old and new methods
+ for allocating the PredType constants. There are more than 100
+ constants, but only one is shown here for examples.
+
+ Old Method:
+ ----------
+ // Declaration of the constant - in "H5PredType.h"
+ static const PredType NATIVE_INT;
+
+ // Definition of the constant - in "H5PredType.cpp"
+ const PredType PredType::NATIVE_INT(H5T_NATIVE_INT);
+
+ New Method:
+ ----------
+ // Declare pointer for a constant - in "H5PredType.h"
+ static PredType* NATIVE_INT_; // "H5PredType.h"
+
+ // Change previous constant to reference - in "H5PredType.h"
+ static const PredType& NATIVE_INT;
+
+ // The assignment of the first static constant, named
+ // PREDTYPE_CONST, calls makePredTypes() which allocates the
+ // dynamic memory for every PredType constant.
+
+ // Creates a dynamic PredType object representing a C constant
+ // - in makePredTypes()
+ NATIVE_INT_ = new PredType(H5T_NATIVE_INT);
+
+ // Assign the constant reference to the dynamic object
+ // - in "H5PredType.cpp"
+ const PredType& PredType::NATIVE_INT = *NATIVE_INT_;
+
+ Functions added to class PredType:
+
+ // Creates the constants
+ static void makePredTypes(); // private
+
+ // Calls makePredTypes to create the constants and returns
+ // the dummy constant PREDTYPE_CONST;
+ static PredType* getPredTypes(); // private
+
+ // Deletes the constants
+ static void deleteConstants(); // public
+
+ 3. This section shows the differences between the old and new methods
+ for allocating the DataSpace constant, DataSpace::ALL.
- Old Method:
- ----------
- // Declaration of the constant - in "H5DataSpace.h"
- static const DataSpace ALL;
+ Old Method:
+ ----------
+ // Declaration of the constant - in "H5DataSpace.h"
+ static const DataSpace ALL;
- // Definition of the constant - in "H5DataSpace.cpp"
- const DataSpace DataSpace::ALL(H5S_ALL);
+ // Definition of the constant - in "H5DataSpace.cpp"
+ const DataSpace DataSpace::ALL(H5S_ALL);
- New Method:
- ----------
- // Declare pointer for a constant - in "H5DataSpace.h"
- static DataSpace* ALL_; // "H5DataSpace.h"
+ New Method:
+ ----------
+ // Declare pointer for a constant - in "H5DataSpace.h"
+ static DataSpace* ALL_; // "H5DataSpace.h"
- // Change previous constant to reference - in "H5DataSpace.h"
- static const DataSpace& ALL;
+ // Change previous constant to reference - in "H5DataSpace.h"
+ static const DataSpace& ALL;
- // Creates a dynamic DataSpace object representing the C constant
- // - in "H5DataSpace.cpp"
- ALL_ = new DataSpace(H5S_ALL);
+ // Creates a dynamic DataSpace object representing the C constant
+ // - in "H5DataSpace.cpp"
+ ALL_ = new DataSpace(H5S_ALL);
- // Assign the constant reference to the dynamic object
- // - in "H5DataSpace.cpp"
- const DataSpace& DataSpace::ALL = *ALL_;
+ // Assign the constant reference to the dynamic object
+ // - in "H5DataSpace.cpp"
+ const DataSpace& DataSpace::ALL = *ALL_;
- Functions added to class DataSpace:
+ Functions added to class DataSpace:
- // Creates the constant
- static DataSpace* getConstant(); // private
+ // Creates the constant
+ static DataSpace* getConstant(); // private
- // Deletes the constant
- static void deleteConstants(); // public
+ // Deletes the constant
+ static void deleteConstants(); // public
- 4. This section shows the differences between the old and new methods
- for allocating the following constants
- - PropList constant, PropList::DEFAULT.
- - DSetCreatPropList constant, DSetCreatPropList::DEFAULT.
- - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT.
- - FileCreatPropList constant, FileCreatPropList::DEFAULT.
- - FileAccPropList constant, FileAccPropList::DEFAULT.
+ 4. This section shows the differences between the old and new methods
+ for allocating the following constants
+ - PropList constant, PropList::DEFAULT.
+ - DSetCreatPropList constant, DSetCreatPropList::DEFAULT.
+ - DSetMemXferPropList constant, DSetMemXferPropList::DEFAULT.
+ - FileCreatPropList constant, FileCreatPropList::DEFAULT.
+ - FileAccPropList constant, FileAccPropList::DEFAULT.
- For these constants, the library has the same changes, except the
- class names and the HDF5 corresponding constants. Only the items
- of PropList are listed, and "PropList" can be replaced by any of
- DSetCreatPropList, DSetMemXferPropList, FileCreatPropList,
- FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT"
- can be replaced by any of these respectively: H5P_DATASET_CREATE,
- H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS.
+ For these constants, the library has the same changes, except the
+ class names and the HDF5 corresponding constants. Only the items
+ of PropList are listed, and "PropList" can be replaced by any of
+ DSetCreatPropList, DSetMemXferPropList, FileCreatPropList,
+ FileAccPropList for those classes. The HDF5 C constant "H5P_DEFAULT"
+ can be replaced by any of these respectively: H5P_DATASET_CREATE,
+ H5P_DATASET_XFER, H5P_FILE_CREATE, and H5P_FILE_ACCESS.
- Old Method:
- ----------
- // Declaration of the constant - in "H5PropList.h"
- static const PropList DEFAULT;
+ Old Method:
+ ----------
+ // Declaration of the constant - in "H5PropList.h"
+ static const PropList DEFAULT;
- // Definition of the constant - in "H5PropList.cpp"
- const PropList PropList::DEFAULT(H5P_DEFAULT);
+ // Definition of the constant - in "H5PropList.cpp"
+ const PropList PropList::DEFAULT(H5P_DEFAULT);
- New Method:
- ----------
- // Declare pointer for a constant - in "H5PropList.h"
- static PropList* DEFAULT_; // "H5PropList.h"
+ New Method:
+ ----------
+ // Declare pointer for a constant - in "H5PropList.h"
+ static PropList* DEFAULT_; // "H5PropList.h"
- // Change previous constant to reference - in "H5PropList.h"
- static const PropList& DEFAULT;
+ // Change previous constant to reference - in "H5PropList.h"
+ static const PropList& DEFAULT;
- // Creates a dynamic PropList object representing the C constant
- // - in "H5PropList.cpp"
- DEFAULT_ = new PropList(H5P_DEFAULT);
+ // Creates a dynamic PropList object representing the C constant
+ // - in "H5PropList.cpp"
+ DEFAULT_ = new PropList(H5P_DEFAULT);
- // Assign the constant reference to the dynamic object
- // - in "H5PropList.cpp"
- const PropList& PropList::DEFAULT = *DEFAULT_;
+ // Assign the constant reference to the dynamic object
+ // - in "H5PropList.cpp"
+ const PropList& PropList::DEFAULT = *DEFAULT_;
- Functions added to class PropList:
+ Functions added to class PropList:
- // Creates the constant
- static PropList* getConstant(); // private
+ // Creates the constant
+ static PropList* getConstant(); // private
- // Deletes the constants
- static void deleteConstants(); // public
+ // Deletes the constants
+ static void deleteConstants(); // public
- The same functions are added to the subclasses of PropList instead of
- using PropList's because of the class types and in favor of clarity.
+ The same functions are added to the subclasses of PropList instead of
+ using PropList's because of the class types and in favor of clarity.
****************************************************************************/
diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h
index 750902e..a8d6e37 100644
--- a/c++/src/H5PredType.h
+++ b/c++/src/H5PredType.h
@@ -30,207 +30,207 @@ namespace H5 {
*/
class H5_DLLCPP PredType : public AtomType {
public:
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("PredType"); }
-
- // Makes a copy of the predefined type and stores the new
- // id in the left hand side object.
- PredType& operator=( const PredType& rhs );
-
- // Copy constructor - makes copy of the original object
- PredType( const PredType& original );
-
- // Noop destructor
- virtual ~PredType();
-
- /*! \brief This dummy function do not inherit from DataType - it will
- throw a DataTypeIException if invoked.
- */
- void commit(H5Location& loc, const H5std_string& name );
- /*! \brief This dummy function do not inherit from DataType - it will
- throw a DataTypeIException if invoked.
- */
- void commit(H5Location& loc, const char* name );
- /*! \brief This dummy function do not inherit from DataType - it will
- throw a DataTypeIException if invoked.
- */
- bool committed();
-
- ///\brief PredType constants
- static const PredType& STD_I8BE;
- static const PredType& STD_I8LE;
- static const PredType& STD_I16BE;
- static const PredType& STD_I16LE;
- static const PredType& STD_I32BE;
- static const PredType& STD_I32LE;
- static const PredType& STD_I64BE;
- static const PredType& STD_I64LE;
- static const PredType& STD_U8BE;
- static const PredType& STD_U8LE;
- static const PredType& STD_U16BE;
- static const PredType& STD_U16LE;
- static const PredType& STD_U32BE;
- static const PredType& STD_U32LE;
- static const PredType& STD_U64BE;
- static const PredType& STD_U64LE;
- static const PredType& STD_B8BE;
- static const PredType& STD_B8LE;
- static const PredType& STD_B16BE;
- static const PredType& STD_B16LE;
- static const PredType& STD_B32BE;
- static const PredType& STD_B32LE;
- static const PredType& STD_B64BE;
- static const PredType& STD_B64LE;
- static const PredType& STD_REF_OBJ;
- static const PredType& STD_REF_DSETREG;
-
- static const PredType& C_S1;
- static const PredType& FORTRAN_S1;
-
- static const PredType& IEEE_F32BE;
- static const PredType& IEEE_F32LE;
- static const PredType& IEEE_F64BE;
- static const PredType& IEEE_F64LE;
-
- static const PredType& UNIX_D32BE;
- static const PredType& UNIX_D32LE;
- static const PredType& UNIX_D64BE;
- static const PredType& UNIX_D64LE;
-
- static const PredType& INTEL_I8;
- static const PredType& INTEL_I16;
- static const PredType& INTEL_I32;
- static const PredType& INTEL_I64;
- static const PredType& INTEL_U8;
- static const PredType& INTEL_U16;
- static const PredType& INTEL_U32;
- static const PredType& INTEL_U64;
- static const PredType& INTEL_B8;
- static const PredType& INTEL_B16;
- static const PredType& INTEL_B32;
- static const PredType& INTEL_B64;
- static const PredType& INTEL_F32;
- static const PredType& INTEL_F64;
-
- static const PredType& ALPHA_I8;
- static const PredType& ALPHA_I16;
- static const PredType& ALPHA_I32;
- static const PredType& ALPHA_I64;
- static const PredType& ALPHA_U8;
- static const PredType& ALPHA_U16;
- static const PredType& ALPHA_U32;
- static const PredType& ALPHA_U64;
- static const PredType& ALPHA_B8;
- static const PredType& ALPHA_B16;
- static const PredType& ALPHA_B32;
- static const PredType& ALPHA_B64;
- static const PredType& ALPHA_F32;
- static const PredType& ALPHA_F64;
-
- static const PredType& MIPS_I8;
- static const PredType& MIPS_I16;
- static const PredType& MIPS_I32;
- static const PredType& MIPS_I64;
- static const PredType& MIPS_U8;
- static const PredType& MIPS_U16;
- static const PredType& MIPS_U32;
- static const PredType& MIPS_U64;
- static const PredType& MIPS_B8;
- static const PredType& MIPS_B16;
- static const PredType& MIPS_B32;
- static const PredType& MIPS_B64;
- static const PredType& MIPS_F32;
- static const PredType& MIPS_F64;
-
- static const PredType& NATIVE_CHAR;
- static const PredType& NATIVE_SCHAR;
- static const PredType& NATIVE_UCHAR;
- static const PredType& NATIVE_SHORT;
- static const PredType& NATIVE_USHORT;
- static const PredType& NATIVE_INT;
- static const PredType& NATIVE_UINT;
- static const PredType& NATIVE_LONG;
- static const PredType& NATIVE_ULONG;
- static const PredType& NATIVE_LLONG;
- static const PredType& NATIVE_ULLONG;
- static const PredType& NATIVE_FLOAT;
- static const PredType& NATIVE_DOUBLE;
- static const PredType& NATIVE_LDOUBLE;
- static const PredType& NATIVE_B8;
- static const PredType& NATIVE_B16;
- static const PredType& NATIVE_B32;
- static const PredType& NATIVE_B64;
- static const PredType& NATIVE_OPAQUE;
- static const PredType& NATIVE_HSIZE;
- static const PredType& NATIVE_HSSIZE;
- static const PredType& NATIVE_HERR;
- static const PredType& NATIVE_HBOOL;
-
- static const PredType& NATIVE_INT8;
- static const PredType& NATIVE_UINT8;
- static const PredType& NATIVE_INT16;
- static const PredType& NATIVE_UINT16;
- static const PredType& NATIVE_INT32;
- static const PredType& NATIVE_UINT32;
- static const PredType& NATIVE_INT64;
- static const PredType& NATIVE_UINT64;
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("PredType"); }
+
+ // Makes a copy of the predefined type and stores the new
+ // id in the left hand side object.
+ PredType& operator=(const PredType& rhs);
+
+ // Copy constructor - makes copy of the original object
+ PredType(const PredType& original);
+
+ // Noop destructor
+ virtual ~PredType();
+
+ /*! \brief This dummy function do not inherit from DataType - it will
+ throw a DataTypeIException if invoked.
+ */
+ void commit(H5Location& loc, const H5std_string& name);
+ /*! \brief This dummy function do not inherit from DataType - it will
+ throw a DataTypeIException if invoked.
+ */
+ void commit(H5Location& loc, const char* name);
+ /*! \brief This dummy function do not inherit from DataType - it will
+ throw a DataTypeIException if invoked.
+ */
+ bool committed();
+
+ ///\brief PredType constants
+ static const PredType& STD_I8BE;
+ static const PredType& STD_I8LE;
+ static const PredType& STD_I16BE;
+ static const PredType& STD_I16LE;
+ static const PredType& STD_I32BE;
+ static const PredType& STD_I32LE;
+ static const PredType& STD_I64BE;
+ static const PredType& STD_I64LE;
+ static const PredType& STD_U8BE;
+ static const PredType& STD_U8LE;
+ static const PredType& STD_U16BE;
+ static const PredType& STD_U16LE;
+ static const PredType& STD_U32BE;
+ static const PredType& STD_U32LE;
+ static const PredType& STD_U64BE;
+ static const PredType& STD_U64LE;
+ static const PredType& STD_B8BE;
+ static const PredType& STD_B8LE;
+ static const PredType& STD_B16BE;
+ static const PredType& STD_B16LE;
+ static const PredType& STD_B32BE;
+ static const PredType& STD_B32LE;
+ static const PredType& STD_B64BE;
+ static const PredType& STD_B64LE;
+ static const PredType& STD_REF_OBJ;
+ static const PredType& STD_REF_DSETREG;
+
+ static const PredType& C_S1;
+ static const PredType& FORTRAN_S1;
+
+ static const PredType& IEEE_F32BE;
+ static const PredType& IEEE_F32LE;
+ static const PredType& IEEE_F64BE;
+ static const PredType& IEEE_F64LE;
+
+ static const PredType& UNIX_D32BE;
+ static const PredType& UNIX_D32LE;
+ static const PredType& UNIX_D64BE;
+ static const PredType& UNIX_D64LE;
+
+ static const PredType& INTEL_I8;
+ static const PredType& INTEL_I16;
+ static const PredType& INTEL_I32;
+ static const PredType& INTEL_I64;
+ static const PredType& INTEL_U8;
+ static const PredType& INTEL_U16;
+ static const PredType& INTEL_U32;
+ static const PredType& INTEL_U64;
+ static const PredType& INTEL_B8;
+ static const PredType& INTEL_B16;
+ static const PredType& INTEL_B32;
+ static const PredType& INTEL_B64;
+ static const PredType& INTEL_F32;
+ static const PredType& INTEL_F64;
+
+ static const PredType& ALPHA_I8;
+ static const PredType& ALPHA_I16;
+ static const PredType& ALPHA_I32;
+ static const PredType& ALPHA_I64;
+ static const PredType& ALPHA_U8;
+ static const PredType& ALPHA_U16;
+ static const PredType& ALPHA_U32;
+ static const PredType& ALPHA_U64;
+ static const PredType& ALPHA_B8;
+ static const PredType& ALPHA_B16;
+ static const PredType& ALPHA_B32;
+ static const PredType& ALPHA_B64;
+ static const PredType& ALPHA_F32;
+ static const PredType& ALPHA_F64;
+
+ static const PredType& MIPS_I8;
+ static const PredType& MIPS_I16;
+ static const PredType& MIPS_I32;
+ static const PredType& MIPS_I64;
+ static const PredType& MIPS_U8;
+ static const PredType& MIPS_U16;
+ static const PredType& MIPS_U32;
+ static const PredType& MIPS_U64;
+ static const PredType& MIPS_B8;
+ static const PredType& MIPS_B16;
+ static const PredType& MIPS_B32;
+ static const PredType& MIPS_B64;
+ static const PredType& MIPS_F32;
+ static const PredType& MIPS_F64;
+
+ static const PredType& NATIVE_CHAR;
+ static const PredType& NATIVE_SCHAR;
+ static const PredType& NATIVE_UCHAR;
+ static const PredType& NATIVE_SHORT;
+ static const PredType& NATIVE_USHORT;
+ static const PredType& NATIVE_INT;
+ static const PredType& NATIVE_UINT;
+ static const PredType& NATIVE_LONG;
+ static const PredType& NATIVE_ULONG;
+ static const PredType& NATIVE_LLONG;
+ static const PredType& NATIVE_ULLONG;
+ static const PredType& NATIVE_FLOAT;
+ static const PredType& NATIVE_DOUBLE;
+ static const PredType& NATIVE_LDOUBLE;
+ static const PredType& NATIVE_B8;
+ static const PredType& NATIVE_B16;
+ static const PredType& NATIVE_B32;
+ static const PredType& NATIVE_B64;
+ static const PredType& NATIVE_OPAQUE;
+ static const PredType& NATIVE_HSIZE;
+ static const PredType& NATIVE_HSSIZE;
+ static const PredType& NATIVE_HERR;
+ static const PredType& NATIVE_HBOOL;
+
+ static const PredType& NATIVE_INT8;
+ static const PredType& NATIVE_UINT8;
+ static const PredType& NATIVE_INT16;
+ static const PredType& NATIVE_UINT16;
+ static const PredType& NATIVE_INT32;
+ static const PredType& NATIVE_UINT32;
+ static const PredType& NATIVE_INT64;
+ static const PredType& NATIVE_UINT64;
// LEAST types
#if H5_SIZEOF_INT_LEAST8_T != 0
- static const PredType& NATIVE_INT_LEAST8;
+ static const PredType& NATIVE_INT_LEAST8;
#endif /* H5_SIZEOF_INT_LEAST8_T */
#if H5_SIZEOF_UINT_LEAST8_T != 0
- static const PredType& NATIVE_UINT_LEAST8;
+ static const PredType& NATIVE_UINT_LEAST8;
#endif /* H5_SIZEOF_UINT_LEAST8_T */
#if H5_SIZEOF_INT_LEAST16_T != 0
- static const PredType& NATIVE_INT_LEAST16;
+ static const PredType& NATIVE_INT_LEAST16;
#endif /* H5_SIZEOF_INT_LEAST16_T */
#if H5_SIZEOF_UINT_LEAST16_T != 0
- static const PredType& NATIVE_UINT_LEAST16;
+ static const PredType& NATIVE_UINT_LEAST16;
#endif /* H5_SIZEOF_UINT_LEAST16_T */
#if H5_SIZEOF_INT_LEAST32_T != 0
- static const PredType& NATIVE_INT_LEAST32;
+ static const PredType& NATIVE_INT_LEAST32;
#endif /* H5_SIZEOF_INT_LEAST32_T */
#if H5_SIZEOF_UINT_LEAST32_T != 0
- static const PredType& NATIVE_UINT_LEAST32;
+ static const PredType& NATIVE_UINT_LEAST32;
#endif /* H5_SIZEOF_UINT_LEAST32_T */
#if H5_SIZEOF_INT_LEAST64_T != 0
- static const PredType& NATIVE_INT_LEAST64;
+ static const PredType& NATIVE_INT_LEAST64;
#endif /* H5_SIZEOF_INT_LEAST64_T */
#if H5_SIZEOF_UINT_LEAST64_T != 0
- static const PredType& NATIVE_UINT_LEAST64;
+ static const PredType& NATIVE_UINT_LEAST64;
#endif /* H5_SIZEOF_UINT_LEAST64_T */
// FAST types
#if H5_SIZEOF_INT_FAST8_T != 0
- static const PredType& NATIVE_INT_FAST8;
+ static const PredType& NATIVE_INT_FAST8;
#endif /* H5_SIZEOF_INT_FAST8_T */
#if H5_SIZEOF_UINT_FAST8_T != 0
- static const PredType& NATIVE_UINT_FAST8;
+ static const PredType& NATIVE_UINT_FAST8;
#endif /* H5_SIZEOF_UINT_FAST8_T */
#if H5_SIZEOF_INT_FAST16_T != 0
- static const PredType& NATIVE_INT_FAST16;
+ static const PredType& NATIVE_INT_FAST16;
#endif /* H5_SIZEOF_INT_FAST16_T */
#if H5_SIZEOF_UINT_FAST16_T != 0
- static const PredType& NATIVE_UINT_FAST16;
+ static const PredType& NATIVE_UINT_FAST16;
#endif /* H5_SIZEOF_UINT_FAST16_T */
#if H5_SIZEOF_INT_FAST32_T != 0
- static const PredType& NATIVE_INT_FAST32;
+ static const PredType& NATIVE_INT_FAST32;
#endif /* H5_SIZEOF_INT_FAST32_T */
#if H5_SIZEOF_UINT_FAST32_T != 0
- static const PredType& NATIVE_UINT_FAST32;
+ static const PredType& NATIVE_UINT_FAST32;
#endif /* H5_SIZEOF_UINT_FAST32_T */
#if H5_SIZEOF_INT_FAST64_T != 0
- static const PredType& NATIVE_INT_FAST64;
+ static const PredType& NATIVE_INT_FAST64;
#endif /* H5_SIZEOF_INT_FAST64_T */
#if H5_SIZEOF_UINT_FAST64_T != 0
- static const PredType& NATIVE_UINT_FAST64;
+ static const PredType& NATIVE_UINT_FAST64;
#endif /* H5_SIZEOF_UINT_FAST64_T */
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -242,11 +242,11 @@ class H5_DLLCPP PredType : public AtomType {
static const PredType& PREDTYPE_CONST; // dummy constant
protected:
- // Default constructor
- PredType();
+ // Default constructor
+ PredType();
- // Creates a pre-defined type using an HDF5 pre-defined constant
- PredType( const hid_t predtype_id ); // used by the library only
+ // Creates a pre-defined type using an HDF5 pre-defined constant
+ PredType(const hid_t predtype_id); // used by the library only
private:
// Activates the creation of the PredType global constants
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 1564a93..c4176c2 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -21,7 +21,7 @@
#include <string>
-#include "H5private.h" // for HDmemset
+#include "H5private.h" // for HDmemset
#include "H5Include.h"
#include "H5Exception.h"
#include "H5IdComponent.h"
@@ -42,7 +42,7 @@ PropList* PropList::DEFAULT_ = 0;
//--------------------------------------------------------------------------
// Function: PropList::getConstant
-// Purpose: Creates a PropList object representing the HDF5 constant
+// Purpose Creates a PropList object representing the HDF5 constant
// H5P_DEFAULT, pointed to by PropList::DEFAULT_.
// Exception H5::PropListIException
// Description
@@ -71,7 +71,7 @@ PropList* PropList::getConstant()
//--------------------------------------------------------------------------
// Function: PropList::deleteConstants
-// Purpose: Deletes the constant object that PropList::DEFAULT_ points to.
+// Purpose Deletes the constant object that PropList::DEFAULT_ points to.
// Programmer Binh-Minh Ribler - 2015
//--------------------------------------------------------------------------
void PropList::deleteConstants()
@@ -81,24 +81,24 @@ void PropList::deleteConstants()
}
//--------------------------------------------------------------------------
-// Purpose Constant for default property.
+// Purpose Constant for default property.
//--------------------------------------------------------------------------
const PropList& PropList::DEFAULT = *getConstant();
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function Default constructor
-///\brief Default constructor: creates a stub property list object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: Default constructor
+///\brief Default constructor: creates a stub property list object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PropList::PropList() : IdComponent(), id(H5P_DEFAULT) {}
//--------------------------------------------------------------------------
-// Function: PropList copy constructor
-///\brief Copy constructor
-///\param original - IN: The original property list to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: PropList copy constructor
+///\brief Copy constructor
+///\param original - IN: The original property list to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PropList::PropList(const PropList& original) : IdComponent(), id(original.id)
{
@@ -106,166 +106,166 @@ PropList::PropList(const PropList& original) : IdComponent(), id(original.id)
}
//--------------------------------------------------------------------------
-// Function: PropList overloaded constructor
-///\brief Creates a property list using the id of an existing property.
-///\param plist_id - IN: Id of the existing property list
-///\exception H5::PropListIException
+// Function: PropList overloaded constructor
+///\brief Creates a property list using the id of an existing property.
+///\param plist_id - IN: Id of the existing property list
+///\exception H5::PropListIException
// Description
-// This function creates a new property list if a property
-// class is provided or makes a copy of a property list if one
-// is given. If the given id is anything else, then set this
-// property's id to H5P_DEFAULT.
-// Programmer Binh-Minh Ribler - 2000
+// This function creates a new property list if a property
+// class is provided or makes a copy of a property list if one
+// is given. If the given id is anything else, then set this
+// property's id to H5P_DEFAULT.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList::PropList( const hid_t plist_id ) : IdComponent()
+PropList::PropList(const hid_t plist_id) : IdComponent()
{
if (plist_id <= 0)
- id = H5P_DEFAULT;
+ id = H5P_DEFAULT;
H5I_type_t id_type = H5Iget_type(plist_id);
switch (id_type) {
- case H5I_GENPROP_CLS:
- // call C routine to create a new property from the given prop class
- id = H5Pcreate(plist_id);
- if( id < 0 )
- {
- throw PropListIException("PropList constructor", "H5Pcreate failed");
- }
- break;
- case H5I_GENPROP_LST:
- // call C routine to make a copy of the given property list
- id = H5Pcopy(plist_id);
- if( id < 0 )
- {
- throw PropListIException("PropList constructor", "H5Pcopy failed");
- }
- break;
- default:
- id = H5P_DEFAULT;
- break;
+ case H5I_GENPROP_CLS:
+ // call C routine to create a new property from the given prop class
+ id = H5Pcreate(plist_id);
+ if (id < 0)
+ {
+ throw PropListIException("PropList constructor", "H5Pcreate failed");
+ }
+ break;
+ case H5I_GENPROP_LST:
+ // call C routine to make a copy of the given property list
+ id = H5Pcopy(plist_id);
+ if (id < 0)
+ {
+ throw PropListIException("PropList constructor", "H5Pcopy failed");
+ }
+ break;
+ default:
+ id = H5P_DEFAULT;
+ break;
}
}
//--------------------------------------------------------------------------
-// Function: PropList::copy
-///\brief Makes a copy of an existing property list.
-///\param like_plist - IN: Reference to the existing property list
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: PropList::copy
+///\brief Makes a copy of an existing property list.
+///\param like_plist - IN: Reference to the existing property list
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
-void PropList::copy( const PropList& like_plist )
+void PropList::copy(const PropList& like_plist)
{
// If this object is representing an hdf5 object, close it before
// copying like_plist to it
try {
- close();
+ close();
}
catch (Exception& close_error) {
- throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg());
+ throw PropListIException(inMemFunc("copy"), close_error.getDetailMsg());
}
// call C routine to copy the property list
- id = H5Pcopy( like_plist.getId() );
- if( id < 0 )
- throw PropListIException(inMemFunc("copy"), "H5Pcopy failed");
+ id = H5Pcopy(like_plist.getId());
+ if (id < 0)
+ throw PropListIException(inMemFunc("copy"), "H5Pcopy failed");
}
//--------------------------------------------------------------------------
-// Function: PropList::operator=
-///\brief Assignment operator.
-///\param rhs - IN: Reference to the existing property list
-///\return Reference to PropList instance
-///\exception H5::PropListIException
+// Function: PropList::operator=
+///\brief Assignment operator.
+///\param rhs - IN: Reference to the existing property list
+///\return Reference to PropList instance
+///\exception H5::PropListIException
// Description
-// Makes a copy of the property list on the right hand side
-// and stores the new id in the left hand side object.
-// Programmer Binh-Minh Ribler - 2000
+// Makes a copy of the property list on the right hand side
+// and stores the new id in the left hand side object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList& PropList::operator=( const PropList& rhs )
+PropList& PropList::operator=(const PropList& rhs)
{
if (this != &rhs)
- copy(rhs);
+ copy(rhs);
return(*this);
}
//--------------------------------------------------------------------------
-// Function: PropList::copyProp
-///\brief Copies a property from this property list or class to another
-///\param dest - IN: Destination property list or class
-///\param name - IN: Name of the property to copy - \c char pointer
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: PropList::copyProp
+///\brief Copies a property from this property list or class to another
+///\param dest - IN: Destination property list or class
+///\param name - IN: Name of the property to copy - \c char pointer
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
void PropList::copyProp(PropList& dest, const char *name) const
{
- hid_t dst_id = dest.getId();
- herr_t ret_value = H5Pcopy_prop(dst_id, id, name);
- if( ret_value < 0 )
- {
- throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed");
- }
+ hid_t dst_id = dest.getId();
+ herr_t ret_value = H5Pcopy_prop(dst_id, id, name);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::copyProp
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param dest - IN: Destination property list or class
-///\param name - IN: Name of the property to copy - \c H5std_string
-// Programmer Binh-Minh Ribler - Jul, 2005
+// Function: PropList::copyProp
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param dest - IN: Destination property list or class
+///\param name - IN: Name of the property to copy - \c H5std_string
+// Programmer Binh-Minh Ribler - Jul, 2005
//--------------------------------------------------------------------------
-void PropList::copyProp( PropList& dest, const H5std_string& name ) const
+void PropList::copyProp(PropList& dest, const H5std_string& name) const
{
- copyProp( dest, name.c_str());
+ copyProp(dest, name.c_str());
}
//--------------------------------------------------------------------------
-// Function: PropList::copyProp
-///\brief Copies a property from one list or class to another - Obsolete
-///\param dest - IN: Destination property list or class
-///\param src - IN: Source property list or class
-///\param name - IN: Name of the property to copy - \c char pointer
-///\note This member function will be removed in the next release
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: PropList::copyProp
+///\brief Copies a property from one list or class to another - Obsolete
+///\param dest - IN: Destination property list or class
+///\param src - IN: Source property list or class
+///\param name - IN: Name of the property to copy - \c char pointer
+///\note This member function will be removed in the next release
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const
+void PropList::copyProp(PropList& dest, PropList& src, const char *name) const
{
- hid_t dst_id = dest.getId();
- hid_t src_id = src.getId();
- herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name);
- if( ret_value < 0 )
- {
- throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed");
- }
+ hid_t dst_id = dest.getId();
+ hid_t src_id = src.getId();
+ herr_t ret_value = H5Pcopy_prop(dst_id, src_id, name);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("copyProp"), "H5Pcopy_prop failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::copyProp
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts. - Obsolete
-///\param dest - IN: Destination property list or class
-///\param src - IN: Source property list or class
-///\param name - IN: Name of the property to copy - \c H5std_string
-// Programmer Binh-Minh Ribler - 2000
+// Function: PropList::copyProp
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts. - Obsolete
+///\param dest - IN: Destination property list or class
+///\param src - IN: Source property list or class
+///\param name - IN: Name of the property to copy - \c H5std_string
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name ) const
+void PropList::copyProp(PropList& dest, PropList& src, const H5std_string& name) const
{
- copyProp( dest, src, name.c_str());
+ copyProp(dest, src, name.c_str());
}
//--------------------------------------------------------------------------
// Function: PropList::getId
-///\brief Get the id of this property list
-///\return Property list identifier
+///\brief Get the id of this property list
+///\return Property list identifier
// Description:
// Class hierarchy is revised to address bugzilla 1068. Class
// AbstractDS and Attribute are moved out of H5Object. In
@@ -275,7 +275,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const H5std_string& name
//--------------------------------------------------------------------------
hid_t PropList::getId() const
{
- return(id);
+ return(id);
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
@@ -307,444 +307,441 @@ void PropList::p_setId(const hid_t new_id)
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: PropList::close
-///\brief Closes the property list if it is not a default one.
+// Function: PropList::close
+///\brief Closes the property list if it is not a default one.
///
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - Mar 9, 2005
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - Mar 9, 2005
//--------------------------------------------------------------------------
void PropList::close()
{
if (p_valid_id(id))
{
- herr_t ret_value = H5Pclose( id );
- if( ret_value < 0 )
- {
- throw PropListIException(inMemFunc("close"), "H5Pclose failed");
- }
- // reset the id
- id = H5I_INVALID_HID;
+ herr_t ret_value = H5Pclose(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("close"), "H5Pclose failed");
+ }
+ // reset the id
+ id = H5I_INVALID_HID;
}
}
//--------------------------------------------------------------------------
-// Function: PropList::getClass
-///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE...
-///\return The property list class if it is not equal to \c H5P_ROOT
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - April, 2004
+// Function: PropList::getClass
+///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE...
+///\return The property list class if it is not equal to \c H5P_ROOT
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hid_t PropList::getClass() const
{
- hid_t plist_class = H5Pget_class( id );
- if( plist_class == H5P_ROOT )
- {
- throw PropListIException(inMemFunc("getClass"),
- "H5Pget_class failed - returned H5P_ROOT");
- }
- return( plist_class );
+ hid_t plist_class = H5Pget_class(id);
+ if (plist_class == H5P_ROOT)
+ {
+ throw PropListIException(inMemFunc("getClass"),
+ "H5Pget_class failed - returned H5P_ROOT");
+ }
+ return(plist_class);
}
//--------------------------------------------------------------------------
-// Function: PropList::propExist
-///\brief Queries the existence of a property in a property object.
-///\param name - IN: Name of property to check for - \c char pointer
-///\return true if the property exists in the property object, and
-/// false, otherwise.
-///\exception H5::PropListIException
+// Function: PropList::propExist
+///\brief Queries the existence of a property in a property object.
+///\param name - IN: Name of property to check for - \c char pointer
+///\return true if the property exists in the property object, and
+/// false, otherwise.
+///\exception H5::PropListIException
///\par Description
-/// This routine checks if a property exists within a property
-/// list or class.
+/// This routine checks if a property exists within a property
+/// list or class.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-bool PropList::propExist(const char* name ) const
-{
- // Calls C routine H5Pexist to determine whether a property exists
- // within a property list or class. It returns a positive value, 0,
- // or a negative value
- htri_t ret_value = H5Pexist(id, name);
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else // Raise exception when H5Pexist returns a negative value
- {
- throw PropListIException(inMemFunc("propExist"), "H5Pexist failed");
- }
-}
-//--------------------------------------------------------------------------
-// Function: PropList::propExist
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to check for - \c H5std_string
+bool PropList::propExist(const char* name) const
+{
+ // Calls C routine H5Pexist to determine whether a property exists
+ // within a property list or class. It returns a positive value, 0,
+ // or a negative value
+ htri_t ret_value = H5Pexist(id, name);
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else // Raise exception when H5Pexist returns a negative value
+ {
+ throw PropListIException(inMemFunc("propExist"), "H5Pexist failed");
+ }
+}
+//--------------------------------------------------------------------------
+// Function: PropList::propExist
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to check for - \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
-bool PropList::propExist(const H5std_string& name ) const
+bool PropList::propExist(const H5std_string& name) const
{
- return( propExist( name.c_str()) );
+ return(propExist( name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: PropList::closeClass
-///\brief Close a property list class.
+// Function: PropList::closeClass
+///\brief Close a property list class.
///
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
-/// Releases memory and detaches a class from the property
-/// list class hierarchy.
+/// Releases memory and detaches a class from the property
+/// list class hierarchy.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::closeClass() const
{
- herr_t ret_value = H5Pclose_class(id);
- if( ret_value < 0 )
- {
- throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed");
- }
+ herr_t ret_value = H5Pclose_class(id);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("closeClass"), "H5Pclose_class failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::getProperty
-///\brief Query the value of a property in a property list.
-///\param name - IN: Name of property to query - \c char pointer
-///\param value - OUT: Pointer to the buffer for the property value
-///\exception H5::PropListIException
+// Function: PropList::getProperty
+///\brief Query the value of a property in a property list.
+///\param name - IN: Name of property to query - \c char pointer
+///\param value - OUT: Pointer to the buffer for the property value
+///\exception H5::PropListIException
///\par Description
-/// Retrieves a copy of the value for a property in a property
-/// list. The property name must exist or this routine will
-/// throw an exception.
+/// Retrieves a copy of the value for a property in a property
+/// list. The property name must exist or this routine will
+/// throw an exception.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::getProperty(const char* name, void* value) const
{
- herr_t ret_value = H5Pget(id, name, value);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("getProperty"), "H5Pget failed");
- }
+ herr_t ret_value = H5Pget(id, name, value);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("getProperty"), "H5Pget failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::getProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to query - \c char pointer
-///\return The property that is a \c H5std_string.
-///\exception H5::PropListIException
+// Function: PropList::getProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to query - \c char pointer
+///\return The property that is a \c H5std_string.
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5std_string PropList::getProperty(const char* name) const
{
- // Get property size first
- size_t size = getPropSize(name);
+ // Get property size first
+ size_t size = getPropSize(name);
- // Allocate buffer then get the property
- char* prop_strg_C = new char[size+1]; // temporary C-string for C API
- HDmemset(prop_strg_C, 0, size+1); // clear buffer
+ // Allocate buffer then get the property
+ char* prop_strg_C = new char[size+1]; // temporary C-string for C API
+ HDmemset(prop_strg_C, 0, size+1); // clear buffer
- herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
+ herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API
- // Throw exception if H5Pget returns failure
- if (ret_value < 0)
- {
+ // Throw exception if H5Pget returns failure
+ if (ret_value < 0)
+ {
delete []prop_strg_C;
- throw PropListIException(inMemFunc("getProperty"), "H5Pget failed");
- }
+ throw PropListIException(inMemFunc("getProperty"), "H5Pget failed");
+ }
- // Return propety value as a string after deleting temp C-string
- H5std_string prop_strg(prop_strg_C);
- delete []prop_strg_C;
- return (prop_strg);
+ // Return propety value as a string after deleting temp C-string
+ H5std_string prop_strg(prop_strg_C);
+ delete []prop_strg_C;
+ return (prop_strg);
}
//--------------------------------------------------------------------------
-// Function: PropList::getProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to query - \c H5std_string
-///\param value - OUT: Pointer to the buffer for the property value
+// Function: PropList::getProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to query - \c H5std_string
+///\param value - OUT: Pointer to the buffer for the property value
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::getProperty(const H5std_string& name, void* value) const
{
- getProperty(name.c_str(), value);
+ getProperty(name.c_str(), value);
}
//--------------------------------------------------------------------------
-// Function: PropList::getProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to query - \c H5std_string
-///\return The property that is a \c H5std_string.
+// Function: PropList::getProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to query - \c H5std_string
+///\return The property that is a \c H5std_string.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5std_string PropList::getProperty(const H5std_string& name) const
{
- return (getProperty(name.c_str()));
+ return (getProperty(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: PropList::getPropSize
-///\brief Query the size of a property in a property list or class.
-///\param name - IN: Name of property to query
-///\return Size of the property
-///\exception H5::PropListIException
+// Function: PropList::getPropSize
+///\brief Query the size of a property in a property list or class.
+///\param name - IN: Name of property to query
+///\return Size of the property
+///\exception H5::PropListIException
///\par Description
-/// This routine retrieves the size of a property's value
-/// in bytes. Zero-sized properties are allowed and the return
-/// value will be of 0. This function works for both property
-/// lists and classes.
+/// This routine retrieves the size of a property's value
+/// in bytes. Zero-sized properties are allowed and the return
+/// value will be of 0. This function works for both property
+/// lists and classes.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t PropList::getPropSize(const char *name) const
{
- size_t prop_size;
- herr_t ret_value = H5Pget_size(id, name, &prop_size);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed");
- }
- return(prop_size);
+ size_t prop_size;
+ herr_t ret_value = H5Pget_size(id, name, &prop_size);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("getPropSize"), "H5Pget_size failed");
+ }
+ return(prop_size);
}
//--------------------------------------------------------------------------
-// Function: PropList::getPropSize
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to query - \c H5std_string
+// Function: PropList::getPropSize
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to query - \c H5std_string
///
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t PropList::getPropSize(const H5std_string& name) const
{
- return (getPropSize(name.c_str()));
+ return (getPropSize(name.c_str()));
}
//--------------------------------------------------------------------------
-// Function: PropList::getClassName
-///\brief Return the name of a generic property list class.
-///\return A string containing the class name, if success, otherwise,
-/// a NULL string.
+// Function: PropList::getClassName
+///\brief Return the name of a generic property list class.
+///\return A string containing the class name, if success, otherwise,
+/// a NULL string.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5std_string PropList::getClassName() const
{
- char* temp_str;
- temp_str = H5Pget_class_name(id); // this API specified that temp_str must
- // be freed.
-
- if (temp_str != NULL)
- {
- H5std_string class_name(temp_str);
- H5free_memory(temp_str);
- return(class_name);
- }
- else
- return 0;
+ char* temp_str;
+ temp_str = H5Pget_class_name(id);
+ if (temp_str != NULL)
+ {
+ H5std_string class_name(temp_str);
+ H5free_memory(temp_str);
+ return(class_name);
+ }
+ else
+ return 0;
}
//--------------------------------------------------------------------------
-// Function: PropList::getNumProps
-///\brief Returns the number of properties in this property list or class.
-///\return Size of the property.
-///\exception H5::PropListIException
+// Function: PropList::getNumProps
+///\brief Returns the number of properties in this property list or class.
+///\return Size of the property.
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t PropList::getNumProps() const
{
- size_t nprops;
- herr_t ret_value = H5Pget_nprops (id, &nprops);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed");
- }
- return (nprops);
+ size_t nprops;
+ herr_t ret_value = H5Pget_nprops (id, &nprops);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("getNumProps"), "H5Pget_nprops failed");
+ }
+ return (nprops);
}
//--------------------------------------------------------------------------
-// Function: PropList::setProperty
-///\brief Set a property's value in a property list.
-///\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
+// Function: PropList::setProperty
+///\brief Set a property's value in a property list.
+///\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
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::setProperty(const char* name, void* value) const
{
- herr_t ret_value = H5Pset(id, name, value);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
- }
+ herr_t ret_value = H5Pset(id, name, value);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::setProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to set - \c char pointer
-///\param charptr - IN: Char pointer to the value for the property
+// Function: PropList::setProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to set - \c char pointer
+///\param charptr - IN: Char pointer to the value for the property
// 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);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
- }
+ herr_t ret_value = H5Pset(id, name, (void*)charptr);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("setProperty"), "H5Pset failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::setProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to set - \c char pointer
-///\param strg - IN: Value for the property is a \c H5std_string
+// Function: PropList::setProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to set - \c char pointer
+///\param strg - IN: Value for the property is a \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::setProperty(const char* name, H5std_string& strg) const
{
- setProperty(name, strg.c_str());
+ setProperty(name, strg.c_str());
}
//--------------------------------------------------------------------------
-// Function: PropList::setProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to set - \c H5std_string
-///\param value - IN: Void pointer to the value for the property
+// Function: PropList::setProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to set - \c H5std_string
+///\param value - IN: Void pointer to the value for the property
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::setProperty(const H5std_string& name, void* value) const
{
- setProperty(name.c_str(), value);
+ setProperty(name.c_str(), value);
}
//--------------------------------------------------------------------------
-// Function: PropList::setProperty
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to set - \c H5std_string
-///\param strg - IN: Value for the property is a \c H5std_string
+// Function: PropList::setProperty
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to set - \c H5std_string
+///\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, H5std_string& strg) const
{
- setProperty(name.c_str(), strg.c_str());
+ setProperty(name.c_str(), strg.c_str());
}
//--------------------------------------------------------------------------
-// Function: PropList::isAClass
-///\brief Determines whether a property list is a certain class.
-///\param prop_class - IN: Property class to query
-///\return true if the property list is a member of the property list
-/// class, and false, otherwise.
-///\exception H5::PropListIException
+// Function: PropList::isAClass
+///\brief Determines whether a property list is a certain class.
+///\param prop_class - IN: Property class to query
+///\return true if the property list is a member of the property list
+/// class, and false, otherwise.
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
bool PropList::isAClass(const PropList& prop_class) const
{
- htri_t ret_value = H5Pisa_class(id, prop_class.getId());
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else // Raise exception when H5Pisa_class returns a negative value
- {
- throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed");
- }
-
+ htri_t ret_value = H5Pisa_class(id, prop_class.getId());
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else // Raise exception when H5Pisa_class returns a negative value
+ {
+ throw PropListIException(inMemFunc("isAClass"), "H5Pisa_class failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::removeProp
-///\brief Removes a property from a property list.
-///\param name - IN: Name of property to remove - \c char pointer
-///\exception H5::PropListIException
+// Function: PropList::removeProp
+///\brief Removes a property from a property list.
+///\param name - IN: Name of property to remove - \c char pointer
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::removeProp(const char *name) const
{
- herr_t ret_value = H5Premove(id, name);
- if (ret_value < 0)
- {
- throw PropListIException(inMemFunc("removeProp"), "H5Premove failed");
- }
+ herr_t ret_value = H5Premove(id, name);
+ if (ret_value < 0)
+ {
+ throw PropListIException(inMemFunc("removeProp"), "H5Premove failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::removeProp
-///\brief This is an overloaded member function, provided for convenience.
-/// It differs from the above function only in what arguments it
-/// accepts.
-///\param name - IN: Name of property to remove - \c H5std_string
+// Function: PropList::removeProp
+///\brief This is an overloaded member function, provided for convenience.
+/// It differs from the above function only in what arguments it
+/// accepts.
+///\param name - IN: Name of property to remove - \c H5std_string
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void PropList::removeProp(const H5std_string& name) const
{
- removeProp(name.c_str());
+ removeProp(name.c_str());
}
//--------------------------------------------------------------------------
-// Function: PropList::operator==
-///\brief Compares this property list or class against the given list or class.
-///\param rhs - IN: Reference to the property list to compare
-///\return true if the property lists or classes are equal, and
-/// false, otherwise.
-///\exception H5::PropListIException
+// Function: PropList::operator==
+///\brief Compares this property list or class against the given list or class.
+///\param rhs - IN: Reference to the property list to compare
+///\return true if the property lists or classes are equal, and
+/// false, otherwise.
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
bool PropList::operator==(const PropList& rhs) const
{
- htri_t ret_value = H5Pequal(id, rhs.getId());
- if( ret_value > 0 )
- return true;
- else if( ret_value == 0 )
- return false;
- else // Raise exception when H5Pequal returns a negative value
- {
- throw PropListIException(inMemFunc("operator=="), "H5Pequal failed");
- }
+ htri_t ret_value = H5Pequal(id, rhs.getId());
+ if (ret_value > 0)
+ return true;
+ else if (ret_value == 0)
+ return false;
+ else // Raise exception when H5Pequal returns a negative value
+ {
+ throw PropListIException(inMemFunc("operator=="), "H5Pequal failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: PropList::getClassParent
-///\brief Returns the parent class of a generic property class
-///\return The parent class of a property class
-///\exception H5::PropListIException
+// Function: PropList::getClassParent
+///\brief Returns the parent class of a generic property class
+///\return The parent class of a property class
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
PropList PropList::getClassParent() const
{
- hid_t class_id = H5Pget_class_parent(id);
- if (class_id < 0)
- {
- throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed");
- }
- PropList pclass(class_id);
- return(pclass);
+ hid_t class_id = H5Pget_class_parent(id);
+ if (class_id < 0)
+ {
+ throw PropListIException(inMemFunc("getClassParent"), "H5Pget_class_parent failed");
+ }
+ PropList pclass(class_id);
+ return(pclass);
}
//--------------------------------------------------------------------------
-// Function: PropList destructor
-///\brief Properly terminates access to this property list.
-// Programmer Binh-Minh Ribler - 2000
+// Function: PropList destructor
+///\brief Properly terminates access to this property list.
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// - Replaced resetIdComponent() with decRefCount() to use C
-// library ID reference counting mechanism - BMR, Jun 1, 2004
-// - Replaced decRefCount with close() to let the C library
-// handle the reference counting - BMR, Jun 1, 2006
+// - Replaced resetIdComponent() with decRefCount() to use C
+// library ID reference counting mechanism - BMR, Jun 1, 2004
+// - Replaced decRefCount with close() to let the C library
+// handle the reference counting - BMR, Jun 1, 2006
//--------------------------------------------------------------------------
PropList::~PropList()
{
try {
- close();
+ close();
}
catch (Exception& close_error) {
- cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl;
+ cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl;
}
}
diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h
index faaf68d..3977774 100644
--- a/c++/src/H5PropList.h
+++ b/c++/src/H5PropList.h
@@ -28,111 +28,111 @@ namespace H5 {
*/
class H5_DLLCPP PropList : public IdComponent {
public:
- ///\brief Default property list
+ ///\brief Default property list
static const PropList& DEFAULT;
- // Creates a property list of a given type or creates a copy of an
- // existing property list giving the property list id.
- PropList(const hid_t plist_id);
+ // Creates a property list of a given type or creates a copy of an
+ // existing property list giving the property list id.
+ PropList(const hid_t plist_id);
- // Make a copy of the given property list using assignment statement
- PropList& operator=( const PropList& rhs );
+ // Make a copy of the given property list using assignment statement
+ PropList& operator=(const PropList& rhs);
- // Compares this property list or class against the given list or class.
- bool operator==(const PropList& rhs) const;
+ // Compares this property list or class against the given list or class.
+ bool operator==(const PropList& rhs) const;
- // Close this property list.
- virtual void close();
+ // Close this property list.
+ virtual void close();
- // Close a property list class.
- void closeClass() const;
+ // Close a property list class.
+ void closeClass() const;
- // Makes a copy of the given property list.
- void copy( const PropList& like_plist );
+ // Makes a copy of the given property list.
+ void copy(const PropList& like_plist);
- // Copies a property from this property list or class to another
- void copyProp( PropList& dest, const char* name) const;
- void copyProp( PropList& dest, const H5std_string& name) const;
+ // Copies a property from this property list or class to another
+ void copyProp(PropList& dest, const char* name) const;
+ void copyProp(PropList& dest, const H5std_string& name) const;
- // Copies a property from one property list or property class to another
- void copyProp( PropList& dest, PropList& src, const char* name) const;
- void copyProp( PropList& dest, PropList& src, const H5std_string& name) const;
+ // Copies a property from one property list or property class to another
+ void copyProp(PropList& dest, PropList& src, const char* name) const;
+ void copyProp(PropList& dest, PropList& src, const H5std_string& name) const;
- // Gets the class of this property list, i.e. H5P_FILE_CREATE,
- // H5P_FILE_ACCESS, ...
- hid_t getClass() const;
+ // Gets the class of this property list, i.e. H5P_FILE_CREATE,
+ // H5P_FILE_ACCESS, ...
+ hid_t getClass() const;
- // Return the name of a generic property list class.
- H5std_string getClassName() const;
+ // Return the name of a generic property list class.
+ H5std_string getClassName() const;
- // Returns the parent class of a generic property class.
- PropList getClassParent() const;
+ // Returns the parent class of a generic property class.
+ PropList getClassParent() const;
- // Returns the number of properties in this property list or class.
- size_t getNumProps() const;
+ // Returns the number of properties in this property list or class.
+ size_t getNumProps() const;
- // Query the value of a property in a property list.
- void getProperty(const char* name, void* value) const;
- void getProperty(const H5std_string& name, void* value) const;
- H5std_string getProperty(const char* name) const;
- H5std_string getProperty(const H5std_string& name) const;
+ // Query the value of a property in a property list.
+ void getProperty(const char* name, void* value) const;
+ void getProperty(const H5std_string& name, void* value) const;
+ H5std_string getProperty(const char* name) const;
+ 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, H5std_string& strg) const;
- void setProperty(const H5std_string& name, void* value) const;
- void setProperty(const H5std_string& name, H5std_string& strg) 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, H5std_string& strg) const;
+ void setProperty(const H5std_string& name, void* value) const;
+ void setProperty(const H5std_string& name, H5std_string& strg) const;
- // Query the size of a property in a property list or class.
- size_t getPropSize(const char *name) const;
- size_t getPropSize(const H5std_string& name) const;
+ // Query the size of a property in a property list or class.
+ size_t getPropSize(const char *name) const;
+ size_t getPropSize(const H5std_string& name) const;
- // Determines whether a property list is a certain class.
- bool isAClass(const PropList& prop_class) const;
+ // Determines whether a property list is a certain class.
+ bool isAClass(const PropList& prop_class) const;
- /// Query the existance of a property in a property object.
- bool propExist(const char* name) const;
- bool propExist(const H5std_string& name) const;
+ /// Query the existance of a property in a property object.
+ bool propExist(const char* name) const;
+ bool propExist(const H5std_string& name) const;
- // Removes a property from a property list.
- void removeProp(const char *name) const;
- void removeProp(const H5std_string& name) const;
+ // Removes a property from a property list.
+ void removeProp(const char *name) const;
+ void removeProp(const H5std_string& name) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("PropList"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("PropList"); }
- // Default constructor: creates a stub PropList object.
- PropList();
+ // Default constructor: creates a stub PropList object.
+ PropList();
- // Copy constructor: creates a copy of a PropList object.
- PropList(const PropList& original);
+ // Copy constructor: creates a copy of a PropList object.
+ PropList(const PropList& original);
- // Gets the property list id.
- virtual hid_t getId() const;
+ // Gets the property list id.
+ virtual hid_t getId() const;
- // Destructor: properly terminates access to this property list.
- virtual ~PropList();
+ // Destructor: properly terminates access to this property list.
+ virtual ~PropList();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // Deletes the PropList global constant
- static void deleteConstants();
+ // Deletes the PropList global constant
+ static void deleteConstants();
protected:
- hid_t id; // HDF5 property list id
+ hid_t id; // HDF5 property list id
- // Sets the property list id.
- virtual void p_setId(const hid_t new_id);
+ // Sets the property list id.
+ virtual void p_setId(const hid_t new_id);
private:
- static PropList* DEFAULT_;
+ static PropList* DEFAULT_;
- // Dynamically allocates the PropList global constant
- static PropList* getConstant();
+ // Dynamically allocates the PropList global constant
+ static PropList* getConstant();
- // Friend function to set PropList id. For library use only.
- friend void f_PropList_setId(PropList* plist, hid_t new_id);
+ // Friend function to set PropList id. For library use only.
+ friend void f_PropList_setId(PropList* plist, hid_t new_id);
#endif // DOXYGEN_SHOULD_SKIP_THIS
};
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index 50c9e45..54981ab 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -36,249 +36,247 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: StrType default constructor
-///\brief Default constructor: Creates a stub string datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType default constructor
+///\brief Default constructor: Creates a stub string datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType::StrType() : AtomType() {}
//--------------------------------------------------------------------------
-// Function: StrType overloaded constructor
-///\brief Creates a string datatype using a predefined type.
-///\param pred_type - IN: Predefined datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType overloaded constructor
+///\brief Creates a string datatype using a predefined type.
+///\param pred_type - IN: Predefined datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType( const PredType& pred_type ) : AtomType()
+StrType::StrType(const PredType& pred_type) : AtomType()
{
- // use DataType::copy to make a copy of this predefined type
- copy( pred_type );
+ // use DataType::copy to make a copy of this predefined type
+ copy(pred_type);
}
//--------------------------------------------------------------------------
-// Function: StrType overloaded constructor
-// Purpose Creates a string datatype with a specified length
-// Param pred_type - IN: String predefined type to replicate.
-// Param size - IN: Length of the new string type
-// Exception H5::DataTypeIException
+// Function: StrType overloaded constructor
+// Purpose Creates a string datatype with a specified length
+// Param pred_type - IN: String predefined type to replicate.
+// Param size - IN: Length of the new string type
+// Exception H5::DataTypeIException
// Description
-// The 1st argument could have been skipped, but this
-// constructor will collide with the one that takes an
-// existing id.
+// The 1st argument could have been skipped, but this
+// constructor will collide with the one that takes an
+// existing id.
//
-// Update: replacing the 1st argument with a dummy 0 to
-// avoid the clashing problem, that doesn't eliminate the
-// the 1st argument but it's simpler for the user to type
-// a '0' than PredType::C_S1. - Dec 2, 2005
+// Update: replacing the 1st argument with a dummy 0 to
+// avoid the clashing problem, that doesn't eliminate the
+// the 1st argument but it's simpler for the user to type
+// a '0' than PredType::C_S1. - Dec 2, 2005
// Note
-// The use of this constructor can be shortened by using
-// its overloaded below as StrType(0, size).
-// Programmer Binh-Minh Ribler - 2000
+// The use of this constructor can be shortened by using
+// its overloaded below as StrType(0, size).
+// Programmer Binh-Minh Ribler - 2000
// Modification
-// Planned for removal. -BMR, 2005/12/02
-// Removed from documentation. -BMR, 2016/03/07
+// Planned for removal. -BMR, 2005/12/02
+// Removed from documentation. -BMR, 2016/03/07
//--------------------------------------------------------------------------
-StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType()
+StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType()
{
- // use DataType::copy to make a copy of the string predefined type
- // then set its length
- copy(pred_type);
- setSize(size);
+ // use DataType::copy to make a copy of the string predefined type
+ // then set its length
+ copy(pred_type);
+ setSize(size);
}
//--------------------------------------------------------------------------
-// Function: StrType overloaded constructor
-///\brief Creates a string datatype with a specified length
-///\param dummy - IN: To simplify calling the previous constructor
-/// and avoid prototype clash with another constructor
-///\param size - IN: Length of the new string type
-///\exception H5::DataTypeIException
+// Function: StrType overloaded constructor
+///\brief Creates a string datatype with a specified length
+///\param dummy - IN: To simplify calling the previous constructor
+/// and avoid prototype clash with another constructor
+///\param size - IN: Length of the new string type
+///\exception H5::DataTypeIException
///\par Description
-/// The 1st argument is just a dummy to simplify calling the
-/// previous constructor, such as:
-/// StrType atype(0, size) instead of
-/// StrType atype(PredType::C_S1, size)
+/// The 1st argument is just a dummy to simplify calling the
+/// previous constructor, such as:
+/// StrType atype(0, size) instead of
+/// StrType atype(PredType::C_S1, size)
// Note
-// This constructor replaced the previous one.
-// Programmer Binh-Minh Ribler - Nov 28, 2005
+// This constructor replaced the previous one.
+// Programmer Binh-Minh Ribler - Nov 28, 2005
//--------------------------------------------------------------------------
-StrType::StrType( const int dummy, const size_t& size ) : AtomType()
+StrType::StrType(const int dummy, const size_t& size) : AtomType()
{
- // use DataType::copy to make a copy of the string predefined type
- // then set its length
- copy(PredType::C_S1);
- setSize(size);
+ // use DataType::copy to make a copy of the string predefined type
+ // then set its length
+ copy(PredType::C_S1);
+ setSize(size);
}
//--------------------------------------------------------------------------
-// Function: StrType overloaded constructor
-///\brief Creates an StrType object using the id of an existing datatype.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType overloaded constructor
+///\brief Creates an StrType object using the id of an existing datatype.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {}
+StrType::StrType(const hid_t existing_id) : AtomType( existing_id ) {}
//--------------------------------------------------------------------------
-// Function: StrType copy constructor
-///\brief Copy constructor: makes a copy of the original StrType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType copy constructor
+///\brief Copy constructor: makes a copy of the original StrType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType( const StrType& original ) : AtomType ( original ) {}
+StrType::StrType(const StrType& original) : AtomType ( original ) {}
//--------------------------------------------------------------------------
-// Function: StrType overloaded constructor
-///\brief Gets the string datatype of the specified dataset
-///\param dataset - IN: Dataset that this string datatype associates with
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType overloaded constructor
+///\brief Gets the string datatype of the specified dataset
+///\param dataset - IN: Dataset that this string datatype associates with
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType( const DataSet& dataset ) : AtomType ()
+StrType::StrType(const DataSet& dataset) : AtomType ()
{
- // Calls C function H5Dget_type to get the id of the datatype
- id = H5Dget_type( dataset.getId() );
+ // Calls C function H5Dget_type to get the id of the datatype
+ id = H5Dget_type(dataset.getId());
- if( id < 0 )
- {
- throw DataSetIException("StrType constructor", "H5Dget_type failed");
- }
+ if (id < 0)
+ {
+ throw DataSetIException("StrType constructor", "H5Dget_type failed");
+ }
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: String type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openStrType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openStrType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType()
{
- id = p_opentype(loc, dtype_name);
+ id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: String type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openStrType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openStrType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: StrType::getCset
-///\brief Retrieves the character set type of this string datatype.
-///\return Character set type, which can be:
-/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
+// Function: StrType::getCset
+///\brief Retrieves the character set type of this string datatype.
+///\return Character set type, which can be:
+/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
///\note
-/// ASCII and UTF-8 Unicode are the only currently supported character
-/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
-/// supported. This encoding policy is not enforced by the HDF5 Library.
-/// Using encodings other than ASCII and UTF-8 can lead to compatibility
-/// and usability problems. See the C API entry H5Pset_char_encoding for
-/// more information.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+/// ASCII and UTF-8 Unicode are the only currently supported character
+/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
+/// supported. This encoding policy is not enforced by the HDF5 Library.
+/// Using encodings other than ASCII and UTF-8 can lead to compatibility
+/// and usability problems. See the C API entry H5Pset_char_encoding for
+/// more information.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_cset_t StrType::getCset() const
{
- H5T_cset_t cset = H5Tget_cset( id );
+ H5T_cset_t cset = H5Tget_cset(id);
- // Returns a valid character set type if successful
- if( cset == H5T_CSET_ERROR )
- {
- throw DataTypeIException("StrType::getCset", "H5Tget_cset failed");
- }
- return( cset );
+ // Returns a valid character set type if successful
+ if (cset == H5T_CSET_ERROR)
+ {
+ throw DataTypeIException("StrType::getCset", "H5Tget_cset failed");
+ }
+ return(cset);
}
//--------------------------------------------------------------------------
-// Function: StrType::setCset
-///\brief Sets character set to be used.
-///\param cset - IN: character set type, which can be:
-/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
+// Function: StrType::setCset
+///\brief Sets character set to be used.
+///\param cset - IN: character set type, which can be:
+/// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII.
///\note
-/// ASCII and UTF-8 Unicode are the only currently supported character
-/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
-/// supported. This encoding policy is not enforced by the HDF5 Library.
-/// Using encodings other than ASCII and UTF-8 can lead to compatibility
-/// and usability problems. See the C API entry H5Pset_char_encoding for
-/// more information.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+/// ASCII and UTF-8 Unicode are the only currently supported character
+/// encodings. Extended ASCII encodings (for example, ISO 8859) are not
+/// supported. This encoding policy is not enforced by the HDF5 Library.
+/// Using encodings other than ASCII and UTF-8 can lead to compatibility
+/// and usability problems. See the C API entry H5Pset_char_encoding for
+/// more information.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void StrType::setCset( H5T_cset_t cset ) const
+void StrType::setCset(H5T_cset_t cset) const
{
- herr_t ret_value = H5Tset_cset( id, cset );
-
- if( ret_value < 0 )
- {
- throw DataTypeIException("StrType::setCset", "H5Tset_cset failed");
- }
+ herr_t ret_value = H5Tset_cset(id, cset);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("StrType::setCset", "H5Tset_cset failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: StrType::getStrpad
-///\brief Retrieves the storage mechanism for of this string datatype.
-///\return String storage mechanism, which can be:
-/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does)
-/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros
-/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does)
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType::getStrpad
+///\brief Retrieves the storage mechanism for of this string datatype.
+///\return String storage mechanism, which can be:
+/// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does)
+/// \li \c H5T_STR_NULLPAD (0) - Pad with zeros
+/// \li \c H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does)
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_str_t StrType::getStrpad() const
{
- H5T_str_t strpad = H5Tget_strpad( id );
+ H5T_str_t strpad = H5Tget_strpad(id);
- // Returns a valid string padding type if successful
- if( strpad == H5T_STR_ERROR )
- {
- throw DataTypeIException("StrType::getStrpad",
- "H5Tget_strpad failed - returned H5T_STR_ERROR");
- }
- return( strpad );
+ // Returns a valid string padding type if successful
+ if (strpad == H5T_STR_ERROR)
+ {
+ throw DataTypeIException("StrType::getStrpad",
+ "H5Tget_strpad failed - returned H5T_STR_ERROR");
+ }
+ return(strpad);
}
//--------------------------------------------------------------------------
-// Function: StrType::setStrpad
-///\brief Defines the storage mechanism for this string datatype.
-///\param strpad - IN: String padding type
-///\exception H5::DataTypeIException
+// Function: StrType::setStrpad
+///\brief Defines the storage mechanism for this string datatype.
+///\param strpad - IN: String padding type
+///\exception H5::DataTypeIException
///\par Description
-/// For detail, please refer to the C layer Reference Manual at:
+/// For detail, please refer to the C layer Reference Manual at:
/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void StrType::setStrpad( H5T_str_t strpad ) const
+void StrType::setStrpad(H5T_str_t strpad) const
{
- herr_t ret_value = H5Tset_strpad( id, strpad );
-
- if( ret_value < 0 )
- {
- throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed");
- }
+ herr_t ret_value = H5Tset_strpad(id, strpad);
+ if (ret_value < 0)
+ {
+ throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed");
+ }
}
//--------------------------------------------------------------------------
-// Function: StrType destructor
-///\brief Properly terminates access to this string datatype.
-// Programmer Binh-Minh Ribler - 2000
+// Function: StrType destructor
+///\brief Properly terminates access to this string datatype.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType::~StrType() {}
diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h
index b920a3b..3272ad3 100644
--- a/c++/src/H5StrType.h
+++ b/c++/src/H5StrType.h
@@ -27,48 +27,48 @@ namespace H5 {
*/
class H5_DLLCPP StrType : public AtomType {
public:
- // Creates a string type using a predefined type
- StrType(const PredType& pred_type);
+ // Creates a string type using a predefined type
+ StrType(const PredType& pred_type);
- // Creates a string type with specified length - may be obsolete
- StrType(const PredType& pred_type, const size_t& size);
+ // Creates a string type with specified length - may be obsolete
+ StrType(const PredType& pred_type, const size_t& size);
- // Creates a string type with specified length
- StrType(const int dummy, const size_t& size);
+ // Creates a string type with specified length
+ StrType(const int dummy, const size_t& size);
// Gets the string datatype of the specified dataset
- StrType(const DataSet& dataset);
+ StrType(const DataSet& dataset);
- // Constructors that open an HDF5 string datatype, given a location.
- StrType(const H5Location& loc, const char* name);
- StrType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open an HDF5 string datatype, given a location.
+ StrType(const H5Location& loc, const char* name);
+ StrType(const H5Location& loc, const H5std_string& name);
- // Retrieves the character set type of this string datatype.
- H5T_cset_t getCset() const;
+ // Retrieves the character set type of this string datatype.
+ H5T_cset_t getCset() const;
- // Sets character set to be used.
- void setCset(H5T_cset_t cset) const;
+ // Sets character set to be used.
+ void setCset(H5T_cset_t cset) const;
- // Retrieves the string padding method for this string datatype.
- H5T_str_t getStrpad() const;
+ // Retrieves the string padding method for this string datatype.
+ H5T_str_t getStrpad() const;
- // Defines the storage mechanism for character strings.
- void setStrpad(H5T_str_t strpad) const;
+ // Defines the storage mechanism for character strings.
+ void setStrpad(H5T_str_t strpad) const;
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("StrType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("StrType"); }
- // default constructor
- StrType();
+ // default constructor
+ StrType();
- // Creates a string datatype using an existing id
- StrType(const hid_t existing_id);
+ // Creates a string datatype using an existing id
+ StrType(const hid_t existing_id);
- // Copy constructor - makes a copy of the original object
- StrType(const StrType& original);
+ // Copy constructor - makes a copy of the original object
+ StrType(const StrType& original);
- // Noop destructor.
- virtual ~StrType();
+ // Noop destructor.
+ virtual ~StrType();
};
}
#endif // __H5StrType_H
diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp
index 5ecc39b..7f50b9a 100644
--- a/c++/src/H5VarLenType.cpp
+++ b/c++/src/H5VarLenType.cpp
@@ -30,88 +30,88 @@
namespace H5 {
//--------------------------------------------------------------------------
-// Function: VarLenType default constructor
-///\brief Default constructor: Creates a stub variable-length datatype.
+// Function: VarLenType default constructor
+///\brief Default constructor: Creates a stub variable-length datatype.
//--------------------------------------------------------------------------
VarLenType::VarLenType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: VarLenType overloaded constructor
-///\brief Creates an VarLenType object using an existing id.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: VarLenType overloaded constructor
+///\brief Creates an VarLenType object using an existing id.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {}
//--------------------------------------------------------------------------
-// Function: VarLenType copy constructor
-///\brief Copy constructor: makes a copy of the original VarLenType object.
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: VarLenType copy constructor
+///\brief Copy constructor: makes a copy of the original VarLenType object.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
VarLenType::VarLenType(const VarLenType& original) : DataType(original) {}
//--------------------------------------------------------------------------
-// Function: VarLenType overloaded constructor
-///\brief Creates a new variable-length datatype based on the specified
-/// \a base_type.
-///\param base_type - IN: Pointer to existing datatype
-///\exception H5::DataTypeIException
+// Function: VarLenType overloaded constructor
+///\brief Creates a new variable-length datatype based on the specified
+/// \a base_type.
+///\param base_type - IN: Pointer to existing datatype
+///\exception H5::DataTypeIException
// Description
-// DataType passed by pointer to avoid clashing with copy
-// constructor.
-// Programmer Binh-Minh Ribler - May, 2004
+// DataType passed by pointer to avoid clashing with copy
+// constructor.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
VarLenType::VarLenType(const DataType* base_type) : DataType()
{
- id = H5Tvlen_create(base_type->getId());
- if (id < 0)
- {
- throw DataTypeIException("VarLenType constructor",
+ id = H5Tvlen_create(base_type->getId());
+ if (id < 0)
+ {
+ throw DataTypeIException("VarLenType constructor",
"H5Tvlen_create returns negative value");
- }
+ }
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Variable length type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openVarLenType(const char*) to
-// improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openVarLenType(const char*) to
+// improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
VarLenType::VarLenType(const H5Location& loc, const char *dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name);
+ id = p_opentype(loc, dtype_name);
}
//--------------------------------------------------------------------------
-// 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 dtype_name - IN: Variable length type name
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - Dec 2016
+// 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 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
-// existing function CommonFG::openVarLenType(const H5std_string&)
-// to improve usability.
-// -BMR, Dec 2016
+// In 1.10.1, this constructor was introduced and will replace the
+// existing function CommonFG::openVarLenType(const H5std_string&)
+// to improve usability.
+// -BMR, Dec 2016
//--------------------------------------------------------------------------
VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
{
- id = p_opentype(loc, dtype_name.c_str());
+ id = p_opentype(loc, dtype_name.c_str());
}
//--------------------------------------------------------------------------
-// Function: VarLenType destructor
-///\brief Properly terminates access to this datatype.
-// Programmer Binh-Minh Ribler - May, 2004
+// Function: VarLenType destructor
+///\brief Properly terminates access to this datatype.
+// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
VarLenType::~VarLenType() {}
diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h
index af4f7b7..a93f44d 100644
--- a/c++/src/H5VarLenType.h
+++ b/c++/src/H5VarLenType.h
@@ -27,28 +27,28 @@ namespace H5 {
*/
class H5_DLLCPP VarLenType : public DataType {
public:
- // Constructor that creates a variable-length datatype based
- // on the specified base type.
- VarLenType(const DataType* base_type);
+ // Constructor that creates a variable-length datatype based
+ // on the specified base type.
+ VarLenType(const DataType* base_type);
- ///\brief Returns this class name.
- virtual H5std_string fromClass () const { return("VarLenType"); }
+ ///\brief Returns this class name.
+ virtual H5std_string fromClass () const { return("VarLenType"); }
- // Copy constructor: makes copy of the original object.
- VarLenType( const VarLenType& original );
+ // Copy constructor: makes copy of the original object.
+ VarLenType(const VarLenType& original);
- // Constructor that takes an existing id
- VarLenType( const hid_t existing_id );
+ // Constructor that takes an existing id
+ VarLenType(const hid_t existing_id);
- // Constructors that open a variable-length datatype, given a location.
- VarLenType(const H5Location& loc, const char* name);
- VarLenType(const H5Location& loc, const H5std_string& name);
+ // Constructors that open a variable-length datatype, given a location.
+ VarLenType(const H5Location& loc, const char* name);
+ VarLenType(const H5Location& loc, const H5std_string& name);
- // Noop destructor
- virtual ~VarLenType();
+ // Noop destructor
+ virtual ~VarLenType();
- // Default constructor
- VarLenType();
+ // Default constructor
+ VarLenType();
};
}
#endif // __H5VarLenType_H