MongoDB C++ Driver mongocxx-3.11.0
Loading...
Searching...
No Matches
client_session.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
19
21
23#include <mongocxx/stdx.hpp>
24
26
27namespace mongocxx {
28namespace v_noabi {
29namespace options {
30
35 public:
55
61
76 MONGOCXX_ABI_EXPORT_CDECL(client_session&) snapshot(bool enable_snapshot_reads) noexcept;
77
81 MONGOCXX_ABI_EXPORT_CDECL(bool) snapshot() const noexcept;
82
95
102
103 private:
104 friend ::mongocxx::v_noabi::client_session;
105
106 stdx::optional<bool> _causal_consistency;
107 stdx::optional<bool> _enable_snapshot_reads;
108
109 stdx::optional<transaction> _default_transaction_opts;
110};
111
112} // namespace options
113} // namespace v_noabi
114} // namespace mongocxx
115
116#include <mongocxx/config/postlude.hpp>
117
Class representing the optional arguments to mongocxx::v_noabi::client::start_session.
Definition client_session.hpp:34
client_session & causal_consistency(bool causal_consistency) noexcept
Sets the causal_consistency option.
bool causal_consistency() const noexcept
Gets the value of the causal_consistency option.
bool snapshot() const noexcept
Gets the value of the snapshot_reads option.
const stdx::optional< transaction > & default_transaction_opts() const
Gets the current default transaction options.
Class representing the optional arguments for a transaction.
Definition transaction.hpp:39
Declares mongocxx::v_noabi::client_session.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition fwd.hpp:222
The mongocxx macro guard prelude header.
The top-level namespace within which all mongocxx library entities are declared.
Provides std::optional-related polyfills for library API usage.
Declares mongocxx::v_noabi::options::client.
Redeclares bsoncxx::v_noabi::stdx in mongocxx::v_noabi::stdx for internal use.
Provides mongocxx::v_noabi::options::transaction.