Infinispan HotRod C++ Client  8.3.1.Final
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
InetSocketAddress.h
Go to the documentation of this file.
1 #ifndef ISPN_HOTROD_TRANSPORT_INETSOCKETADDRESS_H
2 #define ISPN_HOTROD_TRANSPORT_INETSOCKETADDRESS_H
3 
5 
6 #include <set>
7 #include <string>
8 #include <iostream>
9 
10 namespace infinispan {
11 namespace hotrod {
12 namespace transport {
13 
14 class InetSocketAddress
15 {
16  public:
17  InetSocketAddress() : hostname(""), port(0) {};
18  HR_EXPORT InetSocketAddress(const std::string& host, int p);
19  InetSocketAddress(const InetSocketAddress& other): hostname(other.hostname), addresses(other.addresses), port(other.port) {
20  }
21 
22  HR_EXPORT const std::string& getHostname() const;
23  HR_EXPORT const std::set<std::string>& getAddresses() const;
24  HR_EXPORT int getPort() const;
25 
26  HR_EXPORT bool operator ==(const InetSocketAddress& rhs) const;
27  HR_EXPORT bool operator <(const InetSocketAddress& rhs) const;
28  HR_EXPORT InetSocketAddress& operator=(infinispan::hotrod::transport::InetSocketAddress const&);
29  HR_EXPORT friend std::ostream& operator<<(std::ostream& os, const InetSocketAddress& isa);
30  bool isEmpty() { return port==0 && hostname.empty(); }
31 
32  private:
33  std::string hostname;
34  std::set<std::string> addresses;
35  int port;
36 
37  HR_EXPORT bool isSameHost(const std::set<std::string>& lhs, const std::set<std::string>& rhs) const;
38 };
39 
40 }}} // namespace infinispan::hotrod::transport
41 
42 #endif /* ISPN_HOTROD_TRANSPORT_INETSOCKETADDRESS_H */
#define HR_EXPORT
Definition: ImportExport.h:26