28 #ifndef AsyncComm_COMMADDRESS_H
29 #define AsyncComm_COMMADDRESS_H
37 #include <unordered_map>
118 return !(*
this == other);
199 return (
size_t)(addr.
inet.sin_addr.s_addr ^ addr.
inet.sin_port);
201 return std::hash<std::string>()(addr.
proxy);
207 template<
typename TypeT,
typename addr=CommAddress>
216 #endif // AsyncComm_COMMADDRESS_H
AddressType
Enumeration for address type.
CommAddress & operator=(sockaddr_in addr)
Sets address type to CommAddress::INET and inet value to addr.
std::string String
A String is simply a typedef to std::string.
bool operator==(const CommAddress &other) const
Equality operator.
Parameterized hash map for mapping CommAddress to arbitrary type.
Po::typed_value< String > * str(String *v=0)
CommAddress(const sockaddr_in addr)
Constructs a CommAddress object of type CommAddress::INET.
CommAddress()
Constructs an uninitialized CommAddress object.
bool operator<(const CommAddress &other) const
Less than operator.
void set_inet(sockaddr_in addr)
Sets address type to CommAddress::INET and inet value to addr.
Hash function (functor) for CommAddress objets.
Encapsulate an internet address.
Logging routines and macros.
void set_proxy(const String &str)
Sets address type to CommAddress::PROXY and proxy name to p.
String to_str() const
Returns string representation of address.
bool is_set() const
Returns true if address has been initialized.
bool is_inet() const
Returns true if address is of type CommAddress::INET.
std::set< CommAddress > CommAddressSet
Set of CommAddress objects.
Internet address wrapper classes and utility functions.
bool operator!=(const CommAddress &other) const
Inequality operator.
A String class based on std::string.
InetAddr inet
IPv4:port address.
size_t operator()(const CommAddress &addr) const
Parenthesis operator with a single CommAddress parameter.
bool is_proxy() const
Returns true if address is of type CommAddress::PROXY.
int32_t m_type
Address type.
Address abstraction to hold either proxy name or IPv4:port address.
void clear()
Clears address to uninitialized state.