Skip to content

Commit

Permalink
Modern C++ dtor declarations (HDFGroup#1830)
Browse files Browse the repository at this point in the history
* C++ dtor modernization

- Replaced a bunch of empty dtors with `= default`
- Removed deprecated `throw()`. In C++11, dtors are `noexcept` by default.

*
  • Loading branch information
seanm authored and lrknox committed Feb 14, 2024
1 parent f888fd5 commit 6331dda
Show file tree
Hide file tree
Showing 50 changed files with 38 additions and 335 deletions.
8 changes: 0 additions & 8 deletions c++/src/H5AbstractDs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,4 @@ AbstractDs::getVarLenType() const
}
}

//--------------------------------------------------------------------------
// Function: AbstractDs destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
AbstractDs::~AbstractDs()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5AbstractDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class H5_DLLCPP AbstractDs {
virtual H5std_string fromClass() const = 0;

// Destructor
virtual ~AbstractDs();
virtual ~AbstractDs() = default;

protected:
// Default constructor
Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5ArrayType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,4 @@ ArrayType::getArrayDims(hsize_t *dims) const
return (ndims);
}

//--------------------------------------------------------------------------
// Function: ArrayType destructor
///\brief Properly terminates access to this array datatype.
//--------------------------------------------------------------------------
ArrayType::~ArrayType()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5ArrayType.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class H5_DLLCPP ArrayType : public DataType {
ArrayType(const hid_t existing_id);

// Noop destructor
virtual ~ArrayType() override;
virtual ~ArrayType() override = default;

// Default constructor
ArrayType();
Expand Down
10 changes: 0 additions & 10 deletions c++/src/H5AtomType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,4 @@ AtomType::setPad(H5T_pad_t lsb, H5T_pad_t msb) const
}
}

#ifndef DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
// Function: AtomType destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
AtomType::~AtomType()
{
}
#endif // DOXYGEN_SHOULD_SKIP_THIS

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5AtomType.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class H5_DLLCPP AtomType : public DataType {
AtomType(const AtomType &original);

// Noop destructor
virtual ~AtomType() override;
virtual ~AtomType() override = default;
#endif // DOXYGEN_SHOULD_SKIP_THIS

protected:
Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5CommonFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,6 @@ CommonFG::CommonFG()
{
}

//--------------------------------------------------------------------------
// Function: CommonFG destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
CommonFG::~CommonFG()
{
}

//--------------------------------------------------------------------------
// Function: f_DataType_setId - friend
// Purpose: This function is friend to class H5::DataType so that it
Expand Down
2 changes: 1 addition & 1 deletion c++/src/H5CommonFG.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class H5_DLLCPP CommonFG {
CommonFG();

// Noop destructor.
virtual ~CommonFG();
virtual ~CommonFG() = default;

protected:
virtual void p_setId(const hid_t new_id) = 0;
Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5CompType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,4 @@ CompType::setSize(size_t size) const
}
}

//--------------------------------------------------------------------------
// Function: CompType destructor
///\brief Properly terminates access to this compound datatype.
//--------------------------------------------------------------------------
CompType::~CompType()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5CompType.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class H5_DLLCPP CompType : public DataType {
}

// Noop destructor.
virtual ~CompType() override;
virtual ~CompType() override = default;

private:
// Contains common code that is used by the member functions
Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5DaccProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,4 @@ DSetAccPropList::getChunkCache(size_t &rdcc_nslots, size_t &rdcc_nbytes, double
}
}

//--------------------------------------------------------------------------
// Function: DSetAccPropList destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DSetAccPropList::~DSetAccPropList()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5DaccProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class H5_DLLCPP DSetAccPropList : public LinkAccPropList {
DSetAccPropList(const hid_t plist_id);

// Noop destructor.
virtual ~DSetAccPropList() override;
virtual ~DSetAccPropList() override = default;

#ifndef DOXYGEN_SHOULD_SKIP_THIS

Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5DcreatProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,12 +754,4 @@ DSetCreatPropList::setVirtual(const DataSpace &vspace, const H5std_string src_fn
setVirtual(vspace, src_fname.c_str(), src_dsname.c_str(), sspace);
}

//--------------------------------------------------------------------------
// Function: DSetCreatPropList destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DSetCreatPropList::~DSetCreatPropList()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5DcreatProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList {
DSetCreatPropList(const hid_t plist_id);

// Noop destructor.
virtual ~DSetCreatPropList() override;
virtual ~DSetCreatPropList() override = default;

#ifndef DOXYGEN_SHOULD_SKIP_THIS

Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5DxferProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,4 @@ DSetMemXferPropList::getEDCCheck() const
return (check);
}

//--------------------------------------------------------------------------
// Function: DSetMemXferPropList destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DSetMemXferPropList::~DSetMemXferPropList()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5DxferProp.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
DSetMemXferPropList(const hid_t plist_id);

// Noop destructor
virtual ~DSetMemXferPropList() override;
virtual ~DSetMemXferPropList() override = default;

#ifndef DOXYGEN_SHOULD_SKIP_THIS

Expand Down
8 changes: 0 additions & 8 deletions c++/src/H5EnumType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,4 @@ EnumType::getMemberValue(unsigned memb_no, void *value) const
}
}

//--------------------------------------------------------------------------
// Function: EnumType destructor
///\brief Properly terminates access to this enum datatype.
//--------------------------------------------------------------------------
EnumType::~EnumType()
{
}

} // namespace H5
2 changes: 1 addition & 1 deletion c++/src/H5EnumType.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class H5_DLLCPP EnumType : public DataType {
// Copy constructor: same as the original EnumType.
EnumType(const EnumType &original);

virtual ~EnumType() override;
virtual ~EnumType() override = default;

}; // end of EnumType
} // namespace H5
Expand Down
93 changes: 0 additions & 93 deletions c++/src/H5Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,6 @@ Exception::printErrorStack(FILE *stream, hid_t err_stack)
// Exception::printErrorStack(stream, H5E_DEFAULT);
//}

//--------------------------------------------------------------------------
// Function: Exception destructor
///\brief Noop destructor
//--------------------------------------------------------------------------
Exception::~Exception() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: FileIException
//--------------------------------------------------------------------------
Expand All @@ -359,13 +351,6 @@ FileIException::FileIException(const H5std_string &func, const H5std_string &mes
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: FileIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
FileIException::~FileIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: GroupIException
Expand All @@ -388,14 +373,6 @@ GroupIException::GroupIException(const H5std_string &func, const H5std_string &m
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: GroupIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
GroupIException::~GroupIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: DataSpaceIException
//--------------------------------------------------------------------------
Expand All @@ -417,13 +394,6 @@ DataSpaceIException::DataSpaceIException(const H5std_string &func, const H5std_s
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: DataSpaceIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DataSpaceIException::~DataSpaceIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: DataTypeIException
Expand All @@ -446,13 +416,6 @@ DataTypeIException::DataTypeIException(const H5std_string &func, const H5std_str
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: DataTypeIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DataTypeIException::~DataTypeIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: ObjHeaderIException
Expand All @@ -475,13 +438,6 @@ ObjHeaderIException::ObjHeaderIException(const H5std_string &func, const H5std_s
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: ObjHeaderIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
ObjHeaderIException::~ObjHeaderIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: PropListIException
Expand All @@ -504,13 +460,6 @@ PropListIException::PropListIException(const H5std_string &func, const H5std_str
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: PropListIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
PropListIException::~PropListIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: DataSetIException
Expand All @@ -533,13 +482,6 @@ DataSetIException::DataSetIException(const H5std_string &func, const H5std_strin
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: DataSetIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
DataSetIException::~DataSetIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: AttributeIException
Expand All @@ -562,13 +504,6 @@ AttributeIException::AttributeIException(const H5std_string &func, const H5std_s
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: AttributeIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
AttributeIException::~AttributeIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: ReferenceException
Expand All @@ -591,13 +526,6 @@ ReferenceException::ReferenceException(const H5std_string &func, const H5std_str
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: ReferenceException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
ReferenceException::~ReferenceException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: LibraryIException
Expand All @@ -620,13 +548,6 @@ LibraryIException::LibraryIException(const H5std_string &func, const H5std_strin
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: LibraryIException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
LibraryIException::~LibraryIException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: LocationException
Expand All @@ -649,13 +570,6 @@ LocationException::LocationException(const H5std_string &func, const H5std_strin
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: LocationException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
LocationException::~LocationException() throw()
{
}

//--------------------------------------------------------------------------
// Subclass: IdComponentException
Expand All @@ -678,12 +592,5 @@ IdComponentException::IdComponentException(const H5std_string &func, const H5std
: Exception(func, message)
{
}
//--------------------------------------------------------------------------
// Function: IdComponentException destructor
///\brief Noop destructor.
//--------------------------------------------------------------------------
IdComponentException::~IdComponentException() throw()
{
}

} // namespace H5
Loading

0 comments on commit 6331dda

Please sign in to comment.