17 #include <bsoncxx/array/value.hpp> 18 #include <bsoncxx/builder/concatenate.hpp> 19 #include <bsoncxx/builder/core.hpp> 20 #include <bsoncxx/builder/stream/closed_context.hpp> 21 #include <bsoncxx/builder/stream/helpers.hpp> 22 #include <bsoncxx/util/functor.hpp> 24 #include <bsoncxx/config/prelude.hpp> 27 BSONCXX_INLINE_NAMESPACE_BEGIN
51 template <
class base = closed_context>
70 BSONCXX_INLINE
typename std::enable_if<
71 !(util::is_functor<T, void(array_context<>)>::value ||
73 std::is_same<typename std::remove_reference<T>::type,
const finalize_type>::value),
76 _core->
append(std::forward<T>(t));
88 template <
typename Func>
89 BSONCXX_INLINE
typename std::enable_if<(util::is_functor<Func, void(array_context<>)>::value ||
92 operator<<(Func&& func) {
108 template <
typename T>
109 BSONCXX_INLINE
typename std::enable_if<
110 std::is_same<base, closed_context>::value &&
111 std::is_same<typename std::remove_reference<T>::type,
const finalize_type>::value,
127 return wrap_document();
182 BSONCXX_INLINE base unwrap() {
199 BSONCXX_INLINE_NAMESPACE_END
202 #include <bsoncxx/config/postlude.hpp> Definition: helpers.hpp:29
A low-level interface for constructing BSON documents and arrays.
Definition: core.hpp:42
A read-only BSON array that owns its underlying buffer.
Definition: value.hpp:34
A stream context which expects any number of values.
Definition: array_context.hpp:52
Definition: helpers.hpp:68
Definition: helpers.hpp:47
A streaming interface for constructing a BSON array.
Definition: array.hpp:40
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.
Definition: array_context.hpp:75
A stream context which expects a key, which can later be followed by value, then more key/value pairs...
Definition: array_context.hpp:32
A stream context which appends a single value.
Definition: single_context.hpp:36
core & append(const types::b_double &value)
Appends a BSON double.
array_context operator<<(concatenate_array array)
<< operator for concatenating another array.
Definition: array_context.hpp:139
array_context(core *core)
Create an array_context given a core builder.
Definition: array_context.hpp:60
array::view view() const
Accessor that provides a view of the wrapped concatenate array.
Definition: concatenate.hpp:85
core & close_array()
Closes the current sub-array within this BSON datum.
Container to concatenate an array.
Definition: concatenate.hpp:62
core & open_document()
Opens a sub-document within this BSON datum.
array::value extract_array()
Transfers ownership of the underlying document to the caller.
type
An enumeration of each BSON type.
Definition: types.hpp:39
base operator<<(const close_array_type)
<< operator for closing a subarray in the core builder.
Definition: array_context.hpp:161
core & open_array()
Opens a sub-array within this BSON datum.
core & concatenate(const document::view &view)
Appends the keys from a BSON document into this BSON datum.
Top level namespace for MongoDB C++ BSON functionality.
Definition: element.hpp:24
Definition: helpers.hpp:59