MongoDB C++ Driver  mongocxx-3.6.2
All Classes Namespaces Functions Typedefs Enumerations Enumerator Friends Pages
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/tls.hpp>
23 
24 #include <mongocxx/config/prelude.hpp>
25 
26 namespace mongocxx {
27 MONGOCXX_INLINE_NAMESPACE_BEGIN
28 namespace options {
29 
30 // NOTE: client options interface still evolving
31 
35 class MONGOCXX_API client {
36  public:
50  MONGOCXX_DEPRECATED client& ssl_opts(tls ssl_opts);
51 
62  client& tls_opts(tls tls_opts);
63 
71  MONGOCXX_DEPRECATED const stdx::optional<tls>& ssl_opts() const;
72 
78  const stdx::optional<tls>& tls_opts() const;
79 
91 
98  const stdx::optional<auto_encryption>& auto_encryption_opts() const;
99 
110  client& apm_opts(apm apm_opts);
111 
117  const stdx::optional<apm>& apm_opts() const;
118 
119  private:
120  stdx::optional<tls> _tls_opts;
121  stdx::optional<apm> _apm_opts;
122  stdx::optional<auto_encryption> _auto_encrypt_opts;
123 };
124 
125 } // namespace options
126 MONGOCXX_INLINE_NAMESPACE_END
127 } // namespace mongocxx
128 
129 #include <mongocxx/config/postlude.hpp>
mongocxx::options::client::ssl_opts
MONGOCXX_DEPRECATED client & ssl_opts(tls ssl_opts)
Sets the SSL-related options.
mongocxx::options::client
Class representing the optional arguments to a MongoDB driver client object.
Definition: client.hpp:35
mongocxx::options::client::ssl_opts
MONGOCXX_DEPRECATED const stdx::optional< tls > & ssl_opts() const
The current SSL-related options.
mongocxx
Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
mongocxx::options::client::apm_opts
const stdx::optional< apm > & apm_opts() const
The current APM-related options.
mongocxx::options::client::apm_opts
client & apm_opts(apm apm_opts)
Sets the APM-related options.
mongocxx::options::client::auto_encryption_opts
const stdx::optional< auto_encryption > & auto_encryption_opts() const
Gets the current automatic encryption options.
mongocxx::options::apm
Definition: apm.hpp:38
mongocxx::options::auto_encryption
Class representing options for automatic client-side encryption.
Definition: auto_encryption.hpp:36
mongocxx::options::tls
Class representing the optional arguments to a MongoDB driver client (TLS)
Definition: tls.hpp:32
mongocxx::options::client::auto_encryption_opts
client & auto_encryption_opts(auto_encryption auto_encryption_opts)
Sets the automatic encryption options.
mongocxx::options::client::tls_opts
client & tls_opts(tls tls_opts)
Sets the TLS-related options.
mongocxx::options::client::tls_opts
const stdx::optional< tls > & tls_opts() const
The current TLS-related options.