MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
client.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 <mongocxx/options/client-fwd.hpp> // IWYU pragma: export
18
19//
20
21#include <mongocxx/v1/client.hpp> // IWYU pragma: export
22
23#include <string> // IWYU pragma: keep: backward compatibility, to be removed.
24#include <utility>
25
27
32
34
35namespace mongocxx {
36namespace v_noabi {
37namespace options {
38
42class client {
43 public:
47 client() = default;
48
63 return this->tls_opts(std::move(ssl_opts));
64 }
65
77 _tls_opts = std::move(tls_opts);
78 return *this;
79 }
80
91
98 return _tls_opts;
99 }
100
112 _auto_encrypt_opts = std::move(auto_encryption_opts);
113 return *this;
114 }
115
123 return _auto_encrypt_opts;
124 }
125
137 _apm_opts = std::move(apm_opts);
138 return *this;
139 }
140
147 return _apm_opts;
148 }
149
161 _server_api_opts = std::move(server_api_opts);
162 return *this;
163 }
164
173 return _server_api_opts;
174 }
175
176 class internal;
177
178 private:
183
184 /* explicit(false) */ client(v1::client::options opts);
185
186 explicit operator v1::client::options() const;
187};
188
189} // namespace options
190} // namespace v_noabi
191} // namespace mongocxx
192
193namespace mongocxx {
194namespace v_noabi {
195
204
206 auto ret = from_v1(std::move(v));
207 ret.auto_encryption_opts(std::move(opts));
208 return ret;
209}
210
212
221
223 auto ret = to_v1(v);
224 ret.auto_encryption_opts(std::move(opts));
225 return ret;
226}
227
229
230} // namespace v_noabi
231} // namespace mongocxx
232
234
Provides mongocxx::v_noabi::options::auto_encryption.
A polyfill for std::optional<T>.
Definition optional.hpp:799
client()=default
Default initialization.
Options related In-Use Encryption configuration.
Definition auto_encryption_options.hpp:58
Options for mongocxx::v1::client.
Definition client.hpp:307
Used by mongocxx::v_noabi::options::client::apm_opts.
Definition apm.hpp:52
Used by mongocxx::v_noabi::options::client::auto_encryption_opts.
Definition auto_encryption.hpp:44
Used by clients.
Definition client.hpp:42
client & auto_encryption_opts(auto_encryption auto_encryption_opts)
Sets the automatic encryption options.
Definition client.hpp:111
client & ssl_opts(tls ssl_opts)
Sets the SSL-related options.
Definition client.hpp:62
client & apm_opts(apm apm_opts)
Sets the APM-related options.
Definition client.hpp:136
client()=default
Default initialization.
bsoncxx::v_noabi::stdx::optional< tls > const & ssl_opts() const
The current SSL-related options.
Definition client.hpp:88
client & server_api_opts(server_api server_api_opts)
Sets the server API options.
Definition client.hpp:160
bsoncxx::v_noabi::stdx::optional< server_api > const & server_api_opts() const
Gets the current server API options or returns a disengaged optional if there are no server API optio...
Definition client.hpp:172
bsoncxx::v_noabi::stdx::optional< tls > const & tls_opts() const
The current TLS-related options.
Definition client.hpp:97
bsoncxx::v_noabi::stdx::optional< auto_encryption > const & auto_encryption_opts() const
Gets the current automatic encryption options.
Definition client.hpp:122
client & tls_opts(tls tls_opts)
Sets the TLS-related options.
Definition client.hpp:76
bsoncxx::v_noabi::stdx::optional< apm > const & apm_opts() const
The current APM-related options.
Definition client.hpp:146
Used by mongocxx::v_noabi::options::client::server_api_opts.
Definition server_api.hpp:43
Used by mongocxx::v_noabi::options::client::tls_opts.
Definition tls.hpp:39
#define MONGOCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition export.hpp:25
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v1::client.
Provides std::optional-related polyfills for library API usage.
Provides mongocxx::v_noabi::options::apm.
Declares mongocxx::v_noabi::options::client.
Provides mongocxx::v_noabi::options::server_api.
Provides mongocxx::v_noabi::options::tls.