Skip to content

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
@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