MongoDB C++ Driver
current
Loading...
Searching...
No Matches
mongocxx
v_noabi
mongocxx
events
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/events/server_description-fwd.hpp
>
18
19
#include <
bsoncxx/document/view.hpp
>
20
#include <
bsoncxx/stdx/string_view.hpp
>
21
22
#include <
mongocxx/config/prelude.hpp
>
23
24
namespace
mongocxx
{
25
namespace
v_noabi {
26
namespace
events {
27
34
class
server_description
{
35
public
:
36
explicit
server_description
(
void
const
* event);
37
41
MONGOCXX_ABI_EXPORT_CDECL
()
~server_description
();
42
43
server_description
(
server_description
&&) =
default
;
44
server_description
& operator=(
server_description
&&) =
default
;
45
46
server_description
(
server_description
const
&) =
default
;
47
server_description
& operator=(
server_description
const
&) =
default
;
48
55
MONGOCXX_ABI_EXPORT_CDECL
(std::uint32_t)
id
()
const
;
56
62
MONGOCXX_ABI_EXPORT_CDECL
(std::int64_t)
round_trip_time
()
const
;
63
70
MONGOCXX_ABI_EXPORT_CDECL
(
bsoncxx::v_noabi::stdx::string_view
)
type
()
const
;
71
77
MONGOCXX_DEPRECATED
MONGOCXX_ABI_EXPORT_CDECL
(
bsoncxx::v_noabi::document::view
)
is_master
()
const
;
78
85
MONGOCXX_ABI_EXPORT_CDECL
(
bsoncxx::v_noabi::document::view
)
hello
()
const
;
86
92
MONGOCXX_ABI_EXPORT_CDECL
(
bsoncxx::v_noabi::stdx::string_view
)
host
()
const
;
93
99
MONGOCXX_ABI_EXPORT_CDECL
(std::uint16_t)
port
()
const
;
100
101
private
:
102
void
const
* _sd;
103
};
104
105
}
// namespace events
106
}
// namespace v_noabi
107
}
// namespace mongocxx
108
109
#include <
mongocxx/config/postlude.hpp
>
110
bsoncxx::v1::stdx::string_view
A polyfill for std::string_view.
Definition
string_view.hpp:411
bsoncxx::v_noabi::document::view
A read-only, non-owning view of a BSON document.
Definition
view.hpp:35
mongocxx::v_noabi::events::server_description
The description of a connected MongoDB server.
Definition
server_description.hpp:34
mongocxx::v_noabi::events::server_description::port
std::uint16_t port() const
Returns the server port.
mongocxx::v_noabi::events::server_description::is_master
bsoncxx::v_noabi::document::view is_master() const
mongocxx::v_noabi::events::server_description::round_trip_time
std::int64_t round_trip_time() const
The duration of the last hello call, indicating network latency.
mongocxx::v_noabi::events::server_description::hello
bsoncxx::v_noabi::document::view hello() const
The server's last response to the "hello" command, or an empty document if the driver has not yet rea...
mongocxx::v_noabi::events::server_description::id
std::uint32_t id() const
An opaque id, unique to this server for this mongocxx::v_noabi::client or mongocxx::v_noabi::pool.
mongocxx::v_noabi::events::server_description::host
bsoncxx::v_noabi::stdx::string_view host() const
Returns the server host name.
mongocxx::v_noabi::events::server_description::~server_description
~server_description()
Destroys a server_description.
mongocxx::v_noabi::events::server_description::type
bsoncxx::v_noabi::stdx::string_view type() const
The server type: "Unknown", "Standalone", "Mongos", "PossiblePrimary", "RSPrimary",...
view.hpp
Provides bsoncxx::v_noabi::document::view.
MONGOCXX_DEPRECATED
#define MONGOCXX_DEPRECATED
Declares the associated entity as deprecated.
Definition
export.hpp:25
MONGOCXX_ABI_EXPORT_CDECL
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition
export.hpp:52
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_description-fwd.hpp
Declares mongocxx::v_noabi::events::server_description.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.
Generated by
1.9.8