MongoDB C++ Driver
mongocxx-3.0.2
|
A stream context which expects any number of values. More...
#include <array_context.hpp>
Public Member Functions | |
array_context (core *core) | |
Create an array_context given a core builder. More... | |
template<class T > | |
std::enable_if< !(util::is_functor< T, void(array_context<>)>::value||util::is_functor< T, void(single_context)>::value||std::is_same< typename std::remove_reference< T >::type, const finalize_type >::value), array_context >::type & | operator<< (T &&t) |
<< operator for accepting a real value and appending it to the core builder. More... | |
template<typename Func > | |
std::enable_if<(util::is_functor< Func, void(array_context<>)>::value||util::is_functor< Func, void(single_context)>::value), array_context >::type & | operator<< (Func func) |
<< operator for accepting a callable of the form void(array_context) or void(single_context) and invoking it to perform 1 or more value appends to the core builder. More... | |
template<typename T > | |
std::enable_if< std::is_same< base, closed_context >::value &&std::is_same< typename std::remove_reference< T >::type, const finalize_type >::value, bsoncxx::array::value >::type | operator<< (T &&) |
<< operator for finalizing the stream. More... | |
key_context< array_context > | operator<< (const open_document_type) |
<< operator for opening a new subdocument in the core builder. More... | |
array_context | operator<< (concatenate_array array) |
<< operator for concatenating another array. More... | |
array_context< array_context > | operator<< (const open_array_type) |
<< operator for opening a new subarray in the core builder. More... | |
base | operator<< (const close_array_type) |
<< operator for closing a subarray in the core builder. More... | |
operator array_context () | |
Conversion operator which provides a rooted array context given any stream currently in a nested array_context. | |
Related Functions | |
(Note that these are not member functions.) | |
operator single_context () | |
Conversion operator for single_context. More... | |
A stream context which expects any number of values.
The template argument can be used to hold additional information about containing documents or arrays. I.e. value_context<> implies that this array is a sub_array in a document, while array_context would indicated a sub_array in an array. These types can be nested, such that contextual parsing (for key/value pairs) and depth (to prevent an invalid array_close) are enforced by the type system.
I.e. builder << array_context << array_context << ...;
This builds a bson array with successively higher index keys
|
inline |
Create an array_context given a core builder.
core | The core builder to orchestrate |
|
inline |
<< operator for accepting a real value and appending it to the core builder.
t | The value to append |
|
inline |
<< operator for accepting a callable of the form void(array_context) or void(single_context) and invoking it to perform 1 or more value appends to the core builder.
func | The callback to invoke |
|
inline |
<< operator for opening a new subdocument in the core builder.
_ | An open_document_type token |
|
inline |
<< operator for finalizing the stream.
This operation finishes all processing necessary to fully encode the bson bytes and returns an owning value.
_ | A finalize_type token |
|
inline |
<< operator for opening a new subarray in the core builder.
_ | An open_document_type token |
|
inline |
<< operator for concatenating another array.
This operation concatenates all of the values from the passed document into the current stream. Keys are adjusted to match the existing array.
array | An array to concatenate |
|
inline |
<< operator for closing a subarray in the core builder.
_ | A close_array_type token |
|
related |
Conversion operator for single_context.
Implementation of the single_context conversion operator for array_context.