-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3077 BSON Binary Vector accessor, sub_binary builder #1356
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
.evergreen/config_generator/components/funcs/install_c_driver.py
Outdated
Show resolved
Hide resolved
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.
Thanks for all the great suggestions.
.evergreen/config_generator/components/funcs/install_c_driver.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Ezra Chung <[email protected]>
This reverts commit 3422b2e.
….hpp Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
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.
Minor suggestions remaining; otherwise, LGTM!
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/formats-fwd.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/accessor.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/accessor.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/elements.hpp
Outdated
Show resolved
Hide resolved
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/vector/elements.hpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
Co-authored-by: Ezra Chung <[email protected]>
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.
Apologies for delayed review.
This is a basic implementation of CXX-3077, adding
bsoncxx
support for the BSON Binary Vector specification.The main contribution in this PR is to add the
bsoncxx::vector
namespace, and especially thebsoncxx::vector::accessor
template. A vector accessor can wrap any validatedb_binary
value as read-only, or a mutable accessor can be obtained during append.General binary items can now be created and edited in-place during an append, using a new
sub_binary
basic builder.Bumps the Libmongoc version to an unreleased pre-2.0.0 snapshot, to get access to new Libbson features:
bson_append_binary_uninit
,bson_vector_*_const_view_init
, andbson_vector_*_binary_data_length
. Validation for existing and newly allocated vectors has been delegated to Libbson, to reuse as much of its testing as possible. The actual vector accessor template in bsoncxx has been implemented in a way similar to Libbson's vector views, but without a direct dependency.This implementation is currently less comprehensive than the Libbson implementation for BSON Binary Vector. No support is included for conversion between BSON arrays and BSON vectors, and there are no functions for bulk element conversion. Instead, a standard iterator interface allows access to individual elements or element ranges.
The spec includes JSON tests that are similar to bson_corpus. As with bsoncxx's approach to bson_corpus, this PR chooses to delegate those tests to the underlying Libbson implementation.