MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
bsoncxx::v_noabi::builder::stream::single_context Class Reference

#include <bsoncxx/v_noabi/bsoncxx/builder/stream/single_context.hpp>

Description

A stream context which appends a single value.

This type is useful as the argument to a callable passed to other stream modes. Specifically, any callback that takes a single_context can be used to write a value in value_context or array_context.

Public Member Functions

 single_context (core *core)
 Create a single_context given a core builder.
 
array_context operator<< (open_array_type)
 << operator for opening a new subarray in the core builder.
 
key_context operator<< (open_document_type)
 << operator for opening a new subdocument in the core builder.
 
template<class T >
void operator<< (T &&t)
 << operator for accepting a real value and appending it to the core builder.
 

Constructor & Destructor Documentation

◆ single_context()

bsoncxx::v_noabi::builder::stream::single_context::single_context ( core * core)
inline

Create a single_context given a core builder.

Parameters
coreThe core builder to orchestrate

Member Function Documentation

◆ operator<<() [1/3]

array_context bsoncxx::v_noabi::builder::stream::single_context::operator<< ( open_array_type )
inline

<< operator for opening a new subarray in the core builder.

The argument must be an open_array_type token (it is otherwise ignored).

◆ operator<<() [2/3]

key_context bsoncxx::v_noabi::builder::stream::single_context::operator<< ( open_document_type )
inline

<< operator for opening a new subdocument in the core builder.

The argument must be an open_document_type token (it is otherwise ignored).

◆ operator<<() [3/3]

template<class T >
void bsoncxx::v_noabi::builder::stream::single_context::operator<< ( T && t)
inline

<< operator for accepting a real value and appending it to the core builder.

Parameters
tThe value to append

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