Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getter for attributesAddress #56

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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