Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE = src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/operators.hpp \
src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/type_traits.hpp
EXCLUDE =

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
Expand Down Expand Up @@ -938,7 +937,7 @@ EXCLUDE_SYMBOLS = bsoncxx::detail \
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH = .
EXAMPLE_PATH = examples

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::element;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Declares @ref bsoncxx::v_noabi::array::element.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace array {

/// @ref bsoncxx::v_noabi::array::element
class element {};

} // namespace array
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
27 changes: 27 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,30 @@ using ::bsoncxx::v_noabi::array::operator!=;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::array::element.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace array {

/// @ref bsoncxx::v_noabi::array::operator==(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v)
bool operator==(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v);

/// @ref bsoncxx::v_noabi::array::operator==(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem)
bool operator==(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem);

/// @ref bsoncxx::v_noabi::array::operator!=(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v)
bool operator!=(const v_noabi::array::element& elem, const v_noabi::types::bson_value::view& v);

/// @ref bsoncxx::v_noabi::array::operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem)
bool operator!=(const v_noabi::types::bson_value::view& v, const v_noabi::array::element& elem);

} // namespace array
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
18 changes: 18 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value-fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::value;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Declares @ref bsoncxx::v_noabi::array::value.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace array {

/// @ref bsoncxx::v_noabi::array::value
class value {};

} // namespace array
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
5 changes: 5 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,8 @@ BSONCXX_INLINE value::operator array::view() const noexcept {
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::array::value.
///
18 changes: 18 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view-fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,21 @@ using ::bsoncxx::v_noabi::array::view;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Declares @ref bsoncxx::v_noabi::array::view.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace array {

/// @ref bsoncxx::v_noabi::array::view
class view {};

} // namespace array
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
5 changes: 5 additions & 0 deletions src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/array/view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,8 @@ class view::const_iterator {
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::array::view.
///
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,21 @@ using ::bsoncxx::v_noabi::array::view_or_value;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::array::view_or_value.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace array {

/// @ref bsoncxx::v_noabi::array::view_or_value
class view_or_value {};

} // namespace array
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::array;
} // namespace basic
} // namespace builder
} // namespace bsoncxx

///
/// @file
/// Declares @ref bsoncxx::v_noabi::builder::basic::array.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::array
class array {};

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,24 @@ using ::bsoncxx::v_noabi::builder::basic::make_array;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::builder::basic::array.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::make_array
template <typename... Args>
v_noabi::array::value make_array(Args&&... args);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: Is mixing ABI namespace and root namespace discouraged?

// Do this:
bsoncxx::foo f = bsoncxx::get_foo();
// Or even better:
auto f = bsoncxx::get_foo();
// Not this:
bsoncxx::v_noabi::foo f = bsoncxx::get_foo();

I expect using the root namespace helps avoid source code changes on ABI incompatible (but API compatible) driver changes. However, mixing may result in more needed source code changes (e.g. if bsoncxx::get_foo() later defined to return bsoncxx::v1::foo).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is mixing ABI namespace and root namespace discouraged?

Yes, for the reason you described regarding bsoncxx::get_foo() returning bsoncxx::v1::foo.

However, old ABI namespace interfaces are expected to provide conversion functions to/from the new ABI namespace interfaces, which will assist with incremental migration across ABI namespaces. This is already being implemented for CXX-2745.

// OK: implicit conversion from `v1::foo` to `v_noabi::foo`
// as defined by `v_noabi::foo` (implicit constructor).
v_noabi::foo f = v1::get_foo();

// OK: explicit conversion from `v1::foo` to `v_noabi::foo`
// via the `v_noabi` conversion function.
v_noabi::foo f = v_noabi::from_v1(v1::get_foo());

// error: from v1 to what? (ADL not supported.)
v_noabi::foo f = from_v1(v1::get_foo());

// error: conversion from `v_noabi::foo` to `v1::foo`
// must be explicit (one-way implicit conversions).
v1::foo f = v_noabi::get_foo();

// OK: explicit forward-compatibility via conversion function.
v1::foo f = v_noabi::to_v1(v_noabi::get_foo());

// OK: same as above, but found via ADL.
v1::foo f = to_v1(v_noabi::get_foo());

The (implicit) conversions will of course come with a performance cost, so relying on them too much is not recommended. However, this will faciliate incremental migration from vA to vB both in user code and in internal code.


} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::document;
} // namespace basic
} // namespace builder
} // namespace bsoncxx

///
/// @file
/// Declares @ref bsoncxx::v_noabi::builder::basic::document.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::document
class document {};

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,24 @@ using ::bsoncxx::v_noabi::builder::basic::make_document;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::builder::basic::document.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::make_document
template <typename... Args>
v_noabi::document::value make_document(Args&&... args);

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,26 @@ using ::bsoncxx::v_noabi::builder::basic::concatenate;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Redeclares @ref bsoncxx::v_noabi::builder::concatenate in the @ref
/// bsoncxx::v_noabi::builder::basic namespace.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::concatenate(v_noabi::document::view_or_value doc)
/// @note An overload accepting @ref v_noabi::array::view_or_value and returning a @ref
/// v_noabi::builder::concatenate_array is also declared in this scope.
v_noabi::concatenate_doc concatenate(v_noabi::document::view_or_value doc);

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ BSONCXX_INLINE void value_append(core* core, T&& t) {
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// For internal use only!
///
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,24 @@ using ::bsoncxx::v_noabi::builder::basic::kvp;
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Declares @ref bsoncxx::v_noabi::builder::basic::kvp.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::kvp
template <typename T, typename U>
std::tuple<T&&, U&&> kvp(T&& t, U&& u);

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::sub_array;
} // namespace basic
} // namespace builder
} // namespace bsoncxx

///
/// @file
/// Declares @ref bsoncxx::v_noabi::builder::basic::sub_array.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::sub_array
class sub_array {};

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,8 @@ class sub_array {
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::builder::basic::sub_array.
///
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ using ::bsoncxx::v_noabi::builder::basic::sub_document;
} // namespace basic
} // namespace builder
} // namespace bsoncxx

///
/// @file
/// Declares @ref bsoncxx::v_noabi::builder::basic::sub_document.
///

#if defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)

namespace bsoncxx {
namespace builder {
namespace basic {

/// @ref bsoncxx::v_noabi::builder::basic::sub_document
class sub_document {};

} // namespace basic
} // namespace builder
} // namespace bsoncxx

#endif // defined(BSONCXX_PRIVATE_DOXYGEN_PREPROCESSOR)
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ class sub_document {
} // namespace bsoncxx

#include <bsoncxx/config/postlude.hpp>

///
/// @file
/// Provides @ref bsoncxx::v_noabi::builder::basic::sub_document.
///
Loading