-
Notifications
You must be signed in to change notification settings - Fork 544
CXX-3232 add bsoncxx v1 declarations #1412
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
Conversation
b52a537
to
07f460e
Compare
07f460e
to
98521ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bsoncxx ABI v1 interfaces look well researched, and I really like the efforts towards better defining expected exceptions / minimizing preconditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions applied. Open questions following first round of review include:
- Should compile-time constants be defined as enum constants (not exported in the ABI) instead of
static constexpr
variables (exported in the ABI due to pre-C++17 compatibility requirements)? ShouldFeedback: no.v1::document::value::view()
return an "empty doc" view instead of an invalid view without otherwise changing its allocation behavior (_data.get() == nullptr
)?ShouldFeedback: no.v1::document::value
continue to support implicit assignment from av1::document::view
(currently requiresdoc = value{view};
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sorry I thought I posted comments as a review before). Latest changes LGTM with a request to restore a view constructor accepting a length (for safer migration). I support removing __cdecl
.
This reverts commit 9888b1f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the only remaining comments are relatively small things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vector-of-bool re-requesting review to confirm the applied changes (moving error codes and categories into class members) and response to latest feedback are in line with expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with one last (lengthy and rambling) remark about datetime encoding.
Resolves CXX-3232. Followup to #1318, #1401, and #1402.
This is 2 out of an estimated 7 major PRs which in total are expected to resolve CXX-2745 and CXX-3320.
This PR introduces the very first set of v1 ABI exported symbols. 🎉
... only because MSVC complains otherwise. The rest will come as planned in CXX-3233 (impls).
Due to the volume of changes relative to the equivalent v_noabi interfaces, the bulk of relative changelog (v_noabi -> v1) and rationale for design decisions are documented inline as GitHub comments (coincidentally, exactly 100 comments in total).
In summary, notable changes include:
v1::error
v1::<class>::errc
v1::error
v1::<class>::errc
with corresponding error categoryv1::<class>::error_category
.source_errc
andtype_errc
are provided as the primary user-facing error code query mechanism when component-specific error codes are not necessary.v1::types::b_*
value
).v1::types::view
value
when applicable.v1::types::value
b_*
is always favored) so eitherb_*
orview
(cheap) is always preferred tovalue
(expensive) when applicable.v1::types::id
constructors are removed in favor ofb_*
and converting constructors.v1::element::view
bool
-based approach to "missing field" diagnostics (CXX-2120).Equality comparison is defined as "same field in same BSON binary data". Relational comparison is also possible but deferred for now.Reverted.v1::document::view
v1::array::view
v1::document::view
.v1::document::view
(CXX-2118).v1::document::value
an "invalid"a default-initializedv1::document::view
with no allocation.deleter_type
is now astd::function<T>
instead of a function pointer.to_bson
andfrom_bson
are now properly constrained.v1::array::value
v1::document::value
.v1::document::view
(CXX-2118).