MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
read_concern.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 <memory>
18
24#include <mongocxx/uri-fwd.hpp>
25
29
31
33
34namespace mongocxx {
35namespace v_noabi {
36
49 public:
66
75
80
85
90
95
100
112
122
133 acknowledge_string(bsoncxx::v_noabi::stdx::string_view rc_string);
134
144
152
159 friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator==(read_concern const&, read_concern const&);
160 friend MONGOCXX_ABI_EXPORT_CDECL(bool) operator!=(read_concern const&, read_concern const&);
163
164 private:
165 friend ::mongocxx::v_noabi::client;
166 friend ::mongocxx::v_noabi::collection;
167 friend ::mongocxx::v_noabi::database;
168 friend ::mongocxx::v_noabi::options::transaction;
169 friend ::mongocxx::v_noabi::uri;
170
171 class impl;
172
173 read_concern(std::unique_ptr<impl>&& implementation);
174
175 std::unique_ptr<impl> _impl;
176};
177
178} // namespace v_noabi
179} // namespace mongocxx
180
181#include <mongocxx/config/postlude.hpp>
182
read_concern()
Constructs a new read_concern with default acknowledge_level of k_server_default.
A client connection to a MongoDB server.
Definition client.hpp:61
A MongoDB collection.
Definition collection.hpp:87
A MongoDB database.
Definition database.hpp:46
level
A class to represent the read concern level for read operations.
Definition read_concern.hpp:57
@ k_unknown
Represent an unknown read concern level.
Definition read_concern.hpp:62
@ k_linearizable
Represent read concern level "linearizable".
Definition read_concern.hpp:60
@ k_server_default
Represent the server's default read concern level.
Definition read_concern.hpp:61
@ k_local
Represent read concern level "local".
Definition read_concern.hpp:58
@ k_snapshot
Represent read concern level "snapshot".
Definition read_concern.hpp:64
@ k_available
Represent read concern level "available".
Definition read_concern.hpp:63
@ k_majority
Represent read concern level "majority".
Definition read_concern.hpp:59
read_concern()
Constructs a new read_concern with default acknowledge_level of k_server_default.
void acknowledge_string(bsoncxx::v_noabi::stdx::string_view rc_string)
Sets the read concern string. Any valid read concern string (e.g. "local", "majority",...
void acknowledge_level(level rc_level)
Sets the read concern level.
bsoncxx::v_noabi::document::value to_document() const
Gets the document form of this read_concern.
A MongoDB connection string URI.
Definition uri.hpp:43
Declares mongocxx::v_noabi::client.
Declares mongocxx::v_noabi::collection.
Declares mongocxx::v_noabi::database.
Provides bsoncxx::v_noabi::document::value.
#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::options::transaction.
Provides mongocxx::v_noabi::options::transaction.
Declares mongocxx::v_noabi::uri.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.