MongoDB C++ Driver  mongocxx-3.4.0
Public Member Functions | List of all members
bsoncxx::builder::stream::single_context Class Reference

A stream context which appends a single value. More...

#include <single_context.hpp>

Public Member Functions

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

Detailed 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.

Constructor & Destructor Documentation

◆ single_context()

bsoncxx::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]

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

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

Parameters
_An open_document_type token

◆ operator<<() [2/3]

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

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

Parameters
_An open_array_type token

◆ operator<<() [3/3]

template<class T >
void bsoncxx::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: