Loading...
Searching...
No Matches
apm.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/v1/apm-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <mongocxx/v1/events/command_failed-fwd.hpp>
#include <mongocxx/v1/events/command_started-fwd.hpp>
#include <mongocxx/v1/events/command_succeeded-fwd.hpp>
#include <mongocxx/v1/events/server_closed-fwd.hpp>
#include <mongocxx/v1/events/server_description_changed-fwd.hpp>
#include <mongocxx/v1/events/server_heartbeat_failed-fwd.hpp>
#include <mongocxx/v1/events/server_heartbeat_started-fwd.hpp>
#include <mongocxx/v1/events/server_heartbeat_succeeded-fwd.hpp>
#include <mongocxx/v1/events/server_opening-fwd.hpp>
#include <mongocxx/v1/events/topology_closed-fwd.hpp>
#include <mongocxx/v1/events/topology_description_changed-fwd.hpp>
#include <mongocxx/v1/events/topology_opening-fwd.hpp>
#include <mongocxx/v1/config/export.hpp>
#include <functional>
namespace mongocxx {
namespace v1 {
class apm {
private:
class impl;
void* _impl;
public:
MONGOCXX_ABI_EXPORT_CDECL() ~apm();
MONGOCXX_ABI_EXPORT_CDECL() apm(apm&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(apm&) operator=(apm&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() apm(apm const& other);
MONGOCXX_ABI_EXPORT_CDECL(apm&) operator=(apm const& other);
MONGOCXX_ABI_EXPORT_CDECL() apm();
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_command_started(
std::function<void MONGOCXX_ABI_CDECL(v1::events::command_started const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::command_started const&)>)
command_started() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_command_failed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::command_failed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::command_failed const&)>)
command_failed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_command_succeeded(
std::function<void MONGOCXX_ABI_CDECL(v1::events::command_succeeded const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::command_succeeded const&)>)
command_succeeded() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_opening(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_opening const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_opening const&)>)
server_opening() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_closed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_closed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_closed const&)>)
server_closed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_description_changed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_description_changed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_description_changed const&)>)
server_description_changed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_topology_opening(
std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_opening const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_opening const&)>)
topology_opening() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_topology_closed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_closed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_closed const&)>)
topology_closed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_topology_description_changed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_description_changed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::topology_description_changed const&)>)
topology_description_changed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_started(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_started const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_started const&)>)
server_heartbeat_started() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_failed(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_failed const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_failed const&)>)
server_heartbeat_failed() const;
MONGOCXX_ABI_EXPORT_CDECL(apm&) on_server_heartbeat_succeeded(
std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_succeeded const&)> fn);
MONGOCXX_ABI_EXPORT_CDECL(std::function<void MONGOCXX_ABI_CDECL(v1::events::server_heartbeat_succeeded const&)>)
server_heartbeat_succeeded() const;
class internal;
};
} // namespace v1
} // namespace mongocxx
#include <mongocxx/v1/detail/postlude.hpp>
mongocxx::v1::apm::topology_opening
std::function< void(v1::events::topology_opening const &)> topology_opening() const
Return the current the "TopologyOpeningEvent" handler.
mongocxx::v1::apm::apm
apm(apm &&other) noexcept
Move constructor.
mongocxx::v1::apm::server_opening
std::function< void(v1::events::server_opening const &)> server_opening() const
Return the current the "ServerOpeningEvent" handler.
mongocxx::v1::apm::on_server_description_changed
apm & on_server_description_changed(std::function< void(v1::events::server_description_changed const &)> fn)
Set the "ServerDescriptionChangedEvent" handler.
mongocxx::v1::apm::on_server_opening
apm & on_server_opening(std::function< void(v1::events::server_opening const &)> fn)
Set the "ServerOpeningEvent" handler.
mongocxx::v1::apm::on_server_closed
apm & on_server_closed(std::function< void(v1::events::server_closed const &)> fn)
Set the "ServerClosedEvent" handler.
mongocxx::v1::apm::on_topology_opening
apm & on_topology_opening(std::function< void(v1::events::topology_opening const &)> fn)
Set the "TopologyOpeningEvent" handler.
mongocxx::v1::apm::server_heartbeat_failed
std::function< void(v1::events::server_heartbeat_failed const &)> server_heartbeat_failed() const
Return the current the "ServerHeartbeatFailedEvent" handler.
mongocxx::v1::apm::server_heartbeat_started
std::function< void(v1::events::server_heartbeat_started const &)> server_heartbeat_started() const
Return the current the "ServerHeartbeatStartedEvent" handler.
mongocxx::v1::apm::server_description_changed
std::function< void(v1::events::server_description_changed const &)> server_description_changed() const
Return the current the "ServerDescriptionChangedEvent" handler.
mongocxx::v1::apm::topology_description_changed
std::function< void(v1::events::topology_description_changed const &)> topology_description_changed() const
Return the current the "TopologyDescriptionChangedEvent" handler.
mongocxx::v1::apm::command_started
std::function< void(v1::events::command_started const &)> command_started() const
Return the current "CommandStartedEvent" handler.
mongocxx::v1::apm::on_command_started
apm & on_command_started(std::function< void(v1::events::command_started const &)> fn)
Set the "CommandStartedEvent" handler.
mongocxx::v1::apm::on_topology_closed
apm & on_topology_closed(std::function< void(v1::events::topology_closed const &)> fn)
Set the "TopologyClosedEvent" handler.
mongocxx::v1::apm::on_topology_description_changed
apm & on_topology_description_changed(std::function< void(v1::events::topology_description_changed const &)> fn)
Set the "TopologyDescriptionChangedEvent" handler.
mongocxx::v1::apm::topology_closed
std::function< void(v1::events::topology_closed const &)> topology_closed() const
Return the current the "TopologyClosedEvent" handler.
mongocxx::v1::apm::on_server_heartbeat_failed
apm & on_server_heartbeat_failed(std::function< void(v1::events::server_heartbeat_failed const &)> fn)
Set the "ServerHeartbeatFailedEvent" handler.
mongocxx::v1::apm::server_closed
std::function< void(v1::events::server_closed const &)> server_closed() const
Return the current the "ServerClosedEvent" handler.
mongocxx::v1::apm::~apm
~apm()
Destroy this object.
mongocxx::v1::apm::on_server_heartbeat_succeeded
apm & on_server_heartbeat_succeeded(std::function< void(v1::events::server_heartbeat_succeeded const &)> fn)
Set the "ServerHeartbeatSucceededEvent" handler.
mongocxx::v1::apm::command_succeeded
std::function< void(v1::events::command_succeeded const &)> command_succeeded() const
Return the current the "CommandSucceededEvent" handler.
mongocxx::v1::apm::on_server_heartbeat_started
apm & on_server_heartbeat_started(std::function< void(v1::events::server_heartbeat_started const &)> fn)
Set the "ServerHeartbeatStartedEvent" handler.
mongocxx::v1::apm::on_command_succeeded
apm & on_command_succeeded(std::function< void(v1::events::command_succeeded const &)> fn)
Set the "CommandSucceededEvent" handler.
mongocxx::v1::apm::server_heartbeat_succeeded
std::function< void(v1::events::server_heartbeat_succeeded const &)> server_heartbeat_succeeded() const
Return the current the "ServerHeartbeatSucceededEvent" handler.
mongocxx::v1::apm::command_failed
std::function< void(v1::events::command_failed const &)> command_failed() const
Return the current the "CommandFailedEvent" handler.
mongocxx::v1::apm::on_command_failed
apm & on_command_failed(std::function< void(v1::events::command_failed const &)> fn)
Set the "CommandFailedEvent" handler.
command_failed-fwd.hpp
Declares mongocxx::v1::events::command_failed.
command_started-fwd.hpp
Declares mongocxx::v1::events::command_started.
command_succeeded-fwd.hpp
Declares mongocxx::v1::events::command_succeeded.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_CDECL
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition export.hpp:49
MONGOCXX_ABI_EXPORT_CDECL
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
prelude.hpp
The mongocxx v1 macro guard prelude header.
mongocxx::v1::events
Declares entities describing APM events.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
server_closed-fwd.hpp
Declares mongocxx::v1::events::server_closed.
server_description_changed-fwd.hpp
Declares mongocxx::v1::events::server_description_changed.
server_heartbeat_failed-fwd.hpp
Declares mongocxx::v1::events::server_heartbeat_failed.
server_heartbeat_started-fwd.hpp
Declares mongocxx::v1::events::server_heartbeat_started.
server_heartbeat_succeeded-fwd.hpp
Declares mongocxx::v1::events::server_heartbeat_succeeded.
server_opening-fwd.hpp
Declares mongocxx::v1::events::server_opening.
topology_closed-fwd.hpp
Declares mongocxx::v1::events::topology_closed.
topology_description_changed-fwd.hpp
Declares mongocxx::v1::events::topology_description_changed.
topology_opening-fwd.hpp
Declares mongocxx::v1::events::topology_opening.
apm-fwd.hpp
Declares mongocxx::v1::apm.