Skip to content

CXX-3102 Remove use of BSONCXX_ENUM in public headers #1207

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

Merged
merged 7 commits into from
Sep 16, 2024

Conversation

eramongodb
Copy link
Contributor

Resolves CXX-3102.

The X macro headers under bsoncxx/v_noabi/enum/ have long cause trouble with Doxygen documentation.

These troubles have worsened following #1182, especially in enumerations:

image

image

These are in addition to numerous functions and enumerators which are not properly documented, e.g. k_need_element_type_k_* and k_cannot_append_* error codes:

image

image

as well as ctor overloads for bsoncxx::v_noabi::types::bson_value::value and bsoncxx::v_noabi::types::bson_value::view.

This PR proposes replacing all use of BSONCXX_ENUM (specifically the X macro headers themselves) in favor of fully expanding and properly documenting each BSON type and binary subtype. The X macro headers may still be used in internal code which does not require API documentation for convenience.

The examples shown above are fixed to looks as follows:

image

image

image

image

@eramongodb eramongodb self-assigned this Sep 12, 2024
@eramongodb
Copy link
Contributor Author

Aside: ENUM_VALUES_PER_LINE = 1 is responsible for the strictly columnar list of enumerators. This change can be reverted or tweaked if it is deemed too space-wasteful, e.g. with the default value of 4:

image

With the maximum value of 20:

image

Or disabled entirely (note: enumerator values are no longer displayed at all; unsure where the SHOW_ENUM_VALUES setting has gone?):

image

@eramongodb
Copy link
Contributor Author

Opted to use ENUM_VALUES_PER_LINE = 0 in favor of \showenumvalues to generate enumerator values in description tables only for enumerations that most benefit from it.

e.g. applied to BSON types and subtypes:

image

but not applied to error codes:

image

@eramongodb eramongodb merged commit ab15de1 into mongodb:master Sep 16, 2024
1 check was pending
@eramongodb eramongodb deleted the cxx-3102 branch September 16, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants