#include <bsoncxx/v1/types/view.hpp>
A non-owning, read-only union of BSON type values.
- Note
- This class only represents the value of a BSON element without its key. bsoncxx::v1::element::view represents a BSON element including its key.
|
| 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).
|
◆ errc
Errors codes which may be returned by bsoncxx::v1::types::view.
| Enumerator |
|---|
| zero | Zero.
|
| type_mismatch | Requested type does not match the underlying type.
|
◆ view() [1/22]
| bsoncxx::v1::types::view::view |
( |
| ) |
|
|
inline |
◆ view() [2/22]
| bsoncxx::v1::types::view::view |
( |
b_minkey | v | ) |
|
|
inline |
◆ view() [3/22]
| bsoncxx::v1::types::view::view |
( |
b_double | v | ) |
|
|
inline |
◆ view() [4/22]
| bsoncxx::v1::types::view::view |
( |
b_string | v | ) |
|
|
inline |
◆ view() [5/22]
◆ view() [6/22]
| bsoncxx::v1::types::view::view |
( |
b_array | v | ) |
|
|
inline |
◆ view() [7/22]
| bsoncxx::v1::types::view::view |
( |
b_binary | v | ) |
|
|
inline |
◆ view() [8/22]
◆ view() [9/22]
| bsoncxx::v1::types::view::view |
( |
b_oid | v | ) |
|
|
inline |
◆ view() [10/22]
| bsoncxx::v1::types::view::view |
( |
b_bool | v | ) |
|
|
inline |
◆ view() [11/22]
| bsoncxx::v1::types::view::view |
( |
b_date | v | ) |
|
|
inline |
◆ view() [12/22]
| bsoncxx::v1::types::view::view |
( |
b_null | v | ) |
|
|
inline |
◆ view() [13/22]
| bsoncxx::v1::types::view::view |
( |
b_regex | v | ) |
|
|
inline |
◆ view() [14/22]
◆ view() [15/22]
| bsoncxx::v1::types::view::view |
( |
b_code | v | ) |
|
|
inline |
◆ view() [16/22]
| bsoncxx::v1::types::view::view |
( |
b_symbol | v | ) |
|
|
inline |
◆ view() [17/22]
◆ view() [18/22]
| bsoncxx::v1::types::view::view |
( |
b_int32 | v | ) |
|
|
inline |
◆ view() [19/22]
◆ view() [20/22]
| bsoncxx::v1::types::view::view |
( |
b_int64 | v | ) |
|
|
inline |
◆ view() [21/22]
◆ view() [22/22]
| bsoncxx::v1::types::view::view |
( |
b_maxkey | v | ) |
|
|
inline |
◆ error_category()
| std::error_category const & bsoncxx::v1::types::view::error_category |
( |
| ) |
|
|
static |
◆ get_array()
| b_array bsoncxx::v1::types::view::get_array |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_binary()
| b_binary bsoncxx::v1::types::view::get_binary |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_bool()
| b_bool bsoncxx::v1::types::view::get_bool |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_code()
| b_code bsoncxx::v1::types::view::get_code |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_codewscope()
| b_codewscope bsoncxx::v1::types::view::get_codewscope |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_date()
| b_date bsoncxx::v1::types::view::get_date |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_dbpointer()
| b_dbpointer bsoncxx::v1::types::view::get_dbpointer |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_decimal128()
| b_decimal128 bsoncxx::v1::types::view::get_decimal128 |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_document()
| b_document bsoncxx::v1::types::view::get_document |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_double()
| b_double bsoncxx::v1::types::view::get_double |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_int32()
| b_int32 bsoncxx::v1::types::view::get_int32 |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_int64()
| b_int64 bsoncxx::v1::types::view::get_int64 |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_maxkey()
| b_maxkey bsoncxx::v1::types::view::get_maxkey |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_minkey()
| b_minkey bsoncxx::v1::types::view::get_minkey |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_null()
| b_null bsoncxx::v1::types::view::get_null |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_oid()
| b_oid bsoncxx::v1::types::view::get_oid |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_regex()
| b_regex bsoncxx::v1::types::view::get_regex |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_string()
| b_string bsoncxx::v1::types::view::get_string |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_symbol()
| b_symbol bsoncxx::v1::types::view::get_symbol |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_timestamp()
| b_timestamp bsoncxx::v1::types::view::get_timestamp |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ get_undefined()
| b_undefined bsoncxx::v1::types::view::get_undefined |
( |
| ) |
const |
Return the requested underlying BSON type value.
- Exceptions
-
◆ type_id()
| id bsoncxx::v1::types::view::type_id |
( |
| ) |
const |
|
inline |
Return the type of the underlying BSON type value.
◆ make_error_code
| std::error_code make_error_code |
( |
errc | v | ) |
|
|
friend |
Support implicit conversion to std::error_code.
◆ operator!= [1/5]
template<typename T, detail::enable_if_t< is_equality_comparable_with< T >
::value > * = nullptr>
| bool operator!= |
( |
T const & | value, |
|
|
view const & | v ) |
|
friend |
Equivalent to !(v == value).
◆ operator!= [2/5]
◆ operator!= [3/5]
| bool operator!= |
( |
view const & | lhs, |
|
|
view const & | rhs ) |
|
friend |
Equivalent to !(lhs == rhs).
◆ operator!= [4/5]
template<typename T, detail::enable_if_t< is_equality_comparable_with< T >
::value > * = nullptr>
| bool operator!= |
( |
view const & | v, |
|
|
T const & | value ) |
|
friend |
Equivalent to !(v == value).
◆ operator!= [5/5]
◆ operator== [1/5]
template<typename T, detail::enable_if_t< is_equality_comparable_with< T >
::value > * = nullptr>
| bool operator== |
( |
T const & | value, |
|
|
view const & | v ) |
|
friend |
◆ operator== [2/5]
Equivalent to v == e.type_view().
◆ operator== [3/5]
| bool operator== |
( |
view const & | lhs, |
|
|
view const & | rhs ) |
|
friend |
Compare equal when the underlying BSON type values have the same type and compare equal.
Equivalent to:
lhs.type_id() == rhs.type_id() && lhs.get_type() == rhs.get_type()
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.
◆ operator== [4/5]
template<typename T, detail::enable_if_t< is_equality_comparable_with< T >
::value > * = nullptr>
| bool operator== |
( |
view const & | v, |
|
|
T const & | value ) |
|
friend |
◆ operator== [5/5]
Equivalent to v == e.type_view().
The documentation for this class was generated from the following file: