Add factory helpers on TagValueView for common shallow types in SBE

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add static factory helpers on TagValueView for constructing common shallow values without having to spell out the tag/value pair explicitly.

      Examples:

      TagValueView::nothing()           // {TypeTags::Nothing, 0}
      TagValueView::numberInt32(int32_t)
      TagValueView::numberInt64(int64_t)
      TagValueView::boolean(bool)
      TagValueView::null()              // {TypeTags::Null, 0}
      

      Motivation: call sites like:

      accumulatorState.reset(value::TagValueView{value::TypeTags::Nothing, 0});
      

      are verbose and error-prone (easy to pass the wrong zero literal). Named helpers make intent clearer and eliminate the raw tag/value pair at the call site.

      Only shallow (non-heap-allocated) types should get helpers here, since TagValueView is non-owning.

      Part of the SPM-4577 RAII refactor epic.

            Assignee:
            Evan Bergeron
            Reporter:
            Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: