Skip to content

Commit

Permalink
Merge pull request #56 from TGSAI/47_variable_warning
Browse files Browse the repository at this point in the history
Added getter for attributesAddress
  • Loading branch information
blasscoc authored Jul 31, 2024
2 parents 7aa0f1f + 50a0ad4 commit 7b5ea31
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mdio/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ class Variable {
metadata(other.getReducedMetadata()),
store(other.get_store()),
attributes(other.attributes),
attributesAddress(attributesAddress) {}
attributesAddress(other.get_attributes_address()) {}

friend std::ostream& operator<<(std::ostream& os, const Variable& obj) {
os << obj.variableName << "\t" << obj.dimensions() << "\n";
Expand Down Expand Up @@ -1101,6 +1101,16 @@ class Variable {
// The data that should remain static, but MAY need to be updated.
std::shared_ptr<std::shared_ptr<UserAttributes>> attributes;

/**
* @brief Gets the original address of the User Attributes.
* This method should NEVER be called by the user.
* It allows for the copy constructor without re-serializing metadata.
* @return The original address of the User Attributes.
*/
const std::uintptr_t get_attributes_address() const {
return attributesAddress;
}

private:
/**
* This method should NEVER be called by the user.
Expand Down

0 comments on commit 7b5ea31

Please sign in to comment.