MongoDB C++ Driver 4.4.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
23
24#include <string> // IWYU pragma: keep: backward compatibility, to be removed.
25#include <utility>
26
28
33
35
36namespace mongocxx {
37namespace v_noabi {
38namespace options {
39
43class client {
44 public:
48 client() = default;
49
64 return this->tls_opts(std::move(ssl_opts));
65 }
66
78 _tls_opts = std::move(tls_opts);
79 return *this;
80 }
81
92
99 return _tls_opts;
100 }
101
113 _auto_encrypt_opts = std::move(auto_encryption_opts);
114 return *this;
115 }
116
124 return _auto_encrypt_opts;
125 }
126
138 _apm_opts = std::move(apm_opts);
139 return *this;
140 }
141
148 return _apm_opts;
149 }
150
162 _server_api_opts = std::move(server_api_opts);
163 return *this;
164 }
165
174 return _server_api_opts;
175 }
176
188 _oidc_callback = std::move(oidc_callback);
189 return *this;
190 }
191
198 return _oidc_callback;
199 }
200
201 class internal;
202
203 private:
209
210 /* explicit(false) */ client(v1::client::options opts);
211
212 explicit operator v1::client::options() const;
213};
214
215} // namespace options
216} // namespace v_noabi
217} // namespace mongocxx
218
219namespace mongocxx {
220namespace v_noabi {
221
230
232 auto ret = from_v1(std::move(v));
233 ret.auto_encryption_opts(std::move(opts));
234 return ret;
235}
236
238
247
249 auto ret = to_v1(v);
250 ret.auto_encryption_opts(std::move(opts));
251 return ret;
252}
253
255
256} // namespace v_noabi
257} // namespace mongocxx
258
260
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:310
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:43
client & auto_encryption_opts(auto_encryption auto_encryption_opts)
Sets the automatic encryption options.
Definition client.hpp:112
client & ssl_opts(tls ssl_opts)
Sets the SSL-related options.
Definition client.hpp:63
client & apm_opts(apm apm_opts)
Sets the APM-related options.
Definition client.hpp:137
client()=default
Default initialization.
client & oidc_callback(v1::oidc_callback oidc_callback)
Sets the OIDC callback.
Definition client.hpp:187
bsoncxx::v_noabi::stdx::optional< tls > const & ssl_opts() const
The current SSL-related options.
Definition client.hpp:89
bsoncxx::v_noabi::stdx::optional< v1::oidc_callback > const & oidc_callback() const
The current OIDC callback.
Definition client.hpp:197
client & server_api_opts(server_api server_api_opts)
Sets the server API options.
Definition client.hpp:161
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:173
bsoncxx::v_noabi::stdx::optional< tls > const & tls_opts() const
The current TLS-related options.
Definition client.hpp:98
bsoncxx::v_noabi::stdx::optional< auto_encryption > const & auto_encryption_opts() const
Gets the current automatic encryption options.
Definition client.hpp:123
client & tls_opts(tls tls_opts)
Sets the TLS-related options.
Definition client.hpp:77
bsoncxx::v_noabi::stdx::optional< apm > const & apm_opts() const
The current APM-related options.
Definition client.hpp:147
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_UNSTABLE(...)
Equivalent to MONGOCXX_ABI_EXPORT_UNSTABLE with MONGOCXX_ABI_CDECL.
Definition config.hpp:28
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
std::function< oidc_credential(oidc_callback_params const &)> oidc_callback
An OIDC credential callback function.
Definition oidc_callback.hpp:36
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 mongocxx::v1::oidc_callback.
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.