MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
heartbeat_succeeded_event.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/heartbeat_succeeded_event-fwd.hpp> // IWYU pragma: export
18
19//
20
21#include <mongocxx/v1/events/server_heartbeat_succeeded.hpp> // IWYU pragma: export
22
23#include <cstdint>
24
27
29
30namespace mongocxx {
31namespace v_noabi {
32namespace events {
33
41 private:
43
44 public:
49
54 : _event{event} {}
55
59 explicit operator v1::events::server_heartbeat_succeeded() const {
60 return _event;
61 }
62
69 return _event.reply();
70 }
71
77 std::int64_t duration() const {
78 return _event.duration();
79 }
80
87 return _event.host();
88 }
89
95 std::uint16_t port() const {
96 return _event.port();
97 }
98
104 bool awaited() const {
105 return _event.awaited();
106 }
107};
108
109} // namespace events
110} // namespace v_noabi
111} // namespace mongocxx
112
113namespace mongocxx {
114namespace v_noabi {
115
122
129
130} // namespace v_noabi
131} // namespace mongocxx
132
134
A polyfill for std::string_view.
Definition string_view.hpp:412
A read-only, non-owning view of a BSON document.
Definition view.hpp:40
ServerHeartbeatSucceededEvent from the SDAM Logging and Monitoring specification.
Definition server_heartbeat_succeeded.hpp:43
The successful execution of a heartbeat ("hello") command.
Definition heartbeat_succeeded_event.hpp:40
heartbeat_succeeded_event(v1::events::server_heartbeat_succeeded const &event)
Construct with the mongocxx::v1 equivalent.
Definition heartbeat_succeeded_event.hpp:53
bsoncxx::v_noabi::document::view reply() const
Returns the server reply for the succeeded operation.
Definition heartbeat_succeeded_event.hpp:68
std::int64_t duration() const
Returns the duration of the successful operation.
Definition heartbeat_succeeded_event.hpp:77
bool awaited() const
Returns a boolean indicating whether this heartbeat event is from an awaitable hello.
Definition heartbeat_succeeded_event.hpp:104
bsoncxx::v_noabi::stdx::string_view host() const
Returns the host name.
Definition heartbeat_succeeded_event.hpp:86
std::uint16_t port() const
Returns the port.
Definition heartbeat_succeeded_event.hpp:95
Declares mongocxx::v_noabi::events::heartbeat_succeeded_event.
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition export.hpp:20
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
Declares entities describing APM events.
Declares entities whose ABI stability is NOT guaranteed.
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
The top-level namespace within which all mongocxx library entities are declared.
Provides mongocxx::v1::events::server_heartbeat_succeeded.
Provides bsoncxx::v_noabi::document::view.
Provides std::string_view-related polyfills for library API usage.