Loading...
Searching...
No Matches
heartbeat_succeeded_event.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/events/heartbeat_succeeded_event-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/events/server_heartbeat_succeeded.hpp> // IWYU pragma: export
#include <cstdint>
#include <bsoncxx/document/view.hpp>
#include <bsoncxx/stdx/string_view.hpp>
#include <mongocxx/config/prelude.hpp>
namespace mongocxx {
namespace v_noabi {
namespace events {
class heartbeat_succeeded_event {
private:
v1::events::server_heartbeat_succeeded _event;
public:
explicit MONGOCXX_ABI_NO_EXPORT heartbeat_succeeded_event(void const* event);
/* explicit(false) */ heartbeat_succeeded_event(v1::events::server_heartbeat_succeeded const& event)
: _event{event} {}
explicit operator v1::events::server_heartbeat_succeeded() const {
return _event;
}
bsoncxx::v_noabi::document::view reply() const {
return _event.reply();
}
std::int64_t duration() const {
return _event.duration();
}
bsoncxx::v_noabi::stdx::string_view host() const {
return _event.host();
}
std::uint16_t port() const {
return _event.port();
}
bool awaited() const {
return _event.awaited();
}
};
} // namespace events
} // namespace v_noabi
} // namespace mongocxx
namespace mongocxx {
namespace v_noabi {
inline v_noabi::events::heartbeat_succeeded_event from_v1(v1::events::server_heartbeat_succeeded const& v) {
return {v};
}
inline v1::events::server_heartbeat_succeeded to_v1(v_noabi::events::heartbeat_succeeded_event const& v) {
return v1::events::server_heartbeat_succeeded{v};
}
} // namespace v_noabi
} // namespace mongocxx
#include <mongocxx/config/postlude.hpp>
bsoncxx::v1::stdx::string_view
A polyfill for std::string_view.
Definition string_view.hpp:412
bsoncxx::v_noabi::document::view
A read-only, non-owning view of a BSON document.
Definition view.hpp:40
mongocxx::events::heartbeat_succeeded_event::heartbeat_succeeded_event
heartbeat_succeeded_event(void const *event)
mongocxx::v1::events::server_heartbeat_succeeded
ServerHeartbeatSucceededEvent from the SDAM Logging and Monitoring specification.
Definition server_heartbeat_succeeded.hpp:41
mongocxx::v_noabi::events::heartbeat_succeeded_event
The successful execution of a heartbeat ("hello") command.
Definition heartbeat_succeeded_event.hpp:40
mongocxx::v_noabi::events::heartbeat_succeeded_event::heartbeat_succeeded_event
heartbeat_succeeded_event(v1::events::server_heartbeat_succeeded const &event)
Construct with the mongocxx::v1 equivalent.
Definition heartbeat_succeeded_event.hpp:53
mongocxx::v_noabi::events::heartbeat_succeeded_event::reply
bsoncxx::v_noabi::document::view reply() const
Returns the server reply for the succeeded operation.
Definition heartbeat_succeeded_event.hpp:68
mongocxx::v_noabi::events::heartbeat_succeeded_event::duration
std::int64_t duration() const
Returns the duration of the successful operation.
Definition heartbeat_succeeded_event.hpp:77
mongocxx::v_noabi::events::heartbeat_succeeded_event::awaited
bool awaited() const
Returns a boolean indicating whether this heartbeat event is from an awaitable hello.
Definition heartbeat_succeeded_event.hpp:104
mongocxx::v_noabi::events::heartbeat_succeeded_event::host
bsoncxx::v_noabi::stdx::string_view host() const
Returns the host name.
Definition heartbeat_succeeded_event.hpp:86
mongocxx::v_noabi::events::heartbeat_succeeded_event::port
std::uint16_t port() const
Returns the port.
Definition heartbeat_succeeded_event.hpp:95
mongocxx::v_noabi::events::heartbeat_succeeded_event::heartbeat_succeeded_event
heartbeat_succeeded_event(void const *event)
heartbeat_succeeded_event-fwd.hpp
Declares mongocxx::v_noabi::events::heartbeat_succeeded_event.
MONGOCXX_ABI_NO_EXPORT
#define MONGOCXX_ABI_NO_EXPORT
Excludes the associated entity from being part of the ABI.
Definition export.hpp:20
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
mongocxx::v_noabi::events
Declares entities describing APM events.
mongocxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
mongocxx::v_noabi::to_v1
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
mongocxx::v_noabi::from_v1
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_heartbeat_succeeded.hpp
Provides mongocxx::v1::events::server_heartbeat_succeeded.
view.hpp
Provides bsoncxx::v_noabi::document::view.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.