MongoDB C++ Driver  mongocxx-3.7.0
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 
27 namespace mongocxx {
28 MONGOCXX_INLINE_NAMESPACE_BEGIN
29 namespace options {
30 
31 // NOTE: client options interface still evolving
32 
36 class 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 
91  client& auto_encryption_opts(auto_encryption auto_encryption_opts);
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 
130  client& server_api_opts(server_api server_api_opts);
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
149 MONGOCXX_INLINE_NAMESPACE_END
150 } // namespace mongocxx
151 
152 #include <mongocxx/config/postlude.hpp>
mongocxx::options::client
Class representing the optional arguments to a MongoDB driver client object.
Definition: client.hpp:36
mongocxx
Top level namespace for the MongoDB C++ driver.
Definition: bulk_write.hpp:24
mongocxx::options::server_api
Class representing options for server API.
Definition: server_api.hpp:36
mongocxx::options::apm
Class representing MongoDB application performance monitoring.
Definition: apm.hpp:41
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