-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-2762 Ensure ABI namespace is included in API documentation #1039
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
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.
LGTM with removal of unused macros.
Resolved merge conflicts. Also added some missing generated macros to the Doxyfile to address parsing issues for certain entities (i.e. misinterpreting typedefs as variable declarations). |
To further account for changes in #1028, documentation for the Additionally, exclusion filters for |
Resolves CXX-2762. Verified by this patch.
Description
Despite the diffs to source code, this PR is primarily focused on changes to generated documentation, not the source code itself. Most of the diff is due to replacing use of the inline namespace macros with
inline namespace v_noabi
. This is to allow Doxygen to understand the declaration scope of entities within the inline namespace, as it is incapable of reading into the expansion of the inline namespace macro, and Doxygen does not provide a means to manually open/close a namespace for documentation purposes. Explicitly substituting the macros appears to be the only method for ensuring namespace-awareness in documentation.To elaborate, using the
mongocxx::instance
class as an example, the current API documentation generates the class list as follows:And the class reference page has no awareness of its actual declaration within the
v_noabi
inline namespace:This is an issue if we want to add documentation for upcoming
v1
namespace entities in a manner that distinguishesv1
entities fromv_noabi
entities, in particular if we want to support a mix ofvN
entities in the root namespace. The result of the changes in this PR changes the class index to:And the class reference to:
The
instance
class appears twice in the class index to reflect inline namespace behavior (mongocxx::instance
andmongocxx::v_noabi::instance
). The duplication of entities in the lists under the root andv_noabi
namespace may seem redundant, but this is correct behavior: the root namespace declaration may redirect to anyvN
namespace declaration instead (e.g.mongocxx::instance -> mongocxx::v1::instance
) depending on the state of compatibility with prior ABI versions and/or the unstable ABI (i.e. eventualv_noabi
->v1
source-but-not-binary-breaking changes). The changes in this PR enables the generated API documentation to make this distinction rather than tying the root namespace declaration to the entity in the currently inlined namespace (there is no actualmongocxx::instance
; it's actuallymongocxx::v_noabi::instance
).Ensuring proper inclusion of the ABI namespace in Doxygen required a definitive Doxygen comment for the enclosing namespaces. This is currently done in ad-hoc locations (json.hpp for the
bsoncxx
namespace, client.hpp for themongocxx
namespace). This PR moves the namespace documentation comments into the prelude headers for each respective library for uniformity.Drive-By Improvements
chunks_and_bytes_offset
,rewrap_many_datakey
).@relates
in friend declarations.mongocxx::gridfs::bucket
: used@copydoc
instead to allow appending parameter documentation.@code
/@endcode
commands to wrap literal blocks (<>
is incorrectly parsed as XML).