MongoDB C++ Driver mongocxx-3.11.0
|
#include <mongocxx/v_noabi/mongocxx/events/topology_description.hpp>
Class representing what the driver knows about a topology of MongoDB servers: either a standalone, a replica set, or a sharded cluster.
Classes | |
class | server_descriptions |
An array of server_description instances. More... | |
Public Member Functions | |
~topology_description () | |
Destroys a topology_description. | |
bool | has_readable_server (const mongocxx::v_noabi::read_preference &pref) const |
Determines if the topology has a readable server available. Servers are filtered by the given read preferences only if the driver is connected to a replica set, otherwise the read preferences are ignored. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O. | |
bool | has_writable_server () const |
Determines if the topology has a writable server available, such as a primary, mongos, or standalone. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O. | |
server_descriptions | servers () const |
Fetches descriptions for all known servers in the topology. | |
bsoncxx::v_noabi::stdx::string_view | type () const |
The topology type: "Unknown", "Sharded", "ReplicaSetNoPrimary", "ReplicaSetWithPrimary", or "Single". | |
mongocxx::v_noabi::events::topology_description::~topology_description | ( | ) |
Destroys a topology_description.
bool mongocxx::v_noabi::events::topology_description::has_readable_server | ( | const mongocxx::v_noabi::read_preference & | pref | ) | const |
Determines if the topology has a readable server available. Servers are filtered by the given read preferences only if the driver is connected to a replica set, otherwise the read preferences are ignored. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O.
bool mongocxx::v_noabi::events::topology_description::has_writable_server | ( | ) | const |
Determines if the topology has a writable server available, such as a primary, mongos, or standalone. This function uses the driver's current knowledge of the state of the MongoDB server or servers it is connected to; it does no I/O.
server_descriptions mongocxx::v_noabi::events::topology_description::servers | ( | ) | const |
Fetches descriptions for all known servers in the topology.
bsoncxx::v_noabi::stdx::string_view mongocxx::v_noabi::events::topology_description::type | ( | ) | const |
The topology type: "Unknown", "Sharded", "ReplicaSetNoPrimary", "ReplicaSetWithPrimary", or "Single".