43class topology_description {
53 using container = std::vector<server_description>;
89 return _container.begin();
92 return _container.begin();
102 return _container.end();
105 return _container.begin();
113 std::size_t
size() const noexcept {
114 return _container.size();
118 friend topology_description;
122 container _container;
132 topology_description(
v1::
events::topology_description const& td) : _td{td} {}
171 return _td.has_writable_server();
A polyfill for std::string_view.
Definition string_view.hpp:412
server_descriptions(server_descriptions &&) noexcept
Move constructs a server_descriptions array.
TopologyDescription from the SDAM Logging and Monitoring specification.
Definition topology_description.hpp:44
An array of server_description instances.
Definition topology_description.hpp:51
iterator end() noexcept
Returns an iterator to the end.
Definition topology_description.hpp:101
iterator begin() noexcept
Returns an iterator to the beginning.
Definition topology_description.hpp:88
const_iterator end() const noexcept
Returns an iterator to the end.
Definition topology_description.hpp:104
server_descriptions(server_descriptions &&) noexcept
Move constructs a server_descriptions array.
container::iterator iterator
The array's iterator type.
Definition topology_description.hpp:77
container::const_iterator const_iterator
The array's const iterator type.
Definition topology_description.hpp:82
const_iterator begin() const noexcept
Returns an iterator to the beginning.
Definition topology_description.hpp:91
std::size_t size() const noexcept
The number of server_description instances in the array.
Definition topology_description.hpp:113
A description of the topology of one or more connected MongoDB servers.
Definition topology_description.hpp:43
bool has_readable_server(v_noabi::read_preference const &pref) const
Determines if the topology has a readable server available. Servers are filtered by the given read pr...
bool has_writable_server() const
Determines if the topology has a writable server available, such as a primary, mongos,...
Definition topology_description.hpp:170
bsoncxx::v_noabi::stdx::string_view type() const
The topology type: "Unknown", "Sharded", "ReplicaSetNoPrimary", "ReplicaSetWithPrimary",...
Definition topology_description.hpp:147
server_descriptions servers() const
Fetches descriptions for all known servers in the topology.
Describes how MongoDB clients route read operations to the members of a replica set or sharded cluste...
Definition read_preference.hpp:59
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v_noabi macro guard postlude header.
The mongocxx v_noabi macro guard prelude header.
Declares entities whose ABI stability is guaranteed for documented symbols.
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::topology_description.
Provides std::string_view-related polyfills for library API usage.
Provides mongocxx::v_noabi::events::server_description.
Declares mongocxx::v_noabi::events::topology_description.
Provides mongocxx::v_noabi::read_preference.