Represents an address of a client or member in the cluster.
More...
#include <address.h>
|
| static constexpr int | ID = 0 |
Represents an address of a client or member in the cluster.
Definition at line 36 of file address.h.
◆ address() [1/3]
| hazelcast::client::address::address |
( |
std::string | hostname, |
|
|
int | port, |
|
|
unsigned long | scope_id ) |
Definition at line 549 of file client_impl.cpp.
550 : host_(std::move(hostname))
551 , port_(port)
552 , type_(IPV6)
553 , scope_id_(scope_id)
554{}
◆ address() [2/3]
| hazelcast::client::address::address |
( |
| ) |
|
Constructor.
Definition at line 536 of file client_impl.cpp.
537 : host_("localhost")
538 , type_(IPV4)
539 , scope_id_(0)
540{}
◆ address() [3/3]
| hazelcast::client::address::address |
( |
std::string | url, |
|
|
int | port ) |
Definition at line 542 of file client_impl.cpp.
543 : host_(std::move(url))
544 , port_(port)
545 , type_(IPV4)
546 , scope_id_(0)
547{}
◆ get_host()
| const std::string & hazelcast::client::address::get_host |
( |
| ) |
const |
- Returns
- host address as string
Definition at line 576 of file client_impl.cpp.
577{
578 return host_;
579}
◆ get_port()
| int hazelcast::client::address::get_port |
( |
| ) |
const |
- Returns
- port number.
Definition at line 570 of file client_impl.cpp.
571{
572 return port_;
573}
◆ get_scope_id()
| unsigned long hazelcast::client::address::get_scope_id |
( |
| ) |
const |
◆ is_ip_v4()
| bool hazelcast::client::address::is_ip_v4 |
( |
| ) |
const |
- Returns
- true if the address is ip V4 address, false otherwise.
Definition at line 600 of file client_impl.cpp.
601{
602 return type_ == IPV4;
603}
◆ operator!=()
| bool hazelcast::client::address::operator!= |
( |
const address & | address | ) |
const |
- Parameters
-
Definition at line 564 of file client_impl.cpp.
565{
566 return !(*this == rhs);
567}
◆ operator<()
| bool hazelcast::client::address::operator< |
( |
const address & | rhs | ) |
const |
Definition at line 581 of file client_impl.cpp.
583{
584 if (host_ < rhs.host_) {
585 return true;
586 }
587 if (rhs.host_ < host_) {
588 return false;
589 }
590 if (port_ < rhs.port_) {
591 return true;
592 }
593 if (rhs.port_ < port_) {
594 return false;
595 }
596 return type_ < rhs.type_;
597}
◆ operator==()
| bool hazelcast::client::address::operator== |
( |
const address & | address | ) |
const |
- Parameters
-
Definition at line 557 of file client_impl.cpp.
558{
559 return rhs.port_ == port_ && rhs.type_ == type_ &&
560 0 == rhs.host_.compare(host_);
561}
◆ to_string()
| std::string hazelcast::client::address::to_string |
( |
| ) |
const |
Definition at line 612 of file client_impl.cpp.
613{
614 std::ostringstream out;
616 return out.str();
617}
const std::string & get_host() const
◆ serialization::hz_serializer< address >
◆ std::hash< hazelcast::client::address >
◆ ID
| int hazelcast::client::address::ID = 0 |
|
staticconstexpr |
The documentation for this class was generated from the following files: