MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
transaction.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 <chrono>
18#include <memory>
19
25
27
29
30namespace mongocxx {
31namespace v_noabi {
32namespace options {
33
37class transaction {
38 public:
39 MONGOCXX_ABI_EXPORT_CDECL() transaction();
40
44 MONGOCXX_ABI_EXPORT_CDECL() transaction(transaction const&);
45
49 MONGOCXX_ABI_EXPORT_CDECL(transaction&) operator=(transaction const&);
50
54 MONGOCXX_ABI_EXPORT_CDECL() transaction(transaction&&) noexcept;
55
59 MONGOCXX_ABI_EXPORT_CDECL(transaction&) operator=(transaction&&) noexcept;
60
64 MONGOCXX_ABI_EXPORT_CDECL() ~transaction() noexcept;
65
77
85 read_concern() const;
86
97 MONGOCXX_ABI_EXPORT_CDECL(transaction&)
99
110
121 MONGOCXX_ABI_EXPORT_CDECL(transaction&)
123
132
142 MONGOCXX_ABI_EXPORT_CDECL(transaction&) max_commit_time_ms(std::chrono::milliseconds ms);
143
151 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<std::chrono::milliseconds>)
153
154 private:
156
157 class impl;
158
159 impl& _get_impl();
160 impl const& _get_impl() const;
161 std::unique_ptr<impl> _impl;
162};
163
164} // namespace options
165} // namespace v_noabi
166} // namespace mongocxx
167
168#include <mongocxx/config/postlude.hpp>
169
Used by client sessions.
Definition client_session.hpp:33
transaction & read_preference(mongocxx::v_noabi::read_preference const &rp)
Sets the transaction read preference.
transaction & read_concern(mongocxx::v_noabi::read_concern const &rc)
Sets the transaction read concern.
transaction & write_concern(mongocxx::v_noabi::write_concern const &wc)
Sets the transaction write concern.
transaction & max_commit_time_ms(std::chrono::milliseconds ms)
Sets the transaction's max commit time, in milliseconds.
Declares mongocxx::v_noabi::client_session.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::read_concern.
Declares mongocxx::v_noabi::read_preference.
Declares mongocxx::v_noabi::options::transaction.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::write_concern.