MongoDB C++ Driver legacy-1.1.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
mongo::ReplicaSetMonitor::SetState Struct Reference

Classes

struct  Node
 

Public Member Functions

 SetState (StringData name, const std::set< HostAndPort > &seedNodes)
 seedNodes must not be empty
 
HostAndPort getMatchingHost (const ReadPreferenceSetting &criteria) const
 Returns a host matching criteria or an empty host if no known host matches.
 
NodefindNode (const HostAndPort &host)
 Returns the Node with the given host, or NULL if no Node has that host.
 
NodefindOrCreateNode (const HostAndPort &host)
 Returns the Node with the given host, or creates one if no Node has that host.
 
void checkInvariants () const
 Before unlocking, do DEV checkInvariants();.
 

Member Function Documentation

◆ findOrCreateNode()

Node * mongo::ReplicaSetMonitor::SetState::findOrCreateNode ( const HostAndPort host)

Returns the Node with the given host, or creates one if no Node has that host.

Maintains the sorted order of nodes.

◆ getMatchingHost()

HostAndPort mongo::ReplicaSetMonitor::SetState::getMatchingHost ( const ReadPreferenceSetting criteria) const

Returns a host matching criteria or an empty host if no known host matches.

Note: Uses only local data and does not go over the network.


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