#include <bsoncxx/v1/types/view.hpp>
A non-owning, read-only union of BSON type values.
Public Types | |
| enum class | errc |
| Errors codes which may be returned by bsoncxx::v1::types::view. More... | |
Public Member Functions | |
| view () | |
| Initialize with bsoncxx::v1::types::b_null. | |
| id | type_id () const |
| Return the type of the underlying BSON type value. | |
| view (b_minkey v) | |
| Implicitly convert v. | |
| view (b_double v) | |
| Implicitly convert v. | |
| view (b_string v) | |
| Implicitly convert v. | |
| view (b_document v) | |
| Implicitly convert v. | |
| view (b_array v) | |
| Implicitly convert v. | |
| view (b_binary v) | |
| Implicitly convert v. | |
| view (b_undefined v) | |
| Implicitly convert v. | |
| view (b_oid v) | |
| Implicitly convert v. | |
| view (b_bool v) | |
| Implicitly convert v. | |
| view (b_date v) | |
| Implicitly convert v. | |
| view (b_null v) | |
| Implicitly convert v. | |
| view (b_regex v) | |
| Implicitly convert v. | |
| view (b_dbpointer v) | |
| Implicitly convert v. | |
| view (b_code v) | |
| Implicitly convert v. | |
| view (b_symbol v) | |
| Implicitly convert v. | |
| view (b_codewscope v) | |
| Implicitly convert v. | |
| view (b_int32 v) | |
| Implicitly convert v. | |
| view (b_timestamp v) | |
| Implicitly convert v. | |
| view (b_int64 v) | |
| Implicitly convert v. | |
| view (b_decimal128 v) | |
| Implicitly convert v. | |
| view (b_maxkey v) | |
| Implicitly convert v. | |
| b_minkey | get_minkey () const |
| Return the requested underlying BSON type value. | |
| b_double | get_double () const |
| Return the requested underlying BSON type value. | |
| b_string | get_string () const |
| Return the requested underlying BSON type value. | |
| b_document | get_document () const |
| Return the requested underlying BSON type value. | |
| b_array | get_array () const |
| Return the requested underlying BSON type value. | |
| b_binary | get_binary () const |
| Return the requested underlying BSON type value. | |
| b_undefined | get_undefined () const |
| Return the requested underlying BSON type value. | |
| b_oid | get_oid () const |
| Return the requested underlying BSON type value. | |
| b_bool | get_bool () const |
| Return the requested underlying BSON type value. | |
| b_date | get_date () const |
| Return the requested underlying BSON type value. | |
| b_null | get_null () const |
| Return the requested underlying BSON type value. | |
| b_regex | get_regex () const |
| Return the requested underlying BSON type value. | |
| b_dbpointer | get_dbpointer () const |
| Return the requested underlying BSON type value. | |
| b_code | get_code () const |
| Return the requested underlying BSON type value. | |
| b_symbol | get_symbol () const |
| Return the requested underlying BSON type value. | |
| b_codewscope | get_codewscope () const |
| Return the requested underlying BSON type value. | |
| b_int32 | get_int32 () const |
| Return the requested underlying BSON type value. | |
| b_timestamp | get_timestamp () const |
| Return the requested underlying BSON type value. | |
| b_int64 | get_int64 () const |
| Return the requested underlying BSON type value. | |
| b_decimal128 | get_decimal128 () const |
| Return the requested underlying BSON type value. | |
| b_maxkey | get_maxkey () const |
| Return the requested underlying BSON type value. | |
Static Public Member Functions | |
| static std::error_category const & | error_category () |
| The error category for bsoncxx::v1::types::view::errc. | |
Friends | |
| std::error_code | make_error_code (errc v) |
| Support implicit conversion to std::error_code. | |
| bool | operator!= (view const &lhs, view const &rhs) |
| Equivalent to !(lhs == rhs). | |
| bool | operator== (view const &lhs, view const &rhs) |
| Compare equal when the underlying BSON type values have the same type and compare equal. | |
| bool | operator== (view const &v, v1::element::view const &e) |
| Equivalent to v == e.type_view(). | |
| bool | operator== (v1::element::view const &e, view const &v) |
| Equivalent to v == e.type_view(). | |
| bool | operator!= (view const &v, v1::element::view const &e) |
| Equivalent to !(v == e). | |
| bool | operator!= (v1::element::view const &e, view const &v) |
| Equivalent to !(v == e). | |
| template<typename T, detail::enable_if_t< is_equality_comparable_with< T >::value > * = nullptr> | |
| bool | operator== (view const &v, T const &value) |
| Equivalent to v == bsoncxx::v1::types::view{value}. | |
| template<typename T, detail::enable_if_t< is_equality_comparable_with< T >::value > * = nullptr> | |
| bool | operator== (T const &value, view const &v) |
| Equivalent to v == bsoncxx::v1::types::view{value}. | |
| template<typename T, detail::enable_if_t< is_equality_comparable_with< T >::value > * = nullptr> | |
| bool | operator!= (view const &v, T const &value) |
| Equivalent to !(v == value). | |
| template<typename T, detail::enable_if_t< is_equality_comparable_with< T >::value > * = nullptr> | |
| bool | operator!= (T const &value, view const &v) |
| Equivalent to !(v == value). | |
|
strong |
Errors codes which may be returned by bsoncxx::v1::types::view.
| Enumerator | |
|---|---|
| zero | Zero. |
| type_mismatch | Requested type does not match the underlying type. |
|
inline |
Initialize with bsoncxx::v1::types::b_null.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
inline |
Implicitly convert v.
|
static |
The error category for bsoncxx::v1::types::view::errc.
| b_array bsoncxx::v1::types::view::get_array | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_binary bsoncxx::v1::types::view::get_binary | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_bool bsoncxx::v1::types::view::get_bool | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_code bsoncxx::v1::types::view::get_code | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_codewscope bsoncxx::v1::types::view::get_codewscope | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_date bsoncxx::v1::types::view::get_date | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_dbpointer bsoncxx::v1::types::view::get_dbpointer | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_decimal128 bsoncxx::v1::types::view::get_decimal128 | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_document bsoncxx::v1::types::view::get_document | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_double bsoncxx::v1::types::view::get_double | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_int32 bsoncxx::v1::types::view::get_int32 | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_int64 bsoncxx::v1::types::view::get_int64 | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_maxkey bsoncxx::v1::types::view::get_maxkey | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_minkey bsoncxx::v1::types::view::get_minkey | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_null bsoncxx::v1::types::view::get_null | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_oid bsoncxx::v1::types::view::get_oid | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_regex bsoncxx::v1::types::view::get_regex | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_string bsoncxx::v1::types::view::get_string | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_symbol bsoncxx::v1::types::view::get_symbol | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_timestamp bsoncxx::v1::types::view::get_timestamp | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
| b_undefined bsoncxx::v1::types::view::get_undefined | ( | ) | const |
Return the requested underlying BSON type value.
| bsoncxx::v1::exception | with bsoncxx::v1::types::view::errc::type_mismatch if the underlying BSON type value does not match the requested type. |
|
inline |
Return the type of the underlying BSON type value.
|
friend |
Support implicit conversion to std::error_code.
|
friend |
Equivalent to !(v == value).
|
friend |
Equivalent to !(v == e).
|
friend |
Equivalent to !(v == value).
|
friend |
Equivalent to !(v == e).
|
friend |
Equivalent to v == bsoncxx::v1::types::view{value}.
|
friend |
Equivalent to v == e.type_view().
Compare equal when the underlying BSON type values have the same type and compare equal.
Equivalent to:
where get_type is the correct name for the underlying BSON type values (e.g. get_double() when type_id() == bsoncxx::v1::types::id::k_double).
When either lhs.type_id() or rhs.type_id() return an unsupported value (not defined by bsoncxx::v1::types::id or handled by BSONCXX_V1_TYPES_XMACRO), the result is unspecified.
|
friend |
Equivalent to v == bsoncxx::v1::types::view{value}.
|
friend |
Equivalent to v == e.type_view().