MongoDB C++ Driver 4.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
server_api.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 <string>
18
21#include <mongocxx/pool-fwd.hpp>
22
25
27
28namespace mongocxx {
29namespace v_noabi {
30namespace options {
31
39 public:
43 enum class version {
45 };
46
59
72
85
97
104 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&) strict() const;
105
117
124 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bool> const&)
126
134
135 private:
136 friend ::mongocxx::v_noabi::client;
137 friend ::mongocxx::v_noabi::pool;
138
139 version _version;
140 bsoncxx::v_noabi::stdx::optional<bool> _strict;
141 bsoncxx::v_noabi::stdx::optional<bool> _deprecation_errors;
142};
143
144} // namespace options
145} // namespace v_noabi
146} // namespace mongocxx
147
148#include <mongocxx/config/postlude.hpp>
149
server_api(version version)
Constructs a new server_api object.
Used by clients.
Definition client.hpp:37
Used by mongocxx::v_noabi::pool.
Definition pool.hpp:30
static version version_from_string(bsoncxx::v_noabi::stdx::string_view version)
Converts a version string to its enum value.
static std::string version_to_string(version version)
Converts a version enum value to its string value.
server_api & deprecation_errors(bool deprecation_errors)
Sets the deprecation errors option, specifying whether the server should return errors for features t...
version
Enum representing the possible values for server API version.
Definition server_api.hpp:43
@ k_version_1
Stable API Version 1.
Definition server_api.hpp:44
server_api & strict(bool strict)
Sets the strict option, specifying whether the server should return errors for features that are not ...
version get_version() const
Gets the declared server api version.
server_api(version version)
Constructs a new server_api object.
Declares mongocxx::v_noabi::client.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities representing options to use with various commands.
Declares entities whose ABI stability is NOT guaranteed.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v_noabi::pool.
Declares mongocxx::v_noabi::options::server_api.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.