diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2018-07-17 17:21:07 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-07-26 22:20:28 (GMT) |
commit | f9d2edc7ed14bb4fb6d04dd414b7e481721e9f19 (patch) | |
tree | 3228b71d40c995c62bd1ddba3178a0e9eef0b1f2 /c++/src | |
parent | 622806b89dcc305e1744985763e6293d85497ffa (diff) | |
download | hdf5-f9d2edc7ed14bb4fb6d04dd414b7e481721e9f19.zip hdf5-f9d2edc7ed14bb4fb6d04dd414b7e481721e9f19.tar.gz hdf5-f9d2edc7ed14bb4fb6d04dd414b7e481721e9f19.tar.bz2 |
Fixed HDFFV-10472
Description:
Added operator!= to DataType
bool operator!=(const DataType& compared_type)
Platforms tested:
Linux/64 (jelly)
Linux/32 (jam)
Darwin (osx1010test)
Diffstat (limited to 'c++/src')
-rw-r--r-- | c++/src/H5DataType.cpp | 14 | ||||
-rw-r--r-- | c++/src/H5DataType.h | 3 |
2 files changed, 17 insertions, 0 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index e460871..28933dd 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -396,6 +396,20 @@ bool DataType::operator==(const DataType& compared_type) const } //-------------------------------------------------------------------------- +// Function: DataType::operator!= +///\brief Compares this DataType against the given one to determines +/// whether the two objects refer to different actual datatypes. +///\param compared_type - IN: Reference to the datatype to compare +///\return true if the datatypes are not equal, and false, otherwise. +///\exception H5::DataTypeIException +// July, 2018 +//-------------------------------------------------------------------------- +bool DataType::operator!=(const DataType& compared_type) const +{ + return !operator==(compared_type); +} + +//-------------------------------------------------------------------------- // Function: DataType::p_commit (private) //\brief Commits a transient datatype to a file, creating a new // named datatype diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 52fd4de..e4d9e4b 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -90,6 +90,9 @@ class H5_DLLCPP DataType : public H5Object { // Determines whether two datatypes are the same. bool operator==(const DataType& compared_type) const; + // Determines whether two datatypes are not the same. + bool operator!=(const DataType& compared_type) const; + // Locks a datatype. void lock() const; |