v1: transaction (CXX-3237, CXX-3238) #1535
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves CXX-3237 and CXX-3238 for the
v1::transactioncomponent.Unlike recently-reviewed PRs, the
v_noabi::options::transactionclass does not containT const&getters, thus it can be fully reimplemented in terms ofv1::transaction. However, unlike previously-reviewed PRs for classes which were reimplemented in terms of v1, this is the first class which may throw an "invalid object" exception for the assign-or-destroy-only state. In order to preserve v_noabi API backward compatibility while respecting the v1 API's own assign-or-destroy-only invariants, thecheck_moved_from()helper implements the null check by reusing the (unchecked) raw pointer returned by the v1as_mongoc()internal helper function. This pattern will also used by upcoming components/PRs for other classes which may throw an "invalid object" exception for backward compatibility (that is, classes which have a potentially-throwing_get_impl()helper).