topology_closed_event.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2018-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. #pragma once
  15. #include <bsoncxx/oid.hpp>
  16. #include <mongocxx/config/prelude.hpp>
  17. namespace mongocxx {
  18. MONGOCXX_INLINE_NAMESPACE_BEGIN
  19. namespace events {
  20. ///
  21. /// An event notification sent when the driver stops monitoring a server topology and destroys its
  22. /// description.
  23. ///
  24. /// @see "TopologyClosedEvent" in
  25. /// https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring-monitoring.rst
  26. ///
  27. class MONGOCXX_API topology_closed_event {
  28. public:
  29. MONGOCXX_PRIVATE explicit topology_closed_event(const void* event);
  30. ///
  31. /// Destroys a topology_closed_event.
  32. ///
  33. ~topology_closed_event();
  34. ///
  35. /// An opaque id, unique to this topology for this mongocxx::client or mongocxx::pool.
  36. ///
  37. /// @return The id.
  38. ///
  39. bsoncxx::oid topology_id() const;
  40. private:
  41. const void* _event;
  42. };
  43. } // namespace events
  44. MONGOCXX_INLINE_NAMESPACE_END
  45. } // namespace mongocxx
  46. #include <mongocxx/config/postlude.hpp>