#include <hostandport.h>
Public Member Functions | |
| bool | hasPort () const |
| string | host () const |
| HostAndPort (const SockAddr &sock) | |
| HostAndPort (string h, int p) | |
| HostAndPort (string s) | |
| HostAndPort () | |
| bool | isLocalHost () const |
| bool | isSelf () const |
| operator string () const | |
| bool | operator!= (const HostAndPort &r) const |
| bool | operator< (const HostAndPort &r) const |
| bool | operator== (const HostAndPort &r) const |
| int | port () const |
| void | setPort (int port) |
| string | toString () const |
Static Public Member Functions | |
| static HostAndPort | Me () |
| static HostAndPort | me () |
Private Attributes | |
| string | _host |
| int | _port |
helper for manipulating host:port connection endpoints.
Definition at line 29 of file hostandport.h.
| mongo::HostAndPort::HostAndPort | ( | ) | [inline] |
Definition at line 30 of file hostandport.h.
| mongo::HostAndPort::HostAndPort | ( | string | s | ) | [inline] |
From a string hostname[:portnumber] Throws user assertion if bad config string or bad port #.
Definition at line 155 of file hostandport.h.
| mongo::HostAndPort::HostAndPort | ( | string | h, | |
| int | p | |||
| ) | [inline] |
| p | port number. -1 is ok to use default. |
Definition at line 38 of file hostandport.h.
| mongo::HostAndPort::HostAndPort | ( | const SockAddr & | sock | ) | [inline] |
Definition at line 40 of file hostandport.h.
| bool mongo::HostAndPort::hasPort | ( | ) | const [inline] |
Definition at line 80 of file hostandport.h.
| string mongo::HostAndPort::host | ( | ) | const [inline] |
Definition at line 77 of file hostandport.h.
| bool mongo::HostAndPort::isLocalHost | ( | ) | const [inline] |
Definition at line 151 of file hostandport.h.
| bool mongo::HostAndPort::isSelf | ( | ) | const |
| HostAndPort mongo::HostAndPort::Me | ( | ) | [inline, static] |
Definition at line 107 of file hostandport.h.
| static HostAndPort mongo::HostAndPort::me | ( | ) | [inline, static] |
Definition at line 44 of file hostandport.h.
| mongo::HostAndPort::operator string | ( | ) | const [inline] |
Definition at line 75 of file hostandport.h.
| bool mongo::HostAndPort::operator!= | ( | const HostAndPort & | r | ) | const [inline] |
Definition at line 63 of file hostandport.h.
| bool mongo::HostAndPort::operator< | ( | const HostAndPort & | r | ) | const [inline] |
Definition at line 51 of file hostandport.h.
| bool mongo::HostAndPort::operator== | ( | const HostAndPort & | r | ) | const [inline] |
Definition at line 59 of file hostandport.h.
| int mongo::HostAndPort::port | ( | ) | const [inline] |
Definition at line 79 of file hostandport.h.
| void mongo::HostAndPort::setPort | ( | int | port | ) | [inline] |
Definition at line 81 of file hostandport.h.
| string mongo::HostAndPort::toString | ( | ) | const [inline] |
Definition at line 132 of file hostandport.h.
string mongo::HostAndPort::_host [private] |
Definition at line 85 of file hostandport.h.
int mongo::HostAndPort::_port [private] |
Definition at line 86 of file hostandport.h.