MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
write.hpp
Go to the documentation of this file.
1// Copyright 2009-present MongoDB, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
17#include <cstdint>
18
20
22
30
32
33namespace mongocxx {
34namespace v_noabi {
35namespace model {
36
40class write {
41 public:
46
51
56
61
66
71
76
80 MONGOCXX_ABI_EXPORT_CDECL(write&) operator=(write&& rhs) noexcept;
81
82 write(const write& rhs) = delete;
83 write& operator=(const write& rhs) = delete;
84
89
94
101
108
115
122
129
136
137 private:
138 void destroy_member() noexcept;
139
140 write_type _type;
141
142 union {
143 insert_one _insert_one;
144 update_one _update_one;
145 update_many _update_many;
146 delete_one _delete_one;
147 delete_many _delete_many;
148 replace_one _replace_one;
149 };
150};
151
152} // namespace model
153} // namespace v_noabi
154} // namespace mongocxx
155
157
Class representing a MongoDB delete operation that removes multiple documents.
Definition delete_many.hpp:34
Class representing a MongoDB delete operation that removes a single document.
Definition delete_one.hpp:34
Class representing a MongoDB insert operation that creates a single document.
Definition insert_one.hpp:30
Class representing a MongoDB update operation that replaces a single document.
Definition replace_one.hpp:34
Class representing a MongoDB update operation that modifies multiple documents.
Definition update_many.hpp:36
Class representing a MongoDB update operation that modifies a single document.
Definition update_one.hpp:36
Models a single write operation within a mongocxx::v_noabi::bulk_write.
Definition write.hpp:40
const delete_many & get_delete_many() const
Accesses the write as a model::delete_many. It is illegal to call this method if the return of type()...
const update_one & get_update_one() const
Accesses the write as an model::update_one. It is illegal to call this method if the return of type()...
const insert_one & get_insert_one() const
Accesses the write as a model::insert_one. It is illegal to call this method if the return of type() ...
const delete_one & get_delete_one() const
Accesses the write as a model::delete_one. It is illegal to call this method if the return of type() ...
const update_many & get_update_many() const
Accesses the write as an model::update_many. It is illegal to call this method if the return of type(...
const replace_one & get_replace_one() const
Accesses the write as a model::replace_one. It is illegal to call this method if the return of type()...
write_type type() const
Returns the current type of this write.
Provides mongocxx::v_noabi::model::delete_many.
Provides mongocxx::v_noabi::model::delete_one.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
Provides mongocxx::v_noabi::model::insert_one.
Provides mongocxx::v_noabi::model::replace_one.
The mongocxx macro guard postlude header.
The mongocxx macro guard prelude header.
write_type
Enum representing the the types of write operations that can be performed.
Definition write_type.hpp:27
The top-level namespace within which all mongocxx library entities are declared.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::model::update_many.
Provides mongocxx::v_noabi::model::update_one.
Declares mongocxx::v_noabi::model::write.
Provides mongocxx::v_noabi::write_type.