00001 #ifndef QPID_ADDRESS_H
00002 #define QPID_ADDRESS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "qpid/sys/IntegerTypes.h"
00023
00024 #include <boost/variant.hpp>
00025 #include <string>
00026 #include <vector>
00027
00028 namespace qpid {
00029
00031 struct TcpAddress {
00032 static const uint16_t DEFAULT_PORT=5672;
00033 explicit TcpAddress(const std::string& host_=std::string(),
00034 uint16_t port_=DEFAULT_PORT)
00035 : host(host_), port(port_) {}
00036 std::string host;
00037 uint16_t port;
00038 };
00039
00040 inline bool operator==(const TcpAddress& x, const TcpAddress& y) {
00041 return y.host==x.host && y.port == x.port;
00042 }
00043
00045 struct Address : public boost::variant<TcpAddress> {
00046 template <class T> Address(const T& t) : boost::variant<TcpAddress>(t) {}
00047 template <class T> T* get() { return boost::get<T>(this); }
00048 template <class T> const T* get() const { return boost::get<T>(this); }
00049 };
00050
00051 }
00052
00053 #endif