MongoDB C++ Driver mongocxx-3.6.7
Public Member Functions | List of all members
bsoncxx::types::bson_value::view Class Reference

A view-only variant that can contain any BSON type. More...

#include <view.hpp>

Public Member Functions

 view () noexcept
 Default constructs a bson_value::view. More...
 
bsoncxx::type type () const
 
const b_doubleget_double () const
 
const b_utf8get_utf8 () const
 
const b_documentget_document () const
 
const b_arrayget_array () const
 
const b_binaryget_binary () const
 
const b_undefinedget_undefined () const
 
const b_oidget_oid () const
 
const b_boolget_bool () const
 
const b_dateget_date () const
 
const b_nullget_null () const
 
const b_regexget_regex () const
 
const b_dbpointerget_dbpointer () const
 
const b_codeget_code () const
 
const b_symbolget_symbol () const
 
const b_codewscopeget_codewscope () const
 
const b_int32get_int32 () const
 
const b_timestampget_timestamp () const
 
const b_int64get_int64 () const
 
const b_decimal128get_decimal128 () const
 
const b_minkeyget_minkey () const
 
const b_maxkeyget_maxkey () const
 
bool operator!= (const bson_value::view &, const bson_value::view &)
 Compare two bson_value::views for equality.
 
bool operator== (const bson_value::view &, const bson_value::view &)
 Compare two bson_value::views for equality.
 

Detailed Description

A view-only variant that can contain any BSON type.

Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

Constructor & Destructor Documentation

◆ view()

bsoncxx::types::bson_value::view::view ( )
noexcept

Default constructs a bson_value::view.

The resulting view will be initialized to point at a bson_value of type k_null.

Member Function Documentation

◆ get_array()

const b_array & bsoncxx::types::bson_value::view::get_array ( ) const
Returns
The underlying BSON array value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_binary()

const b_binary & bsoncxx::types::bson_value::view::get_binary ( ) const
Returns
The underlying BSON binary data value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_bool()

const b_bool & bsoncxx::types::bson_value::view::get_bool ( ) const
Returns
The underlying BSON boolean value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_code()

const b_code & bsoncxx::types::bson_value::view::get_code ( ) const
Returns
The underlying BSON JavaScript code value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_codewscope()

const b_codewscope & bsoncxx::types::bson_value::view::get_codewscope ( ) const
Returns
The underlying BSON JavaScript code with scope value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_date()

const b_date & bsoncxx::types::bson_value::view::get_date ( ) const
Returns
The underlying BSON date value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_dbpointer()

const b_dbpointer & bsoncxx::types::bson_value::view::get_dbpointer ( ) const
Returns
The underlying BSON DBPointer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_decimal128()

const b_decimal128 & bsoncxx::types::bson_value::view::get_decimal128 ( ) const
Returns
The underlying BSON Decimal128 value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_document()

const b_document & bsoncxx::types::bson_value::view::get_document ( ) const
Returns
The underlying BSON document value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_double()

const b_double & bsoncxx::types::bson_value::view::get_double ( ) const
Returns
The underlying BSON double value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_int32()

const b_int32 & bsoncxx::types::bson_value::view::get_int32 ( ) const
Returns
The underlying BSON 32-bit signed integer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_int64()

const b_int64 & bsoncxx::types::bson_value::view::get_int64 ( ) const
Returns
The underlying BSON 64-bit signed integer value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_maxkey()

const b_maxkey & bsoncxx::types::bson_value::view::get_maxkey ( ) const
Returns
The underlying BSON max-key value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_minkey()

const b_minkey & bsoncxx::types::bson_value::view::get_minkey ( ) const
Returns
The underlying BSON min-key value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_null()

const b_null & bsoncxx::types::bson_value::view::get_null ( ) const
Returns
The underlying BSON null value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_oid()

const b_oid & bsoncxx::types::bson_value::view::get_oid ( ) const
Returns
The underlying BSON ObjectId value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_regex()

const b_regex & bsoncxx::types::bson_value::view::get_regex ( ) const
Returns
The underlying BSON regex value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_symbol()

const b_symbol & bsoncxx::types::bson_value::view::get_symbol ( ) const
Returns
The underlying BSON symbol value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_timestamp()

const b_timestamp & bsoncxx::types::bson_value::view::get_timestamp ( ) const
Returns
The underlying BSON replication timestamp value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_undefined()

const b_undefined & bsoncxx::types::bson_value::view::get_undefined ( ) const
Returns
The underlying BSON undefined value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ get_utf8()

const b_utf8 & bsoncxx::types::bson_value::view::get_utf8 ( ) const
Returns
The underlying BSON UTF-8 string value.
Warning
Calling the wrong get_<type> method will cause an exception to be thrown.

◆ type()

bsoncxx::type bsoncxx::types::bson_value::view::type ( ) const
Returns
The type of the underlying BSON value stored in this object.

The documentation for this class was generated from the following file: