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

Remove class-by-value support in DataStorm #3251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bernardnormier
Copy link
Member

This PR removes support for using Slice classes "by value" as DataStorm values.

You can still use Slice classes as reference with DataStorm; if you're currently using Slice classes "by value", you can switch to "by reference" and maintain on-the-wire interop with earlier DataStorm/Ice releases.

@@ -240,58 +240,6 @@ namespace DataStorm
static T decode(const Ice::CommunicatorPtr& communicator, const Ice::ByteSeq& value) noexcept;
};

/**
* The Cloner template provides a method to clone user types.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed Cloner as it was used/tested only for "class by value". Its documentation (in the IceStorm manual) is also incomplete and rather confusing/incorrect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the documentation, the cloner template is also used by partial updates for cloning types. I believe it is required for class-by-reference scenarios to ensure ice_clone is called instead of using the shared_ptr copy constructor.

It might be worth updating DataStorm/partial to test class-by-reference behavior, as the current tests only cover structs. The original implementation tested a class-by-value, which is a removed by this PR.

From my understanding, without this change, the partial update will modify the previous value directly rather than computing a new value from previous.

};

/**
* Encoder template specialization to encode Ice::Value instances.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only used for class-by-value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants