MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
server_description.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 <mongocxx/v1/events/server_description-fwd.hpp> // IWYU pragma: export
18
19//
20
22
24
27
29
30#include <cstdint>
31
32namespace mongocxx {
33namespace v1 {
34namespace events {
35
45 private:
46 void* _impl; // mongoc_server_description_t
47
48 public:
55
63
71
76
81
87 MONGOCXX_ABI_EXPORT_CDECL(std::uint32_t) id() const;
88
92 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int64_t>) round_trip_time() const;
93
109 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::string_view) type() const;
110
116 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::document::view) hello() const;
117
121 MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::string_view) host() const;
122
126 MONGOCXX_ABI_EXPORT_CDECL(std::uint16_t) port() const;
127
128 class internal;
129
130 private:
131 /* explicit(false) */ server_description(void* impl);
132};
133
134} // namespace events
135} // namespace v1
136} // namespace mongocxx
137
138#include <mongocxx/v1/detail/postlude.hpp>
139
bsoncxx::v1::stdx::optional< std::int64_t > round_trip_time() const
Return the client-measured execution time of the "hello" command.
server_description(server_description &&other) noexcept
Move constructor.
std::uint16_t port() const
Return the port number for the connection used by the command.
~server_description()
Destroy this object.
bsoncxx::v1::stdx::string_view host() const
Return the hostname for the connection used by the command.
bsoncxx::v1::stdx::string_view type() const
Return the topology type.
bsoncxx::v1::document::view hello() const
Return the raw server response to the "hello" command.
Provides macros to control the set of symbols exported in the ABI.
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v1 macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities describing APM events.
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all mongocxx library entities are declared.
Declares bsoncxx::v1::document::view.
Declares mongocxx::v1::events::server_description.
Provides std::optional-related polyfills for library API usage.
Provides std::string_view-related polyfills for library API usage.