MongoDB C++ Driver  mongocxx-3.10.2
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 <mongocxx/options/client-fwd.hpp>
20 
21 #include <bsoncxx/stdx/optional.hpp>
22 #include <mongocxx/options/apm.hpp>
23 #include <mongocxx/options/auto_encryption.hpp>
24 #include <mongocxx/options/server_api.hpp>
25 #include <mongocxx/options/tls.hpp>
26 
27 #include <mongocxx/config/prelude.hpp>
28 
29 namespace mongocxx {
30 namespace v_noabi {
31 namespace options {
32 
33 // NOTE: client options interface still evolving
34 
38 class client {
39  public:
53  MONGOCXX_DEPRECATED client& ssl_opts(tls ssl_opts);
54 
66 
74  MONGOCXX_DEPRECATED const stdx::optional<tls>& ssl_opts() const;
75 
81  const stdx::optional<tls>& tls_opts() const;
82 
94 
101  const stdx::optional<auto_encryption>& auto_encryption_opts() const;
102 
114 
120  const stdx::optional<apm>& apm_opts() const;
121 
133 
141  const stdx::optional<server_api>& server_api_opts() const;
142 
143  private:
144  stdx::optional<tls> _tls_opts;
145  stdx::optional<apm> _apm_opts;
146  stdx::optional<auto_encryption> _auto_encrypt_opts;
147  stdx::optional<server_api> _server_api_opts;
148 };
149 
150 } // namespace options
151 } // namespace v_noabi
152 } // namespace mongocxx
153 
154 #include <mongocxx/config/postlude.hpp>
Class representing MongoDB application performance monitoring.
Definition: apm.hpp:43
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:38
client & apm_opts(apm apm_opts)
Sets the APM-related options.
client & ssl_opts(tls ssl_opts)
Sets the SSL-related options.
const stdx::optional< apm > & apm_opts() const
The current APM-related options.
const stdx::optional< tls > & ssl_opts() const
The current SSL-related options.
client & tls_opts(tls tls_opts)
Sets the TLS-related options.
client & auto_encryption_opts(auto_encryption auto_encryption_opts)
Sets the automatic encryption 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< server_api > & server_api_opts() const
Gets the current server API options or returns a disengaged optional if there are no server API optio...
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:34
The top-level namespace for mongocxx library entities.
Definition: bulk_write-fwd.hpp:19