MongoDB C++ Driver mongocxx-3.7.0
Loading...
Searching...
No Matches
client.hpp
1// Copyright 2014 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 <string>
18
19#include <bsoncxx/stdx/optional.hpp>
20#include <mongocxx/options/apm.hpp>
21#include <mongocxx/options/auto_encryption.hpp>
22#include <mongocxx/options/server_api.hpp>
23#include <mongocxx/options/tls.hpp>
24
25#include <mongocxx/config/prelude.hpp>
26
27namespace mongocxx {
28MONGOCXX_INLINE_NAMESPACE_BEGIN
29namespace options {
30
31// NOTE: client options interface still evolving
32
36class MONGOCXX_API client {
37 public:
51 MONGOCXX_DEPRECATED client& ssl_opts(tls ssl_opts);
52
63 client& tls_opts(tls tls_opts);
64
72 MONGOCXX_DEPRECATED const stdx::optional<tls>& ssl_opts() const;
73
79 const stdx::optional<tls>& tls_opts() const;
80
92
99 const stdx::optional<auto_encryption>& auto_encryption_opts() const;
100
111 client& apm_opts(apm apm_opts);
112
118 const stdx::optional<apm>& apm_opts() const;
119
131
139 const stdx::optional<server_api>& server_api_opts() const;
140
141 private:
142 stdx::optional<tls> _tls_opts;
143 stdx::optional<apm> _apm_opts;
144 stdx::optional<auto_encryption> _auto_encrypt_opts;
145 stdx::optional<server_api> _server_api_opts;
146};
147
148} // namespace options
149MONGOCXX_INLINE_NAMESPACE_END
150} // namespace mongocxx
151
152#include <mongocxx/config/postlude.hpp>
Class representing MongoDB application performance monitoring.
Definition apm.hpp:41
Class representing options for automatic client-side encryption.
Definition auto_encryption.hpp:36
Class representing the optional arguments to a MongoDB driver client object.
Definition client.hpp:36
client & tls_opts(tls tls_opts)
Sets the TLS-related options.
const stdx::optional< apm > & apm_opts() const
The current APM-related options.
client & apm_opts(apm apm_opts)
Sets the APM-related options.
const stdx::optional< tls > & ssl_opts() const
The current SSL-related options.
client & auto_encryption_opts(auto_encryption auto_encryption_opts)
Sets the automatic encryption options.
const stdx::optional< server_api > & server_api_opts() const
Gets the current server API options or returns a disengaged optional if there are no server API optio...
client & ssl_opts(tls ssl_opts)
Sets the SSL-related options.
client & server_api_opts(server_api server_api_opts)
Sets the server API options.
const stdx::optional< auto_encryption > & auto_encryption_opts() const
Gets the current automatic encryption options.
const stdx::optional< tls > & tls_opts() const
The current TLS-related options.
Class representing options for server API.
Definition server_api.hpp:36
Class representing the optional arguments to a MongoDB driver client (TLS)
Definition tls.hpp:32
Top level namespace for the MongoDB C++ driver.
Definition bulk_write.hpp:24