diff options
-rw-r--r-- | c++/src/H5Attribute.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5Attribute.h | 3 | ||||
-rw-r--r-- | c++/src/H5Group.cpp | 12 | ||||
-rw-r--r-- | c++/src/H5Group.h | 3 |
4 files changed, 30 insertions, 0 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index e838b4f..e629a80 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -605,4 +605,16 @@ Attribute::~Attribute() } } +//-------------------------------------------------------------------------- +// Function: Copy assignment operator +Attribute & +Attribute::operator=(const Attribute &original) +{ + if (&original != this) { + setId(original.id); + } + + return *this; +} + } // namespace H5 diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 6851e1a..9701102 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -78,6 +78,9 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // Destructor: properly terminates access to this attribute. virtual ~Attribute() override; + // Copy assignment operator. + Attribute &operator=(const Attribute &original); + #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: // Sets the attribute id. diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 35e9d26..248e71f 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -274,4 +274,16 @@ Group::~Group() } } +//-------------------------------------------------------------------------- +// Function: Copy assignment operator +Group & +Group::operator=(const Group &original) +{ + if (&original != this) { + setId(original.id); + } + + return *this; +} + } // namespace H5 diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index cb9b092..9c89dd1 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -67,6 +67,9 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Destructor virtual ~Group() override; + // Copy assignment operator. + Group &operator=(const Group &original); + // Creates a copy of an existing group using its id. Group(const hid_t group_id); |