Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2467

Provide a way to synthesize a bson_iter_t from a known offset

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.13.0
    • libbson

    Description

      The C++ driver has a need to synthesize a bson_iter_t at a known offset within a document.

      Currently, it resorts to messing around with the internals of bson_iter_t to accomplish that:

      It would be much better for the C++ driver if the C driver offered bson_iter_init_from_data_and_offset, which worked like bson_iter_init_from_data, but also took an offset into the object.

      Without this, the C++ driver can only correct this misuse of the C driver by either:

      • Exposing the bson_iter_t as a member of the document,array::element class, which would break the encapsulation of the C driver, and make us ABI dependent.
      • Putting a type erased bson_iter_t on the heap for every document,array::view class, which would defeat performance of view types.

      Neither of the above seems palatable.

      Attachments

        Issue Links

          Activity

            People

              kevin.albertson@mongodb.com Kevin Albertson
              andrew.morrow@mongodb.com Andrew Morrow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: