MongoDB C++ Driver 4.2.0
Loading...
Searching...
No Matches
mongocxx::v1::events::server_description Class Reference

#include <mongocxx/v1/events/server_description.hpp>

Description

ServerDescription from the Server Discovery and Monitoring specification.

See also
Attention
This feature is experimental! It is not ready for use!

Public Member Functions

 server_description (server_description &&other) noexcept
 Move constructor.
 server_description (server_description const &other)
 Copy constructor.
 ~server_description ()
 Destroy this object.
bsoncxx::v1::document::view hello () const
 Return the raw server response to the "hello" command.
bsoncxx::v1::stdx::string_view host () const
 Return the hostname for the connection used by the command.
std::uint32_t id () const
 Return the client-generated unique server ID.
server_descriptionoperator= (server_description &&other) noexcept
 Move assignment.
server_descriptionoperator= (server_description const &other)
 Copy assignment.
std::uint16_t port () const
 Return the port number for the connection used by the command.
bsoncxx::v1::stdx::optional< std::int64_t > round_trip_time () const
 Return the client-measured execution time of the "hello" command.
bsoncxx::v1::stdx::string_view type () const
 Return the topology type.

Constructor & Destructor Documentation

◆ ~server_description()

mongocxx::v1::events::server_description::~server_description ( )

Destroy this object.

Warning
Invalidates all associated views.

◆ server_description() [1/2]

mongocxx::v1::events::server_description::server_description ( server_description && other)
noexcept

Move constructor.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ server_description() [2/2]

mongocxx::v1::events::server_description::server_description ( server_description const & other)

Copy constructor.

Member Function Documentation

◆ hello()

bsoncxx::v1::document::view mongocxx::v1::events::server_description::hello ( ) const

Return the raw server response to the "hello" command.

Returns
Empty when connection was unsuccessful or a client-side error was encountered.

◆ host()

bsoncxx::v1::stdx::string_view mongocxx::v1::events::server_description::host ( ) const

Return the hostname for the connection used by the command.

◆ id()

std::uint32_t mongocxx::v1::events::server_description::id ( ) const

Return the client-generated unique server ID.

Note
The server ID is unique only for the associated client or client pool.

◆ operator=() [1/2]

server_description & mongocxx::v1::events::server_description::operator= ( server_description && other)
noexcept

Move assignment.

Postconditions:
  • other is in an assign-or-destroy-only state.

◆ operator=() [2/2]

server_description & mongocxx::v1::events::server_description::operator= ( server_description const & other)

Copy assignment.

◆ port()

std::uint16_t mongocxx::v1::events::server_description::port ( ) const

Return the port number for the connection used by the command.

◆ round_trip_time()

bsoncxx::v1::stdx::optional< std::int64_t > mongocxx::v1::events::server_description::round_trip_time ( ) const

Return the client-measured execution time of the "hello" command.

◆ type()

bsoncxx::v1::stdx::string_view mongocxx::v1::events::server_description::type ( ) const

Return the topology type.

Returns
One of:
  • "LoadBalancer"
  • "Mongos"
  • "PossiblePrimary"
  • "RSArbiter"
  • "RSGhost"
  • "RSOther"
  • "RSPrimary"
  • "RSSecondary"
  • "Standalone"
  • "Unknown"

The documentation for this class was generated from the following file: