18 #include "hazelcast/util/byte.h"
19 #include "hazelcast/util/export.h"
20 #include "hazelcast/client/serialization/serialization.h"
25 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
27 #pragma warning(disable: 4251)
40 address(std::string hostname, int port, unsigned long scope_id);
42 static constexpr int ID = 0;
49 address(std::string url, int port);
54 bool operator == (const address &address) const;
59 bool operator != (const address &address) const;
70 bool is_ip_v4() const;
75 const std::string& get_host() const;
77 unsigned long get_scope_id() const;
79 bool operator<(const address &rhs) const;
81 std::string to_string() const;
86 unsigned long scope_id_;
88 static constexpr byte IPV4 = 4;
89 static constexpr byte IPV6 = 6;
92 namespace serialization {
94 struct hz_serializer<address> : public identified_data_serializer {
95 static constexpr int32_t F_ID = 0;
96 static constexpr int32_t ADDRESS = 1;
97 static int32_t get_factory_id();
98 static int32_t get_class_id();
99 static void write_data(const address &object, object_data_output &out);
100 static address read_data(object_data_input &in);
104 std::ostream HAZELCAST_API &operator << (std::ostream &stream, const address &address);
110 struct HAZELCAST_API hash<hazelcast::client::address> {
111 std::size_t operator()(const hazelcast::client::address &address) const noexcept;
115 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
Represents an address of a client or member in the cluster.