summaryrefslogtreecommitdiffstats
path: root/c++/src/H5ArrayType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/src/H5ArrayType.cpp')
-rw-r--r--c++/src/H5ArrayType.cpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index 0dab8ef..877be13 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -50,7 +50,7 @@ ArrayType::ArrayType(const hid_t existing_id) : DataType(existing_id) {}
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const ArrayType& original) : DataType(original) {}
+ArrayType::ArrayType(const ArrayType &original) : DataType(original) {}
//--------------------------------------------------------------------------
// Function: ArrayType overloaded constructor
@@ -62,7 +62,7 @@ ArrayType::ArrayType(const ArrayType& original) : DataType(original) {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
+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);
@@ -87,7 +87,7 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims)
// improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType()
+ArrayType::ArrayType(const H5Location &loc, const char *dtype_name) : DataType()
{
id = p_opentype(loc, dtype_name);
}
@@ -106,7 +106,7 @@ ArrayType::ArrayType(const H5Location& loc, const char *dtype_name) : DataType()
// to improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
-ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : DataType()
+ArrayType::ArrayType(const H5Location &loc, const H5std_string &dtype_name) : DataType()
{
id = p_opentype(loc, dtype_name.c_str());
}
@@ -122,21 +122,21 @@ ArrayType::ArrayType(const H5Location& loc, const H5std_string& dtype_name) : Da
// each data member from the rhs object. (Issue HDFFV-9562)
// Programmer Binh-Minh Ribler - Mar 2016
//--------------------------------------------------------------------------
-ArrayType& ArrayType::operator=(const ArrayType& rhs)
+ArrayType &
+ArrayType::operator=(const ArrayType &rhs)
{
- if (this != &rhs)
- {
+ if (this != &rhs) {
// handling references to this id
try {
setId(rhs.id);
// 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) {
+ catch (Exception &close_error) {
throw DataTypeIException(inMemFunc("operator="), close_error.getDetailMsg());
}
}
- return(*this);
+ return (*this);
}
//--------------------------------------------------------------------------
@@ -147,7 +147,8 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs)
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Aug 2017
//--------------------------------------------------------------------------
-DataType* ArrayType::decode() const
+DataType *
+ArrayType::decode() const
{
hid_t encoded_arrtype_id = H5I_INVALID_HID;
try {
@@ -158,7 +159,7 @@ DataType* ArrayType::decode() const
}
ArrayType *encoded_arrtype = new ArrayType;
encoded_arrtype->p_setId(encoded_arrtype_id);
- return(encoded_arrtype);
+ return (encoded_arrtype);
}
//--------------------------------------------------------------------------
@@ -168,16 +169,16 @@ DataType* ArrayType::decode() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-int ArrayType::getArrayNDims() const
+int
+ArrayType::getArrayNDims() const
{
// Get the rank of the array type specified by id from the C API
int ndims = H5Tget_array_ndims(id);
- if (ndims < 0)
- {
+ if (ndims < 0) {
throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed");
}
- return(ndims);
+ return (ndims);
}
//--------------------------------------------------------------------------
@@ -188,7 +189,8 @@ int ArrayType::getArrayNDims() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
-int ArrayType::getArrayDims(hsize_t* dims) const
+int
+ArrayType::getArrayDims(hsize_t *dims) const
{
// Get the dimensions
int ndims = H5Tget_array_dims2(id, dims);
@@ -196,7 +198,7 @@ int ArrayType::getArrayDims(hsize_t* dims) const
throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed");
// Return the number of dimensions
- return(ndims);
+ return (ndims);
}
//--------------------------------------------------------------------------
@@ -206,4 +208,4 @@ int ArrayType::getArrayDims(hsize_t* dims) const
//--------------------------------------------------------------------------
ArrayType::~ArrayType() {}
-} // end namespace
+} // namespace H5