From 680e02ccd0b02763d28cab6380ad6d38730329e8 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:11 -0500 Subject: [PATCH 01/17] doxygen: strip include directory from file paths --- Doxyfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 6637949b3c..a53cb604b9 100644 --- a/Doxyfile +++ b/Doxyfile @@ -160,7 +160,8 @@ FULL_PATH_NAMES = YES # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = src/bsoncxx/include \ + src/mongocxx/include # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which From 6c555355a9dfc2c999a9acdd0813eb8260456343 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:13 -0500 Subject: [PATCH 02/17] clang-format: avoid breaking long single-line Doxygen commands --- .clang-format | 1 + .../v_noabi/bsoncxx/document/element.hpp | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.clang-format b/.clang-format index 281a4725a5..41a2d0fb3c 100644 --- a/.clang-format +++ b/.clang-format @@ -5,6 +5,7 @@ BasedOnStyle: Google BinPackArguments: false BinPackParameters: false ColumnLimit: 100 +CommentPragmas: '^\s*@(addtogroup|copydoc|defgroup|fn|ref)' Cpp11BracedListStyle: true DerivePointerAlignment: false IncludeBlocks: Regroup diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp index 588518081a..b884cd92ba 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp @@ -386,6 +386,8 @@ class element { stdx::optional _key; }; +/// +/// @relates bsoncxx::v_noabi::document::element /// /// @{ /// @@ -393,25 +395,13 @@ class element { /// /// Returns true if this element contains a bson_value that matches. /// -/// @relates element -/// + BSONCXX_API bool BSONCXX_CALL operator==(const element& elem, const types::bson_value::view& v); BSONCXX_API bool BSONCXX_CALL operator==(const types::bson_value::view& v, const element& elem); -/// -/// @} -/// -/// -/// @{ -/// -/// Convenience methods to compare for equality against a bson_value. -/// -/// Returns false if this element contains a bson_value that matches. -/// -/// @relates element -/// BSONCXX_API bool BSONCXX_CALL operator!=(const element& elem, const types::bson_value::view& v); BSONCXX_API bool BSONCXX_CALL operator!=(const types::bson_value::view& v, const element& elem); + /// /// @} /// From 3e9eb606d207a75ded868c3a8f52d721207bb546 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:13 -0500 Subject: [PATCH 03/17] doxygen: expand *_INLINE as inline --- Doxyfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doxyfile b/Doxyfile index a53cb604b9..01ac794e90 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2213,11 +2213,11 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = BSONCXX_API= \ BSONCXX_CALL= \ BSONCXX_DEPRECATED \ - BSONCXX_INLINE= \ + BSONCXX_INLINE=inline \ MONGOCXX_API= \ MONGOCXX_CALL= \ - MONGOCXX_DEPRECATED \ - MONGOCXX_INLINE= + MONGOCXX_DEPRECATED= \ + MONGOCXX_INLINE=inline # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The From 26e34520788c5eb8c03d633b070fe8eba296c7b3 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:13 -0500 Subject: [PATCH 04/17] docs: add missing @internal command --- src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp index 045c8c80a9..b56309b444 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/util.hpp @@ -7,6 +7,7 @@ #define BSONCXX_STRINGIFY_IMPL(...) #__VA_ARGS__ /** + * @internal * @brief Token-paste two macro arguments, after macro expansion */ #define BSONCXX_CONCAT(A, ...) BSONCXX_CONCAT_IMPL(A, __VA_ARGS__) From 490f149677301675c4737d6afb48b371ee6a26df Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:14 -0500 Subject: [PATCH 05/17] docs: fix broken @copydoc in bucket.hpp --- .../include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp index baeeea152b..22452ca3d0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp @@ -511,8 +511,7 @@ class bucket { std::ostream* destination); /// - /// @copydoc download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* - /// destination) + /// @copydoc download_to_stream(bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) /// /// @param start The byte offset to the beginning of content to download. /// @param end The byte offset to the end of content to download. @@ -549,14 +548,12 @@ class bucket { bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination); - // clang-format off /// /// @copydoc download_to_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination) /// /// @param start The byte offset to the beginning of content to download. /// @param end The byte offset to the end of content to download. /// - // clang-format on void download_to_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id, std::ostream* destination, From e4912d61be8514245ff33c2a000d34178f529e53 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:14 -0500 Subject: [PATCH 06/17] docs: fix URLs to Working with BSON doc page --- .../bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp | 10 +++++----- .../v_noabi/bsoncxx/builder/stream/document.hpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp index 501db4f7bf..b2dcffa8fa 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array.hpp @@ -32,12 +32,12 @@ namespace builder { namespace stream { /// -/// A streaming interface for constructing -/// a BSON array. +/// A streaming interface for constructing a BSON array. /// -/// @note Use of the stream builder is discouraged. See -/// https://www.mongodb.com/docs/languages/cpp/drivers/current/working-with-bson/#basic-builder for -/// more details. +/// @warning Use of the stream builder is discouraged. See +/// [Working with +/// BSON](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/working-with-bson/#basic-builder) +/// for more details. /// class array : public array_context<> { public: diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp index 2b250a7cb2..d55f4daa5f 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/document.hpp @@ -30,12 +30,12 @@ namespace builder { namespace stream { /// -/// A streaming interface for constructing -/// a BSON document. +/// A streaming interface for constructing a BSON document. /// -/// @note Use of the stream builder is discouraged. See -/// https://www.mongodb.com/docs/languages/cpp/drivers/current/working-with-bson/#basic-builder for -/// more details. +/// @warning Use of the stream builder is discouraged. See +/// [Working with +/// BSON](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/working-with-bson/#basic-builder) +/// for more details. /// class document : public key_context<> { public: From 9cab3ed2b8b721d99491885bb69f6ad583fda239 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:14 -0500 Subject: [PATCH 07/17] doxygen: set SORT_* = YES --- Doxyfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doxyfile b/Doxyfile index 01ac794e90..107e91608a 100644 --- a/Doxyfile +++ b/Doxyfile @@ -639,7 +639,7 @@ SORT_MEMBER_DOCS = YES # this will also influence the order of the classes in the class list. # The default value is: NO. -SORT_BRIEF_DOCS = NO +SORT_BRIEF_DOCS = YES # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and @@ -651,14 +651,14 @@ SORT_BRIEF_DOCS = NO # detailed member documentation. # The default value is: NO. -SORT_MEMBERS_CTORS_1ST = NO +SORT_MEMBERS_CTORS_1ST = YES # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. -SORT_GROUP_NAMES = NO +SORT_GROUP_NAMES = YES # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will @@ -668,7 +668,7 @@ SORT_GROUP_NAMES = NO # list. # The default value is: NO. -SORT_BY_SCOPE_NAME = NO +SORT_BY_SCOPE_NAME = YES # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between From d514e343903fb8efe11557235e4895d3c6263437 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:15 -0500 Subject: [PATCH 08/17] doxygen: add BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR --- Doxyfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doxyfile b/Doxyfile index 107e91608a..3a3d9ce66d 100644 --- a/Doxyfile +++ b/Doxyfile @@ -2214,10 +2214,12 @@ PREDEFINED = BSONCXX_API= \ BSONCXX_CALL= \ BSONCXX_DEPRECATED \ BSONCXX_INLINE=inline \ + BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR= \ MONGOCXX_API= \ MONGOCXX_CALL= \ MONGOCXX_DEPRECATED= \ - MONGOCXX_INLINE=inline + MONGOCXX_INLINE=inline \ + MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The From 8408c9f854ff3381d936e18b03794d000f130594 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:15 -0500 Subject: [PATCH 09/17] CXX-2288 add library root-level forward headers --- src/bsoncxx/include/bsoncxx/fwd.hpp | 17 +++++++++++++++++ src/bsoncxx/lib/CMakeLists.txt | 2 ++ src/bsoncxx/lib/bsoncxx/fwd.cpp | 15 +++++++++++++++ src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/fwd.cpp | 15 +++++++++++++++ src/mongocxx/include/mongocxx/fwd.hpp | 17 +++++++++++++++++ src/mongocxx/lib/CMakeLists.txt | 2 ++ src/mongocxx/lib/mongocxx/fwd.cpp | 15 +++++++++++++++ .../lib/mongocxx/v_noabi/mongocxx/fwd.cpp | 15 +++++++++++++++ 8 files changed, 98 insertions(+) create mode 100644 src/bsoncxx/include/bsoncxx/fwd.hpp create mode 100644 src/bsoncxx/lib/bsoncxx/fwd.cpp create mode 100644 src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/fwd.cpp create mode 100644 src/mongocxx/include/mongocxx/fwd.hpp create mode 100644 src/mongocxx/lib/mongocxx/fwd.cpp create mode 100644 src/mongocxx/lib/mongocxx/v_noabi/mongocxx/fwd.cpp diff --git a/src/bsoncxx/include/bsoncxx/fwd.hpp b/src/bsoncxx/include/bsoncxx/fwd.hpp new file mode 100644 index 0000000000..7243e4b3a6 --- /dev/null +++ b/src/bsoncxx/include/bsoncxx/fwd.hpp @@ -0,0 +1,17 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. +#include +// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. diff --git a/src/bsoncxx/lib/CMakeLists.txt b/src/bsoncxx/lib/CMakeLists.txt index 8bab5f4697..2fc71189a8 100644 --- a/src/bsoncxx/lib/CMakeLists.txt +++ b/src/bsoncxx/lib/CMakeLists.txt @@ -22,6 +22,7 @@ set(bsoncxx_sources_v_noabi bsoncxx/v_noabi/bsoncxx/document/value.cpp bsoncxx/v_noabi/bsoncxx/document/view.cpp bsoncxx/v_noabi/bsoncxx/exception/error_code.cpp + bsoncxx/v_noabi/bsoncxx/fwd.cpp bsoncxx/v_noabi/bsoncxx/json.cpp bsoncxx/v_noabi/bsoncxx/oid.cpp bsoncxx/v_noabi/bsoncxx/private/itoa.cpp @@ -34,6 +35,7 @@ set(bsoncxx_sources_v_noabi list(APPEND bsoncxx_sources ${bsoncxx_sources_v_noabi} + bsoncxx/fwd.cpp ) list(TRANSFORM bsoncxx_sources PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") set(bsoncxx_sources "${bsoncxx_sources}" PARENT_SCOPE) diff --git a/src/bsoncxx/lib/bsoncxx/fwd.cpp b/src/bsoncxx/lib/bsoncxx/fwd.cpp new file mode 100644 index 0000000000..382cd6d018 --- /dev/null +++ b/src/bsoncxx/lib/bsoncxx/fwd.cpp @@ -0,0 +1,15 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include // diff --git a/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/fwd.cpp b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/fwd.cpp new file mode 100644 index 0000000000..82aeefe1a3 --- /dev/null +++ b/src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/fwd.cpp @@ -0,0 +1,15 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include diff --git a/src/mongocxx/include/mongocxx/fwd.hpp b/src/mongocxx/include/mongocxx/fwd.hpp new file mode 100644 index 0000000000..75abc117aa --- /dev/null +++ b/src/mongocxx/include/mongocxx/fwd.hpp @@ -0,0 +1,17 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. +#include +// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. diff --git a/src/mongocxx/lib/CMakeLists.txt b/src/mongocxx/lib/CMakeLists.txt index eba06782bd..6bbd5485a1 100644 --- a/src/mongocxx/lib/CMakeLists.txt +++ b/src/mongocxx/lib/CMakeLists.txt @@ -38,6 +38,7 @@ set(mongocxx_sources_v_noabi mongocxx/v_noabi/mongocxx/exception/error_code.cpp mongocxx/v_noabi/mongocxx/exception/operation_exception.cpp mongocxx/v_noabi/mongocxx/exception/server_error_code.cpp + mongocxx/v_noabi/mongocxx/fwd.cpp mongocxx/v_noabi/mongocxx/gridfs/bucket.cpp mongocxx/v_noabi/mongocxx/gridfs/downloader.cpp mongocxx/v_noabi/mongocxx/gridfs/uploader.cpp @@ -110,6 +111,7 @@ set(mongocxx_sources_v_noabi list(APPEND mongocxx_sources ${mongocxx_sources_v_noabi} + mongocxx/fwd.cpp ) list(TRANSFORM mongocxx_sources PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/") set(mongocxx_sources "${mongocxx_sources}" PARENT_SCOPE) diff --git a/src/mongocxx/lib/mongocxx/fwd.cpp b/src/mongocxx/lib/mongocxx/fwd.cpp new file mode 100644 index 0000000000..635448687c --- /dev/null +++ b/src/mongocxx/lib/mongocxx/fwd.cpp @@ -0,0 +1,15 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include // diff --git a/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/fwd.cpp b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/fwd.cpp new file mode 100644 index 0000000000..371c40a764 --- /dev/null +++ b/src/mongocxx/lib/mongocxx/v_noabi/mongocxx/fwd.cpp @@ -0,0 +1,15 @@ +// Copyright 2009-present MongoDB, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include From e321eb7ee571af902f3da20a9e2a565144164c0c Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:16 -0500 Subject: [PATCH 10/17] CXX-3064 fix @relates and groupings --- .../bsoncxx/v_noabi/bsoncxx/array/element.hpp | 28 +-- .../bsoncxx/v_noabi/bsoncxx/array/view.hpp | 14 +- .../v_noabi/bsoncxx/array/view_or_value.hpp | 5 +- .../v_noabi/bsoncxx/builder/concatenate.hpp | 26 ++- .../bsoncxx/builder/stream/array_context.hpp | 2 +- .../bsoncxx/builder/stream/value_context.hpp | 2 +- .../bsoncxx/v_noabi/bsoncxx/decimal128.hpp | 6 +- .../v_noabi/bsoncxx/document/element.hpp | 16 +- .../v_noabi/bsoncxx/document/value.hpp | 9 +- .../bsoncxx/v_noabi/bsoncxx/document/view.hpp | 16 +- .../bsoncxx/document/view_or_value.hpp | 5 +- .../include/bsoncxx/v_noabi/bsoncxx/oid.hpp | 9 +- .../v_noabi/bsoncxx/string/view_or_value.hpp | 14 +- .../include/bsoncxx/v_noabi/bsoncxx/types.hpp | 195 ++++++++++++++++-- .../bsoncxx/types/bson_value/value.hpp | 22 +- .../v_noabi/bsoncxx/types/bson_value/view.hpp | 6 +- .../bsoncxx/v_noabi/bsoncxx/view_or_value.hpp | 28 ++- .../v_noabi/mongocxx/change_stream.hpp | 10 +- .../mongocxx/v_noabi/mongocxx/client.hpp | 70 ++----- .../mongocxx/v_noabi/mongocxx/collection.hpp | 145 +------------ .../mongocxx/v_noabi/mongocxx/cursor.hpp | 8 +- .../mongocxx/v_noabi/mongocxx/database.hpp | 33 --- .../mongocxx/events/topology_description.hpp | 10 +- .../exception/operation_exception.hpp | 4 +- .../v_noabi/mongocxx/gridfs/bucket.hpp | 40 ---- .../mongocxx/v_noabi/mongocxx/hint.hpp | 61 +++--- .../mongocxx/v_noabi/mongocxx/index_view.hpp | 48 ----- .../v_noabi/mongocxx/model/update_many.hpp | 6 - .../v_noabi/mongocxx/model/update_one.hpp | 6 - .../v_noabi/mongocxx/read_concern.hpp | 6 +- .../v_noabi/mongocxx/read_preference.hpp | 6 +- .../v_noabi/mongocxx/search_index_view.hpp | 30 --- .../v_noabi/mongocxx/write_concern.hpp | 6 +- 33 files changed, 349 insertions(+), 543 deletions(-) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp index f469b9f44a..8a95f424bd 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp @@ -88,33 +88,25 @@ class element : private document::element { BSONCXX_PRIVATE explicit element(const stdx::string_view key); }; -/// -/// @{ /// /// Convenience methods to compare for equality against a bson_value. /// -/// Returns true if this element contains a bson_value that matches. -/// -/// @relates element +/// Compares equal if this element contains a matching bson_value. Otherwise, compares unequal. /// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::array::element BSONCXX_API bool BSONCXX_CALL operator==(const element& elem, const types::bson_value::view& v); + +/// @relatesalso bsoncxx::v_noabi::array::element BSONCXX_API bool BSONCXX_CALL operator==(const types::bson_value::view& v, const element& elem); -/// -/// @} -/// -/// -/// @{ -/// -/// Convenience methods to compare for equality against a bson_value. -/// -/// Returns false if this element contains a bson_value that matches. -/// -/// @relates element -/// +/// @relatesalso bsoncxx::v_noabi::array::element BSONCXX_API bool BSONCXX_CALL operator!=(const element& elem, const types::bson_value::view& v); + +/// @relatesalso bsoncxx::v_noabi::array::element BSONCXX_API bool BSONCXX_CALL operator!=(const types::bson_value::view& v, const element& elem); -/// + /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp index f50d037a00..12a001b05c 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp @@ -130,15 +130,13 @@ class view { operator document::view() const; /// - /// @{ + /// @relates bsoncx::v_noabi::document::view /// /// Compare two views for (in)-equality /// - /// @relates view - /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(view, view); friend BSONCXX_API bool BSONCXX_CALL operator!=(view, view); - /// /// @} /// @@ -173,15 +171,13 @@ class view::const_iterator { const_iterator operator++(int); /// - /// @{ - /// - /// Compare two const_iterators for (in)-equality + /// @relates bsoncxx::v_noabi::array::view::const_iterator /// - /// @relates view::const_iterator + /// Compare two const_iterators for (in)-equality. /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(const const_iterator&, const const_iterator&); friend BSONCXX_API bool BSONCXX_CALL operator!=(const const_iterator&, const const_iterator&); - /// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp index 56e180ffab..85457a00bd 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view_or_value.hpp @@ -25,7 +25,10 @@ namespace bsoncxx { namespace v_noabi { namespace array { -using view_or_value = ::bsoncxx::v_noabi::view_or_value; +/// +/// Equivalent to `v_noabi::view_or_value`. +/// +using view_or_value = v_noabi::view_or_value; } // namespace array } // namespace v_noabi diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp index 629d473475..ab7e17c2ea 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/concatenate.hpp @@ -82,32 +82,30 @@ struct concatenate_array { }; /// -/// Helper method to concatenate a document. Use this with the document stream -/// builder to merge an existing document's fields with a new document's. +/// Helper method to concatenate a document. /// -/// @param doc A document to be concatenated. +/// Use this with the document stream builder to merge an existing document's fields with a new +/// document's. +/// +/// @param doc The document to concatenate. /// /// @return concatenate_doc A concatenating struct. /// -/// @relatesalso concatenate_doc +/// @see bsoncxx::v_noabi::builder::concatenate_doc +/// +/// @note An overload accepting @ref v_noabi::array::view_or_value and returning a @ref +/// concatenate_array is also declared in this scope. /// BSONCXX_INLINE concatenate_doc concatenate(document::view_or_value doc) { return {std::move(doc)}; } -/// -/// Method to concatenate an array with a new array. Use this with the array stream -/// builder to merge an existing array's fields with a new array. -/// -/// @param array An array to be concatenated. -/// -/// @return concatenate_array A concatenating struct. -/// -/// @relatesalso concatenate_array -/// +// Why is Doxygen unable to parse this overload correctly??? +// @cond DOXYGEN_DISABLE "warning: no matching file member found for ..." BSONCXX_INLINE concatenate_array concatenate(array::view_or_value array) { return {std::move(array)}; } +// @endcond } // namespace builder } // namespace v_noabi diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp index 834a9b13ce..25be67c638 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/array_context.hpp @@ -167,7 +167,7 @@ class array_context { /// /// Conversion operator for single_context. /// - /// @relatesalso single_context + /// @see bsoncxx::v_noabi::builder::stream::single_context /// BSONCXX_INLINE operator single_context(); diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp index a30967dade..db293b3dcc 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/stream/value_context.hpp @@ -108,7 +108,7 @@ class value_context { /// /// Conversion operator for single_context. /// - /// @relatesalso single_context + /// @see bsoncxx::v_noabi::builder::stream::single_context /// operator single_context(); diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp index 22ccb414ab..5bdb8c4c93 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/decimal128.hpp @@ -65,15 +65,13 @@ class decimal128 { std::string to_string() const; /// - /// @{ + /// @relates bsoncxx::v_noabi::decimal128 /// /// Relational operators for decimal128 /// - /// @relates decimal128 - /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(const decimal128& lhs, const decimal128& rhs); friend BSONCXX_API bool BSONCXX_CALL operator!=(const decimal128& lhs, const decimal128& rhs); - /// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp index b884cd92ba..8240b5dd0b 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/element.hpp @@ -40,7 +40,7 @@ namespace document { /// interrogated by calling type(), the key can be extracted by calling key() and /// a specific value can be extracted through get_X() accessors. /// -/// @relatesalso array::element +/// @see bsoncxx::v_noabi::array::element /// class element { public: @@ -386,23 +386,25 @@ class element { stdx::optional _key; }; -/// -/// @relates bsoncxx::v_noabi::document::element -/// -/// @{ /// /// Convenience methods to compare for equality against a bson_value. /// -/// Returns true if this element contains a bson_value that matches. +/// Compares equal if the element contains a matching bson_value. Otherwise, compares unequal. /// +/// @{ +/// @relatesalso bsoncxx::v_noabi::document::element BSONCXX_API bool BSONCXX_CALL operator==(const element& elem, const types::bson_value::view& v); + +/// @relatesalso bsoncxx::v_noabi::document::element BSONCXX_API bool BSONCXX_CALL operator==(const types::bson_value::view& v, const element& elem); +/// @relatesalso bsoncxx::v_noabi::document::element BSONCXX_API bool BSONCXX_CALL operator!=(const element& elem, const types::bson_value::view& v); + +/// @relatesalso bsoncxx::v_noabi::document::element BSONCXX_API bool BSONCXX_CALL operator!=(const types::bson_value::view& v, const element& elem); -/// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp index a9eed97cc8..622d77d4b8 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/value.hpp @@ -249,22 +249,21 @@ BSONCXX_INLINE value::operator document::view() const noexcept { return view(); } -/// -/// @{ /// /// Compares two document values for (in)-equality. /// -/// @relates document::value -/// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::document::value BSONCXX_INLINE bool operator==(const value& lhs, const value& rhs) { return (lhs.view() == rhs.view()); } +/// @relatesalso bsoncxx::v_noabi::document::value BSONCXX_INLINE bool operator!=(const value& lhs, const value& rhs) { return !(lhs == rhs); } -/// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp index 585a4f5da8..af1b5e5f62 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view.hpp @@ -129,15 +129,13 @@ class view { bool empty() const; /// - /// @{ - /// - /// Compare two document views for (in)-equality + /// @relates bsoncxx::v_noabi::document::view /// - /// @relates view + /// Compare two document views for (in)-equality. /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(view, view); friend BSONCXX_API bool BSONCXX_CALL operator!=(view, view); - /// /// @} /// @@ -173,15 +171,13 @@ class view::const_iterator { const_iterator operator++(int); /// - /// @{ - /// - /// Compares two const_iterators for (in)-equality + /// @relates bsoncxx::v_noabi::document::view::const_iterator /// - /// @relates view::const_iterator + /// Compares two const_iterators for (in)-equality. /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(const const_iterator&, const const_iterator&); friend BSONCXX_API bool BSONCXX_CALL operator!=(const const_iterator&, const const_iterator&); - /// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp index 6dd2248af4..ca9083218b 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/document/view_or_value.hpp @@ -24,7 +24,10 @@ namespace bsoncxx { namespace v_noabi { namespace document { -using view_or_value = bsoncxx::v_noabi::view_or_value; +/// +/// Equivalent to `v_noabi::view_or_value`. +/// +using view_or_value = v_noabi::view_or_value; } // namespace document } // namespace v_noabi diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp index bb6e66673a..bf516cec32 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/oid.hpp @@ -86,23 +86,22 @@ class oid { } /// - /// @{ - /// - /// Relational operators for OIDs + /// @relates bsoncxx::v_noabi::oid /// - /// @relates oid + /// Relational operators for OIDs. /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator<(const oid& lhs, const oid& rhs); friend BSONCXX_API bool BSONCXX_CALL operator>(const oid& lhs, const oid& rhs); friend BSONCXX_API bool BSONCXX_CALL operator<=(const oid& lhs, const oid& rhs); friend BSONCXX_API bool BSONCXX_CALL operator>=(const oid& lhs, const oid& rhs); friend BSONCXX_API bool BSONCXX_CALL operator==(const oid& lhs, const oid& rhs); friend BSONCXX_API bool BSONCXX_CALL operator!=(const oid& lhs, const oid& rhs); - /// /// @} /// /// + /// @memberof bsoncxx::v_noabi::oid /// Extracts the timestamp portion of the underlying ObjectId. /// /// @return A std::time_t initialized to the timestamp. diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp index 1d7709c8b6..771af24ce7 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp @@ -93,28 +93,30 @@ class view_or_value : public bsoncxx::v_noabi::view_or_value #undef BSONCXX_ENUM +#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) + } // namespace types } // namespace v_noabi } // namespace bsoncxx diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp index edf23553cf..0bc5c6e9e8 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/value.hpp @@ -41,7 +41,7 @@ namespace bson_value { /// For accessors into this type and to extract the various BSON types out, /// please use bson_value::view. /// -/// @relatesalso bson_value::view +/// @see bsoncxx::v_noabi::bson_value::view /// class value { public: @@ -275,49 +275,49 @@ class value { std::unique_ptr _impl; }; -/// -/// @{ /// /// Compares values for (in)-equality. /// -/// @relates bson_value::value -/// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator==(const value& lhs, const value& rhs) { return (lhs.view() == rhs.view()); } +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator!=(const value& lhs, const value& rhs) { return !(lhs == rhs); } -/// /// @} /// -/// -/// @{ /// /// Compares a value with a view for (in)-equality. /// -/// @relates bson_value::value -/// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator==(const value& lhs, const view& rhs) { return (lhs.view() == rhs); } +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator==(const view& lhs, const value& rhs) { return (rhs == lhs); } +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator!=(const value& lhs, const view& rhs) { return !(lhs == rhs); } +/// @relatesalso bsoncxx::v_noabi::types::bson_value::value BSONCXX_INLINE bool operator!=(const view& lhs, const value& rhs) { return !(lhs == rhs); } -/// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/view.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/view.hpp index e5b5b7f59b..3b34d03fcb 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/view.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types/bson_value/view.hpp @@ -70,17 +70,15 @@ class view { ~view(); /// - /// @{ + /// @relates bsoncxx::v_noabi::types::bson_value::view /// /// Compare two bson_value::views for equality /// - /// @relates bson_value::view - /// + /// @{ friend BSONCXX_API bool BSONCXX_CALL operator==(const bson_value::view&, const bson_value::view&); friend BSONCXX_API bool BSONCXX_CALL operator!=(const bson_value::view&, const bson_value::view&); - /// /// @} /// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp index c48f8a71ea..fbe9d65c95 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp @@ -145,74 +145,80 @@ class view_or_value { }; /// -/// @{ -/// -/// Compare view_or_value objects for (in)-equality -/// -/// @relates: view_or_value +/// Compare view_or_value objects for (in)-equality. /// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator==(const view_or_value& lhs, const view_or_value& rhs) { return lhs.view() == rhs.view(); } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator!=(const view_or_value& lhs, const view_or_value& rhs) { return !(lhs == rhs); } -/// + /// @} /// -/// -/// @{ /// /// Mixed (in)-equality operators for view_or_value against View or Value types /// -/// @relates view_or_value -/// +/// @{ + +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator==(const view_or_value& lhs, View rhs) { return lhs.view() == rhs; } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator==(View lhs, const view_or_value& rhs) { return rhs == lhs; } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator!=(const view_or_value& lhs, View rhs) { return !(lhs == rhs); } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator!=(View lhs, const view_or_value& rhs) { return !(rhs == lhs); } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator==(const view_or_value& lhs, const Value& rhs) { return lhs.view() == View(rhs); } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator==(const Value& lhs, const view_or_value& rhs) { return rhs == lhs; } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator!=(const view_or_value& lhs, const Value& rhs) { return !(lhs == rhs); } +/// @relatesalso bsoncxx::v_noabi::view_or_value template BSONCXX_INLINE bool operator!=(const Value& lhs, const view_or_value& rhs) { return !(rhs == lhs); } -/// + /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp index f0c90ce318..a2e1cbd599 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/change_stream.hpp @@ -194,19 +194,19 @@ class change_stream::iterator { MONGOCXX_PRIVATE explicit iterator(iter_type type, const change_stream* change_stream); /// - /// @{ + /// @relates bsoncxx::v_noabi::change_stream::iterator /// - /// Compare two iterators for (in)-equality. Iterators compare equal if - /// they point to the same underlying change_stream or if both are exhausted. + /// Compare two iterators for (in)-equality. /// - /// @relates iterator + /// Iterators compare equal if they point to the same underlying change_stream or if both are + /// exhausted. /// + /// @{ friend MONGOCXX_API bool MONGOCXX_CALL operator==(const change_stream::iterator&, const change_stream::iterator&) noexcept; friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const change_stream::iterator&, const change_stream::iterator&) noexcept; - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp index 421de6e7c0..e8a561dfc5 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp @@ -220,9 +220,7 @@ class client { bsoncxx::v_noabi::string::view_or_value name) const&& = delete; /// - /// @{ - /// - /// Enumerates the databases in the client. + /// @brief Enumerates the databases in the client. /// /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database @@ -235,48 +233,22 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// + /// @{ + cursor list_databases() const; - /// - /// Enumerates the databases in the client. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// - /// @return A mongocxx::v_noabi::cursor containing a BSON document for each - /// database. Each document contains a name field with the database - /// name, a sizeOnDisk field with the total size of the database file on - /// disk in bytes, and an empty field specifying whether the database - /// has any data. - /// - /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command - /// fails. - /// - /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases - /// cursor list_databases(const client_session& session) const; - /// - /// Enumerates the databases in the client. /// /// @param opts /// Options passed directly to the 'listDatabases' command. /// - /// @return A mongocxx::v_noabi::cursor containing a BSON document for each - /// database. Each document contains a name field with the database - /// name, a sizeOnDisk field with the total size of the database file on - /// disk in bytes, and an empty field specifying whether the database - /// has any data. - /// - /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command - /// fails. - /// - /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases - /// cursor list_databases(const bsoncxx::v_noabi::document::view_or_value opts) const; - /// - /// Enumerates the databases in the client. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the aggregation. @@ -284,20 +256,15 @@ class client { /// @param opts /// Options passed directly to the 'listDatabases' command. /// - /// @return A mongocxx::v_noabi::cursor containing a BSON document for each - /// database. Each document contains a name field with the database - /// name, a sizeOnDisk field with the total size of the database file on - /// disk in bytes, and an empty field specifying whether the database - /// has any data. - /// - /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command - /// fails. - /// - /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases - /// cursor list_databases(const client_session& session, const bsoncxx::v_noabi::document::view_or_value opts) const; + /// @} + /// + + /// + /// @{ + /// /// Queries the MongoDB server for a list of known databases. /// @@ -311,6 +278,7 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// + std::vector list_database_names( const bsoncxx::v_noabi::document::view_or_value filter = {}) const; @@ -319,7 +287,6 @@ class client { /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the aggregation. - /// /// @param filter /// An optional query expression to filter the returned database names. /// @@ -334,7 +301,6 @@ class client { const client_session& session, const bsoncxx::v_noabi::document::view_or_value filter = {}) const; - /// /// @} /// @@ -352,8 +318,10 @@ class client { /// /// @{ + + /// + /// Get a change stream on this client with an empty pipeline. /// - /// Gets a change stream on this client with an empty pipeline. /// Change streams are only supported with a "majority" read concern or no read concern. /// /// @param options @@ -366,6 +334,10 @@ class client { /// change_stream watch(const options::change_stream& options = {}); + /// + /// Get a change stream on this client with an empty pipeline. + /// + /// Change streams are only supported with a "majority" read concern or no read concern. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the watch operation. @@ -380,7 +352,8 @@ class client { change_stream watch(const client_session& session, const options::change_stream& options = {}); /// - /// Gets a change stream on this client. + /// Get a change stream on this client. + /// /// Change streams are only supported with a "majority" read concern or no read concern. /// /// @param pipe @@ -398,7 +371,9 @@ class client { change_stream watch(const pipeline& pipe, const options::change_stream& options = {}); /// - /// Gets a change stream on this client. + /// Get a change stream on this client. + /// + /// Change streams are only supported with a "majority" read concern or no read concern. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the watch operation. @@ -416,7 +391,6 @@ class client { const pipeline& pipe, const options::change_stream& options = {}); - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp index ac95526226..316e56060b 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/collection.hpp @@ -140,8 +140,6 @@ class collection { /// explicit operator bool() const noexcept; - /// - /// @{ /// /// Runs an aggregation framework pipeline against this collection. /// @@ -188,12 +186,7 @@ class collection { cursor aggregate(const client_session& session, const pipeline& pipeline, const options::aggregate& options = options::aggregate()); - /// - /// @} - /// - /// - /// @{ /// /// Creates a new bulk operation to be executed against this collection. /// The lifetime of the bulk_write is independent of the collection. @@ -220,12 +213,7 @@ class collection { /// mongocxx::v_noabi::bulk_write create_bulk_write(const client_session& session, const options::bulk_write& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Sends a write to the server as a bulk write operation. /// @@ -275,12 +263,7 @@ class collection { const client_session& session, const model::write& write, const options::bulk_write& options = options::bulk_write()); - /// - /// @} - /// - /// - /// @{ /// /// Sends a container of writes to the server as a bulk write operation. /// @@ -334,12 +317,7 @@ class collection { const client_session& session, const container_type& writes, const options::bulk_write& options = options::bulk_write()); - /// - /// @} - /// - /// - /// @{ /// /// Sends writes starting at @c begin and ending at @c end to the server as a bulk write /// operation. @@ -398,12 +376,7 @@ class collection { write_model_iterator_type begin, write_model_iterator_type end, const options::bulk_write& options = options::bulk_write()); - /// - /// @} - /// - /// - /// @{ /// /// Counts the number of documents matching the provided filter. /// @@ -453,12 +426,7 @@ class collection { std::int64_t count_documents(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const options::count& options = options::count()); - /// - /// @} - /// - /// - /// @{ /// /// Returns an estimate of the number of documents in the collection. /// @@ -476,12 +444,7 @@ class collection { /// std::int64_t estimated_document_count( const options::estimated_document_count& options = options::estimated_document_count()); - /// - /// @} - /// - /// - /// @{ /// /// Creates an index over the collection for the provided keys with the provided options. /// @@ -533,12 +496,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value index_options = {}, options::index_view operation_options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Deletes all matching documents from the collection. /// @@ -582,12 +539,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); - /// - /// @} - /// - - /// - /// @{ /// /// Deletes a single matching document from the collection. /// @@ -631,12 +582,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::delete_options& options = options::delete_options()); - /// - /// @} - /// - - /// - /// @{ /// /// Finds the distinct values for a specified field across the collection. /// @@ -646,11 +591,11 @@ class collection { /// Document view representing the documents for which the distinct operation will apply. /// @param options /// Optional arguments, see options::distinct. - + /// /// @return mongocxx::v_noabi::cursor having the distinct values for the specified /// field. If the operation fails, the cursor throws /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. - + /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// cursor distinct(bsoncxx::v_noabi::string::view_or_value name, @@ -668,11 +613,11 @@ class collection { /// Document view representing the documents for which the distinct operation will apply. /// @param options /// Optional arguments, see options::distinct. - + /// /// @return mongocxx::v_noabi::cursor having the distinct values for the specified /// field. If the operation fails, the cursor throws /// mongocxx::v_noabi::query_exception when the returned cursor is iterated. - + /// /// @see https://www.mongodb.com/docs/manual/reference/command/distinct/ /// cursor distinct(const client_session& session, @@ -680,12 +625,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::distinct& options = options::distinct()); - /// - /// @} - /// - - /// - /// @{ /// /// Drops this collection and all its contained documents from the database. /// @@ -734,12 +673,6 @@ class collection { write_concern = {}, bsoncxx::v_noabi::document::view_or_value collection_options = {}); - /// - /// @} - /// - - /// - /// @{ /// /// Finds the documents in this collection which match the provided filter. /// @@ -783,8 +716,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); - /// - /// @{ /// /// Finds a single document in this collection that match the provided filter. /// @@ -824,12 +755,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = options::find()); - /// - /// @} - /// - - /// - /// @{ /// /// Finds a single document matching the filter, deletes it, and returns the original. /// @@ -875,12 +800,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value filter, const options::find_one_and_delete& options = options::find_one_and_delete()); - /// - /// @} - /// - - /// - /// @{ /// /// Finds a single document matching the filter, replaces it, and returns either the original /// or the replacement document. @@ -934,12 +853,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value replacement, const options::find_one_and_replace& options = options::find_one_and_replace()); - /// - /// @} - /// - - /// - /// @{ /// /// Finds a single document matching the filter, updates it, and returns either the original /// or the newly-updated document. @@ -1099,12 +1012,6 @@ class collection { std::initializer_list<_empty_doc_tag> update, const options::find_one_and_update& options = options::find_one_and_update()); - /// - /// @} - /// - - /// - /// @{ /// /// Inserts a single document into the collection. If the document is missing an identifier /// (@c _id field) one will be generated for it. @@ -1119,8 +1026,11 @@ class collection { /// disengaged. /// /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. + /// stdx::optional insert_one( bsoncxx::v_noabi::document::view_or_value document, const options::insert& options = {}); + + /// /// /// Inserts a single document into the collection. If the document is missing an identifier /// (@c _id field) one will be generated for it. @@ -1137,16 +1047,12 @@ class collection { /// disengaged. /// /// @throws mongocxx::v_noabi::bulk_write_exception if the operation fails. + /// stdx::optional insert_one( const client_session& session, bsoncxx::v_noabi::document::view_or_value document, const options::insert& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Inserts multiple documents into the collection. If any of the documents are missing /// identifiers the driver will generate them. @@ -1201,8 +1107,6 @@ class collection { const container_type& container, const options::insert& options = options::insert()); - /// - /// @{ /// /// Inserts multiple documents into the collection. If any of the documents are missing /// identifiers the driver will generate them. @@ -1259,12 +1163,8 @@ class collection { document_view_iterator_type begin, document_view_iterator_type end, const options::insert& options = options::insert()); - /// - /// @} - /// /// - /// @{ /// /// Returns a list of the indexes currently on this collection. /// @@ -1290,10 +1190,6 @@ class collection { /// cursor list_indexes(const client_session& session) const; - /// - /// @} - /// - /// /// Returns the name of this collection. /// @@ -1351,10 +1247,6 @@ class collection { bool drop_target_before_rename = false, const bsoncxx::v_noabi::stdx::optional& write_concern = {}); - /// - /// @} - /// - /// /// Sets the read_concern for this collection. Changes will not have any effect on existing /// cursors or other read operations which use the previously-set read concern. @@ -1396,8 +1288,6 @@ class collection { /// mongocxx::v_noabi::read_preference read_preference() const; - /// - /// @{ /// /// Replaces a single document matching the provided filter in this collection. /// @@ -1451,8 +1341,6 @@ class collection { bsoncxx::v_noabi::document::view_or_value replacement, const options::replace& options = options::replace{}); - /// - /// @{ /// /// Updates multiple documents matching the provided filter in this collection. /// @@ -1606,12 +1494,6 @@ class collection { std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); - /// - /// @} - /// - - /// - /// @{ /// /// Updates a single document matching the provided filter in this collection. /// @@ -1765,10 +1647,6 @@ class collection { std::initializer_list<_empty_doc_tag> update, const options::update& options = options::update()); - /// - /// @} - /// - /// /// Sets the write_concern for this collection. Changes will not have any effect on existing /// write operations. @@ -1787,10 +1665,10 @@ class collection { /// /// Gets an index_view to the collection. + /// index_view indexes(); /// - /// @{ /// /// Gets a change stream on this collection with an empty pipeline. /// Change streams are only supported with a "majority" read concern or no read concern. @@ -1855,12 +1733,9 @@ class collection { const pipeline& pipe, const options::change_stream& options = {}); - /// - /// @} - /// - /// /// Gets a search_index_view to the collection. + /// search_index_view search_indexes(); private: diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp index 3c27f1df2f..32d4d08280 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/cursor.hpp @@ -162,16 +162,14 @@ class cursor::iterator { friend ::mongocxx::v_noabi::cursor; /// - /// @{ + /// @relates mongocxx::v_noabi::mongocxx::cursor::iterator /// - /// Compare two iterators for (in)-equality. Iterators compare equal if + /// Compare two iterators for (in)-equality. Iterators compare equal if /// they point to the same underlying cursor or if both are exhausted. /// - /// @relates iterator - /// + /// @{ friend MONGOCXX_API bool MONGOCXX_CALL operator==(const iterator&, const iterator&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const iterator&, const iterator&); - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp index e3f2effca5..da0cb2d1ee 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/database.hpp @@ -83,8 +83,6 @@ class database { /// explicit operator bool() const noexcept; - /// - /// @{ /// /// Runs an aggregation framework pipeline against this database for /// pipeline stages that do not require an underlying collection, @@ -135,12 +133,7 @@ class database { cursor aggregate(const client_session& session, const pipeline& pipeline, const options::aggregate& options = options::aggregate()); - /// - /// @} - /// - /// - /// @{ /// /// Runs a command against this database. /// @@ -181,12 +174,7 @@ class database { /// bsoncxx::v_noabi::document::value run_command(bsoncxx::v_noabi::document::view_or_value command, uint32_t server_id); - /// - /// @} - /// - /// - /// @{ /// /// Explicitly creates a collection in this database with the specified options. /// @@ -333,12 +321,6 @@ class database { const options::create_collection_deprecated& collection_options, const stdx::optional& write_concern = {}); - /// - /// @} - /// - - /// - /// @{ /// /// Drops the database and all its collections. /// @@ -373,9 +355,6 @@ class database { void drop(const client_session& session, const bsoncxx::v_noabi::stdx::optional& write_concern = {}); - /// - /// @} - /// /// /// Checks whether this database contains a collection having the given name. @@ -389,8 +368,6 @@ class database { /// bool has_collection(bsoncxx::v_noabi::string::view_or_value name) const; - /// - /// @{ /// /// Enumerates the collections in this database. /// @@ -452,10 +429,6 @@ class database { std::vector list_collection_names( const client_session& session, bsoncxx::v_noabi::document::view_or_value filter = {}); - /// - /// @} - /// - /// /// Get the name of this database. /// @@ -562,8 +535,6 @@ class database { gridfs::bucket gridfs_bucket( const options::gridfs::bucket& options = options::gridfs::bucket()) const; - /// - /// @{ /// /// Gets a change stream on this database with an empty pipeline. /// Change streams are only supported with a "majority" read concern or no read concern. @@ -628,10 +599,6 @@ class database { const pipeline& pipe, const options::change_stream& options = {}); - /// - /// @} - /// - private: friend ::mongocxx::v_noabi::client_encryption; friend ::mongocxx::v_noabi::client; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp index 7aa8d6dc3f..992ef12b61 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/events/topology_description.hpp @@ -72,27 +72,21 @@ class topology_description { /// using const_iterator = container::const_iterator; - /// - /// @{ /// /// Returns an iterator to the beginning. /// + /// @{ iterator begin() noexcept; const_iterator begin() const noexcept; - - /// /// @} /// - /// - /// @{ /// /// Returns an iterator to the end. /// + /// @{ iterator end() noexcept; const_iterator end() const noexcept; - - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp index 82a1e3adcc..3ab192f025 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/exception/operation_exception.hpp @@ -50,16 +50,14 @@ class operation_exception : public exception { bsoncxx::v_noabi::document::value&& raw_server_error, std::string what_arg = ""); - /// - /// @{ /// /// The optional raw bson error document from the server. /// /// @returns The raw server error, if it is available. /// + /// @{ const stdx::optional& raw_server_error() const; stdx::optional& raw_server_error(); - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp index 22452ca3d0..61ae3469d6 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/gridfs/bucket.hpp @@ -99,8 +99,6 @@ class bucket { /// explicit operator bool() const noexcept; - /// - /// @{ /// /// Opens a gridfs::uploader to create a new GridFS file. The id of the file will be /// automatically generated as an ObjectId. @@ -163,12 +161,7 @@ class bucket { uploader open_upload_stream(const client_session& session, stdx::string_view filename, const options::gridfs::upload& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Opens a gridfs::uploader to create a new GridFS file. /// @@ -237,12 +230,7 @@ class bucket { bsoncxx::v_noabi::types::bson_value::view id, stdx::string_view filename, const options::gridfs::upload& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Creates a new GridFS file by uploading bytes from an input stream. The id of the file will /// be automatically generated as an ObjectId. @@ -336,12 +324,7 @@ class bucket { stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Creates a new GridFS file with a user-supplied unique id by uploading bytes from an input /// stream. @@ -437,12 +420,7 @@ class bucket { stdx::string_view filename, std::istream* source, const options::gridfs::upload& options = {}); - /// - /// @} - /// - /// - /// @{ /// /// Opens a gridfs::downloader to read a GridFS file. /// @@ -481,12 +459,7 @@ class bucket { /// downloader open_download_stream(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id); - /// - /// @} - /// - /// - /// @{ /// /// Downloads the contents of a stored GridFS file from the bucket and writes it to a stream. /// @@ -559,12 +532,7 @@ class bucket { std::ostream* destination, std::size_t start, std::size_t end); - /// - /// @} - /// - /// - /// @{ /// /// Deletes a GridFS file from the bucket. /// @@ -593,12 +561,7 @@ class bucket { /// if an error occurs when removing file data or chunk data from the database. /// void delete_file(const client_session& session, bsoncxx::v_noabi::types::bson_value::view id); - /// - /// @} - /// - /// - /// @{ /// /// Finds the documents in the files collection of the bucket which match the provided filter. /// @@ -645,9 +608,6 @@ class bucket { cursor find(const client_session& session, bsoncxx::v_noabi::document::view_or_value filter, const options::find& options = {}); - /// - /// @} - /// /// /// Gets the name of the GridFS bucket. diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp index 23578e822c..1c74bd6ea0 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/hint.hpp @@ -53,19 +53,23 @@ class hint { explicit hint(bsoncxx::v_noabi::string::view_or_value index); /// - /// @{ + /// @relates mongocxx::v_noabi::hint /// - /// Compare this hint to a string for (in)-equality + /// Convenience methods to compare for equality against an index name. /// - /// @relates hint + /// Compares equal if the hint contains a matching index name. Otherwise, compares unequal. /// friend MONGOCXX_API bool MONGOCXX_CALL operator==(const hint& index_hint, std::string index); - friend MONGOCXX_API bool MONGOCXX_CALL operator==(const hint& index_hint, - bsoncxx::v_noabi::document::view index); /// - /// @} + /// @relates mongocxx::v_noabi::hint + /// + /// Convenience methods to compare for equality against an index document. + /// + /// Compares equal if the hint contains a matching index document. Otherwise, compares unequal. /// + friend MONGOCXX_API bool MONGOCXX_CALL operator==(const hint& index_hint, + bsoncxx::v_noabi::document::view index); /// /// Returns a types::bson_value::view representing this hint. @@ -91,54 +95,41 @@ class hint { }; /// -/// Convenience methods to compare for equality against an index name. +/// Convenience methods to compare against an index name. /// -/// Return true if this hint contains an index name that matches. -/// -/// @relates hint +/// Compares equal if the hint contains a matching index name. Otherwise, compares unequal. /// +/// @{ + +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator==(std::string index, const hint& index_hint); -/// -/// @{ -/// -/// Convenience methods to compare for inequality against an index name. -/// -/// Return true if this hint contains an index name that matches. -/// -/// @relates hint -/// +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator!=(const hint& index_hint, std::string index); + +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator!=(std::string index, const hint& index_index); -/// + /// @} /// /// /// Convenience methods to compare for equality against an index document. /// -/// Return true if this hint contains an index document that matches. -/// -/// @relates hint +/// Compares equal if the hint contains a matching index document. Otherwise, compares unequal. /// +/// @{ + +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator==(bsoncxx::v_noabi::document::view index, const hint& index_hint); - -/// -/// @{ -/// -/// Convenience methods to compare for equality against an index document. -/// -/// Return true if this hint contains an index document that matches. -/// -/// -/// @relates hint -/// +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator!=(const hint& index_hint, bsoncxx::v_noabi::document::view index); +/// @relatesalso mongocxx::v_noabi::hint MONGOCXX_API bool MONGOCXX_CALL operator!=(bsoncxx::v_noabi::document::view index, const hint& index_hint); -/// + /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp index 664f51d2f7..1521038881 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/index_view.hpp @@ -45,8 +45,6 @@ class index_view { index_view(const index_view&) = delete; index_view& operator=(const index_view&) = delete; - /// - /// @{ /// /// Returns a cursor over all the indexes. /// @@ -60,12 +58,6 @@ class index_view { /// cursor list(const client_session& session); - /// - /// @} - /// - - /// - /// @{ /// /// Creates an index. A convenience method that calls create_many. /// @@ -121,12 +113,6 @@ class index_view { const bsoncxx::v_noabi::document::view_or_value& index_options = {}, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Creates an index. A convenience method that calls create_many. /// @@ -173,12 +159,6 @@ class index_view { const index_model& index, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Adds a container of indexes to the collection. /// @@ -226,12 +206,6 @@ class index_view { const std::vector& indexes, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Drops a single index by name. /// @@ -273,12 +247,6 @@ class index_view { stdx::string_view name, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Attempts to drop a single index from the collection given the keys and options. /// @@ -336,12 +304,6 @@ class index_view { const bsoncxx::v_noabi::document::view_or_value& index_options = {}, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Attempts to drop a single index from the collection given an index model. /// @@ -389,12 +351,6 @@ class index_view { const index_model& index, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - - /// - /// @{ /// /// Drops all indexes in the collection. /// @@ -426,10 +382,6 @@ class index_view { void drop_all(const client_session& session, const options::index_view& options = options::index_view{}); - /// - /// @} - /// - private: friend ::mongocxx::v_noabi::collection; class MONGOCXX_PRIVATE impl; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp index 25d97db915..47b0fbbabd 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_many.hpp @@ -50,8 +50,6 @@ class update_many { }; public: - /// - /// @{ /// /// Constructs an update operation that will modify all documents matching the filter. /// @@ -84,10 +82,6 @@ class update_many { update_many(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update); - /// - /// @} - /// - /// /// Gets the filter. /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp index b852531b21..c0cc057c6d 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/update_one.hpp @@ -50,8 +50,6 @@ class update_one { }; public: - /// - /// @{ /// /// Constructs an update operation that will modify a single document matching the filter. /// @@ -84,10 +82,6 @@ class update_one { update_one(bsoncxx::v_noabi::document::view_or_value filter, std::initializer_list<_empty_doc_tag> update); - /// - /// @} - /// - /// /// Gets the filter /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp index dec208a7b9..e7fdc226e4 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_concern.hpp @@ -163,15 +163,13 @@ class read_concern { friend ::mongocxx::v_noabi::uri; /// - /// @{ + /// @relates mongocxx::v_noabi::read_concern /// /// Compares two read_concern objects for (in)-equality. /// - /// @relates: read_concern - /// + /// @{ friend MONGOCXX_API bool MONGOCXX_CALL operator==(const read_concern&, const read_concern&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const read_concern&, const read_concern&); - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp index cc6d63e581..1901a83df3 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/read_preference.hpp @@ -291,17 +291,15 @@ class read_preference { friend ::mongocxx::v_noabi::uri; /// - /// @{ + /// @relates mongocxx::v_noabi::read_preference /// /// Compares two read_preference objects for (in)-equality. /// - /// @relates: read_preference - /// + /// @{ friend MONGOCXX_API bool MONGOCXX_CALL operator==(const read_preference&, const read_preference&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const read_preference&, const read_preference&); - /// /// @} /// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp index 9f2d989607..cb0a2e26d2 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/search_index_view.hpp @@ -30,8 +30,6 @@ class search_index_view { ~search_index_view(); - /// - /// @{ /// /// Returns a cursor over all the search indexes. /// @@ -84,12 +82,6 @@ class search_index_view { bsoncxx::v_noabi::string::view_or_value name, const options::aggregate& options = options::aggregate()); - /// - /// @} - /// - - /// - /// @{ /// /// This is a convenience method for creating a single search index with a default name. /// @@ -164,12 +156,6 @@ class search_index_view { /// std::string create_one(const client_session& session, const search_index_model& model); - /// - /// @} - /// - - /// - /// @{ /// /// Creates multiple search indexes in the collection. /// @@ -193,12 +179,6 @@ class search_index_view { std::vector create_many(const client_session& session, const std::vector& models); - /// - /// @} - /// - - /// - /// @{ /// /// Drops a single search index from the collection by the index name. /// @@ -217,12 +197,6 @@ class search_index_view { /// void drop_one(const client_session& session, bsoncxx::v_noabi::string::view_or_value name); - /// - /// @} - /// - - /// - /// @{ /// /// Updates a single search index from the collection by the search index name. /// @@ -248,10 +222,6 @@ class search_index_view { bsoncxx::v_noabi::string::view_or_value name, bsoncxx::v_noabi::document::view_or_value definition); - /// - /// @} - /// - private: friend ::mongocxx::v_noabi::collection; diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp index 324c7eaf67..16f059c43a 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/write_concern.hpp @@ -253,15 +253,13 @@ class write_concern { friend ::mongocxx::v_noabi::uri; /// - /// @{ + /// @relates mongocxx::v_noabi::write_concern /// /// Compares two write_concern objects for (in)-equality. /// - /// @relates: write_concern - /// + /// @{ friend MONGOCXX_API bool MONGOCXX_CALL operator==(const write_concern&, const write_concern&); friend MONGOCXX_API bool MONGOCXX_CALL operator!=(const write_concern&, const write_concern&); - /// /// @} /// From 6194542344993dd700b26934c4e4105ca5847ca0 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 09:27:15 -0500 Subject: [PATCH 11/17] Relocate root-level documentation into root forward headers --- src/bsoncxx/include/bsoncxx/fwd.hpp | 5 +++++ .../bsoncxx/v_noabi/bsoncxx/config/prelude.hpp | 18 ------------------ .../include/bsoncxx/v_noabi/bsoncxx/fwd.hpp | 10 ++++++++++ src/mongocxx/include/mongocxx/fwd.hpp | 5 +++++ .../v_noabi/mongocxx/config/prelude.hpp | 13 ------------- .../include/mongocxx/v_noabi/mongocxx/fwd.hpp | 5 +++++ 6 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/bsoncxx/include/bsoncxx/fwd.hpp b/src/bsoncxx/include/bsoncxx/fwd.hpp index 7243e4b3a6..7f2e33e781 100644 --- a/src/bsoncxx/include/bsoncxx/fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/fwd.hpp @@ -15,3 +15,8 @@ // THIS FILE IS NOT INTENDED TO BE INCLUDABLE. #include // THIS FILE IS NOT INTENDED TO BE INCLUDABLE. + +/// +/// @namespace bsoncxx +/// The top-level namespace for bsoncxx library entities. +/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp index 9c4dd387dc..cbafb8e1df 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp @@ -120,21 +120,3 @@ // CXX-2769: out-of-place, but remains for backward compatibility. #pragma push_macro("BSONCXX_ENUM") #undef BSONCXX_ENUM - -// Doxygen does not account for generated header files. -// Document globally applicable macros and namespaces here. - -/// -/// @namespace bsoncxx -/// The top-level namespace for bsoncxx library entities. -/// - -/// -/// @namespace bsoncxx::v_noabi -/// Entities declared in this namespace do not have a stable ABI. -/// - -/// -/// @namespace bsoncxx::v_noabi::stdx -/// Declares polyfills for C++17 forward compatibility. -/// diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/fwd.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/fwd.hpp index e19ae26b47..3e8d100d49 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/fwd.hpp @@ -46,3 +46,13 @@ #include #include #include + +/// +/// @namespace bsoncxx::v_noabi +/// Entities declared in this namespace do not have a stable ABI. +/// + +/// +/// @namespace bsoncxx::v_noabi::stdx +/// Declares polyfills for C++17 forward compatibility. +/// diff --git a/src/mongocxx/include/mongocxx/fwd.hpp b/src/mongocxx/include/mongocxx/fwd.hpp index 75abc117aa..d7a8e164c9 100644 --- a/src/mongocxx/include/mongocxx/fwd.hpp +++ b/src/mongocxx/include/mongocxx/fwd.hpp @@ -15,3 +15,8 @@ // THIS FILE IS NOT INTENDED TO BE INCLUDABLE. #include // THIS FILE IS NOT INTENDED TO BE INCLUDABLE. + +/// +/// @namespace mongocxx +/// The top-level namespace for mongocxx library entities. +/// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp index 1f02a6c95d..7b25d75831 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp @@ -63,16 +63,3 @@ #pragma push_macro("MONGOCXX_UNREACHABLE") #undef MONGOCXX_UNREACHABLE #define MONGOCXX_UNREACHABLE std::abort() - -// Doxygen does not account for generated header files. -// Document globally applicable macros and namespaces here. - -/// -/// @namespace mongocxx -/// The top-level namespace for mongocxx library entities. -/// - -/// -/// @namespace mongocxx::v_noabi -/// Entities declared in this namespace do not have a stable ABI. -/// diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp index c4935dccce..a6701dcc92 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp @@ -111,3 +111,8 @@ #include #include #include + +/// +/// @namespace mongocxx::v_noabi +/// Entities declared in this namespace do not have a stable ABI. +/// From e2619bcd0547042b27414d8c6b0113d1f265da2c Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 14:43:07 -0500 Subject: [PATCH 12/17] Revert use of groups in mongocxx::v_noabi::client --- .../mongocxx/v_noabi/mongocxx/client.hpp | 87 +++++++++++++++---- 1 file changed, 72 insertions(+), 15 deletions(-) diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp index e8a561dfc5..9bb3e0fa31 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp @@ -218,9 +218,8 @@ class client { bsoncxx::v_noabi::string::view_or_value name) const&; MONGOCXX_INLINE mongocxx::v_noabi::database operator[]( bsoncxx::v_noabi::string::view_or_value name) const&& = delete; - /// - /// @brief Enumerates the databases in the client. + /// Enumerates the databases in the client. /// /// @return A mongocxx::v_noabi::cursor containing a BSON document for each /// database. Each document contains a name field with the database @@ -233,22 +232,48 @@ class client { /// /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases /// - /// @{ - cursor list_databases() const; + /// + /// Enumerates the databases in the client. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the aggregation. /// + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each + /// database. Each document contains a name field with the database + /// name, a sizeOnDisk field with the total size of the database file on + /// disk in bytes, and an empty field specifying whether the database + /// has any data. + /// + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. + /// + /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases + /// cursor list_databases(const client_session& session) const; + /// + /// Enumerates the databases in the client. /// /// @param opts /// Options passed directly to the 'listDatabases' command. /// + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each + /// database. Each document contains a name field with the database + /// name, a sizeOnDisk field with the total size of the database file on + /// disk in bytes, and an empty field specifying whether the database + /// has any data. + /// + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. + /// + /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases + /// cursor list_databases(const bsoncxx::v_noabi::document::view_or_value opts) const; + /// + /// Enumerates the databases in the client. /// /// @param session /// The mongocxx::v_noabi::client_session with which to perform the aggregation. @@ -256,14 +281,55 @@ class client { /// @param opts /// Options passed directly to the 'listDatabases' command. /// + /// @return A mongocxx::v_noabi::cursor containing a BSON document for each + /// database. Each document contains a name field with the database + /// name, a sizeOnDisk field with the total size of the database file on + /// disk in bytes, and an empty field specifying whether the database + /// has any data. + /// + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' command + /// fails. + /// + /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases + /// cursor list_databases(const client_session& session, const bsoncxx::v_noabi::document::view_or_value opts) const; - /// @} /// + /// Queries the MongoDB server for a list of known databases. + /// + /// @param filter + /// An optional query expression to filter the returned database names. + /// + /// @return std::vector containing the database names. + /// + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' + /// command fails. + /// + /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases + /// + std::vector list_database_names( + const bsoncxx::v_noabi::document::view_or_value filter = {}) const; /// - /// @{ + /// Queries the MongoDB server for a list of known databases. + /// + /// @param session + /// The mongocxx::v_noabi::client_session with which to perform the aggregation. + /// + /// @param filter + /// An optional query expression to filter the returned database names. + /// + /// @return std::vector containing the database names. + /// + /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' + /// command fails. + /// + /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases + /// + std::vector list_database_names( + const client_session& session, + const bsoncxx::v_noabi::document::view_or_value filter = {}) const; /// /// Queries the MongoDB server for a list of known databases. @@ -301,9 +367,6 @@ class client { const client_session& session, const bsoncxx::v_noabi::document::view_or_value filter = {}) const; - /// @} - /// - /// /// Create a client session for a sequence of operations. /// @@ -316,9 +379,6 @@ class client { /// client_session start_session(const options::client_session& options = {}); - /// - /// @{ - /// /// Get a change stream on this client with an empty pipeline. /// @@ -391,9 +451,6 @@ class client { const pipeline& pipe, const options::change_stream& options = {}); - /// @} - /// - /// /// Prevents resource cleanup in the child process from interfering /// with the parent process after forking. From c22263bf8c8d7729e4b657be068199168ae63f52 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Wed, 17 Jul 2024 14:50:17 -0500 Subject: [PATCH 13/17] Fix copy-paste error in e2619bcd05 --- .../mongocxx/v_noabi/mongocxx/client.hpp | 36 ------------------- 1 file changed, 36 deletions(-) diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp index 9bb3e0fa31..0c099055ff 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/client.hpp @@ -331,42 +331,6 @@ class client { const client_session& session, const bsoncxx::v_noabi::document::view_or_value filter = {}) const; - /// - /// Queries the MongoDB server for a list of known databases. - /// - /// @param filter - /// An optional query expression to filter the returned database names. - /// - /// @return std::vector containing the database names. - /// - /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' - /// command fails. - /// - /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases - /// - - std::vector list_database_names( - const bsoncxx::v_noabi::document::view_or_value filter = {}) const; - - /// - /// Queries the MongoDB server for a list of known databases. - /// - /// @param session - /// The mongocxx::v_noabi::client_session with which to perform the aggregation. - /// @param filter - /// An optional query expression to filter the returned database names. - /// - /// @return std::vector containing the database names. - /// - /// @throws mongocxx::v_noabi::operation_exception if the underlying 'listDatabases' - /// command fails. - /// - /// @see https://www.mongodb.com/docs/manual/reference/command/listDatabases - /// - std::vector list_database_names( - const client_session& session, - const bsoncxx::v_noabi::document::view_or_value filter = {}) const; - /// /// Create a client session for a sequence of operations. /// From 2dbc5eb02f4e8ec285af63800ec67ccad4c85fe5 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Thu, 18 Jul 2024 16:34:26 -0500 Subject: [PATCH 14/17] Make root fwd.hpp error on inclusion --- src/bsoncxx/include/bsoncxx/fwd.hpp | 6 +++--- src/bsoncxx/lib/bsoncxx/fwd.cpp | 3 ++- src/mongocxx/include/mongocxx/fwd.hpp | 6 +++--- src/mongocxx/lib/mongocxx/fwd.cpp | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/bsoncxx/include/bsoncxx/fwd.hpp b/src/bsoncxx/include/bsoncxx/fwd.hpp index 7f2e33e781..797d21a163 100644 --- a/src/bsoncxx/include/bsoncxx/fwd.hpp +++ b/src/bsoncxx/include/bsoncxx/fwd.hpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. -#include -// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. +#if !defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) +#error "This file is for documentation purposes only. It should not be included." +#endif // !defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) /// /// @namespace bsoncxx diff --git a/src/bsoncxx/lib/bsoncxx/fwd.cpp b/src/bsoncxx/lib/bsoncxx/fwd.cpp index 382cd6d018..e480b60905 100644 --- a/src/bsoncxx/lib/bsoncxx/fwd.cpp +++ b/src/bsoncxx/lib/bsoncxx/fwd.cpp @@ -12,4 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include // +// Validate that is included, not . +#include diff --git a/src/mongocxx/include/mongocxx/fwd.hpp b/src/mongocxx/include/mongocxx/fwd.hpp index d7a8e164c9..64a4196b1f 100644 --- a/src/mongocxx/include/mongocxx/fwd.hpp +++ b/src/mongocxx/include/mongocxx/fwd.hpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. -#include -// THIS FILE IS NOT INTENDED TO BE INCLUDABLE. +#if !defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR) +#error "This file is for documentation purposes only. It should not be included." +#endif // !defined(MONGOCXX_PRIVATE_DOXYGEN_PREPROCESSOR) /// /// @namespace mongocxx diff --git a/src/mongocxx/lib/mongocxx/fwd.cpp b/src/mongocxx/lib/mongocxx/fwd.cpp index 635448687c..b14d35fc0c 100644 --- a/src/mongocxx/lib/mongocxx/fwd.cpp +++ b/src/mongocxx/lib/mongocxx/fwd.cpp @@ -12,4 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include // +// Validate that is included, not . +#include From 6e4a737d4a83c8fc44df20a55c2a5d7489649830 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Thu, 18 Jul 2024 16:34:26 -0500 Subject: [PATCH 15/17] Promote doc-only declarations to inline definitions --- .../include/bsoncxx/v_noabi/bsoncxx/types.hpp | 97 ++++++++++++------- 1 file changed, 63 insertions(+), 34 deletions(-) diff --git a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types.hpp b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types.hpp index a2f74df22c..950fc4c0c7 100644 --- a/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types.hpp +++ b/src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/types.hpp @@ -663,165 +663,194 @@ BSONCXX_INLINE bool operator==(const b_maxkey&, const b_maxkey&) { return true; } -#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) - /// /// @relatesalso bsoncxx::v_noabi::types::b_double /// /// free function comparator for b_double /// -bool operator!=(const b_double& lhs, const b_double& rhs); +inline bool operator!=(const b_double& lhs, const b_double& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_string /// /// free function comparator for b_string /// -bool operator!=(const b_string& lhs, const b_string& rhs); +inline bool operator!=(const b_string& lhs, const b_string& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_document /// /// free function comparator for b_document /// -bool operator!=(const b_document& lhs, const b_document& rhs); +inline bool operator!=(const b_document& lhs, const b_document& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_array /// /// free function comparator for b_array /// -bool operator!=(const b_array& lhs, const b_array& rhs); +inline bool operator!=(const b_array& lhs, const b_array& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_binary /// /// free function comparator for b_binary /// -bool operator!=(const b_binary& lhs, const b_binary& rhs); +inline bool operator!=(const b_binary& lhs, const b_binary& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_undefined /// /// free function comparator for b_undefined /// -bool operator!=(const b_undefined&, const b_undefined&); +inline bool operator!=(const b_undefined& lhs, const b_undefined& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_oid /// /// free function comparator for b_oid /// -bool operator!=(const b_oid& lhs, const b_oid& rhs); +inline bool operator!=(const b_oid& lhs, const b_oid& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_bool /// /// free function comparator for b_bool /// -bool operator!=(const b_bool& lhs, const b_bool& rhs); +inline bool operator!=(const b_bool& lhs, const b_bool& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_date /// /// free function comparator for b_date /// -bool operator!=(const b_date& lhs, const b_date& rhs); +inline bool operator!=(const b_date& lhs, const b_date& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_null /// /// free function comparator for b_null /// -bool operator!=(const b_null&, const b_null&); +inline bool operator!=(const b_null& lhs, const b_null& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_regex /// /// free function comparator for b_regex /// -bool operator!=(const b_regex& lhs, const b_regex& rhs); +inline bool operator!=(const b_regex& lhs, const b_regex& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_dbpointer /// /// free function comparator for b_dbpointer /// -bool operator!=(const b_dbpointer& lhs, const b_dbpointer& rhs); +inline bool operator!=(const b_dbpointer& lhs, const b_dbpointer& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_code /// /// free function comparator for b_code /// -bool operator!=(const b_code& lhs, const b_code& rhs); +inline bool operator!=(const b_code& lhs, const b_code& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_symbol /// /// free function comparator for b_symbol /// -bool operator!=(const b_symbol& lhs, const b_symbol& rhs); +inline bool operator!=(const b_symbol& lhs, const b_symbol& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_codewscope /// /// free function comparator for b_codewscope /// -bool operator!=(const b_codewscope& lhs, const b_codewscope& rhs); +inline bool operator!=(const b_codewscope& lhs, const b_codewscope& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_int32 /// /// free function comparator for b_int32 /// -bool operator!=(const b_int32& lhs, const b_int32& rhs); +inline bool operator!=(const b_int32& lhs, const b_int32& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_timestamp /// /// free function comparator for b_timestamp /// -bool operator!=(const b_timestamp& lhs, const b_timestamp& rhs); +inline bool operator!=(const b_timestamp& lhs, const b_timestamp& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_int64 /// /// free function comparator for b_int64 /// -bool operator!=(const b_int64& lhs, const b_int64& rhs); +inline bool operator!=(const b_int64& lhs, const b_int64& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_decimal128 /// /// free function comparator for b_decimal128 /// -bool operator!=(const b_decimal128& lhs, const b_decimal128& rhs); +inline bool operator!=(const b_decimal128& lhs, const b_decimal128& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_minkey /// /// free function comparator for b_minkey /// -bool operator!=(const b_minkey&, const b_minkey&); +inline bool operator!=(const b_minkey& lhs, const b_minkey& rhs) { + return !(lhs == rhs); +} /// /// @relatesalso bsoncxx::v_noabi::types::b_maxkey /// /// free function comparator for b_maxkey /// -bool operator!=(const b_maxkey&, const b_maxkey&); - -#else - -#define BSONCXX_ENUM(name, val) \ - BSONCXX_INLINE bool operator!=(const b_##name& lhs, const b_##name& rhs) { \ - return !(lhs == rhs); \ - } -#include -#undef BSONCXX_ENUM - -#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR) +inline bool operator!=(const b_maxkey& lhs, const b_maxkey& rhs) { + return !(lhs == rhs); +} } // namespace types } // namespace v_noabi From e7a8e4f36f1b1b68ece05d124e08d87e630755d8 Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Fri, 19 Jul 2024 10:23:11 -0500 Subject: [PATCH 16/17] Update docs with order-dependent language --- src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp index e67ebbb473..b8efca1222 100644 --- a/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp +++ b/src/mongocxx/include/mongocxx/v_noabi/mongocxx/model/write.hpp @@ -87,8 +87,7 @@ class write { ~write(); /// - /// Returns the current type of this write. You must call this - /// method before calling any of the get methods below. + /// Returns the current type of this write. /// write_type type() const; From f0dbd18380e9102b23add7cdde44da6ba249313d Mon Sep 17 00:00:00 2001 From: Ezra Chung Date: Fri, 19 Jul 2024 10:55:25 -0500 Subject: [PATCH 17/17] Add new implementation files to source dist list --- src/bsoncxx/lib/CMakeLists.txt | 1 + src/mongocxx/lib/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/bsoncxx/lib/CMakeLists.txt b/src/bsoncxx/lib/CMakeLists.txt index 2fc71189a8..f2ac5b00ff 100644 --- a/src/bsoncxx/lib/CMakeLists.txt +++ b/src/bsoncxx/lib/CMakeLists.txt @@ -71,6 +71,7 @@ endif() set_dist_list(src_bsoncxx_lib_DIST CMakeLists.txt ${bsoncxx_sources_v_noabi} + bsoncxx/fwd.cpp bsoncxx/v_noabi/bsoncxx/config/config.hpp.in bsoncxx/v_noabi/bsoncxx/config/private/config.hh.in bsoncxx/v_noabi/bsoncxx/config/private/postlude.hh diff --git a/src/mongocxx/lib/CMakeLists.txt b/src/mongocxx/lib/CMakeLists.txt index 6bbd5485a1..a7fbada786 100644 --- a/src/mongocxx/lib/CMakeLists.txt +++ b/src/mongocxx/lib/CMakeLists.txt @@ -159,6 +159,7 @@ endif() set_dist_list(src_mongocxx_lib_DIST CMakeLists.txt ${mongocxx_sources_v_noabi} + mongocxx/fwd.cpp mongocxx/v_noabi/mongocxx/config/config.hpp.in mongocxx/v_noabi/mongocxx/config/private/config.hh.in mongocxx/v_noabi/mongocxx/config/private/postlude.hh