diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-04-05 14:49:02 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-06 16:08:02 +0200 |
commit | b0aa023aa2e08fb24eb1220c92bec02df3df8c90 (patch) | |
tree | 1660f4eb0b552ff32bb86f47f6ac7f9cca7878ac /src/network/kernel | |
parent | 7d63fa6edcbe706bf0eab2c7e24efa1ed8940e6d (diff) |
QtNetwork: add member-swap to shared classes
Implemented as in other shared classes (e.g. QPen).
Change-Id: Ib3d87ff99603e617cc8810489f9f5e9fe054cd2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/qdnslookup.cpp | 30 | ||||
-rw-r--r-- | src/network/kernel/qdnslookup.h | 10 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.cpp | 16 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.h | 5 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy.cpp | 16 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy.h | 6 |
6 files changed, 83 insertions, 0 deletions
diff --git a/src/network/kernel/qdnslookup.cpp b/src/network/kernel/qdnslookup.cpp index a826422978..f962b2ee3d 100644 --- a/src/network/kernel/qdnslookup.cpp +++ b/src/network/kernel/qdnslookup.cpp @@ -545,6 +545,12 @@ QDnsDomainNameRecord &QDnsDomainNameRecord::operator=(const QDnsDomainNameRecord d = other.d; return *this; } +/*! + \fn void QDnsDomainNameRecord::swap(QDnsDomainNameRecord &other) + + Swaps this domain-name record instance with \a other. This + function is very fast and never fails. +*/ /*! \class QDnsHostAddressRecord @@ -623,6 +629,12 @@ QDnsHostAddressRecord &QDnsHostAddressRecord::operator=(const QDnsHostAddressRec d = other.d; return *this; } +/*! + \fn void QDnsHostAddressRecord::swap(QDnsHostAddressRecord &other) + + Swaps this host address record instance with \a other. This + function is very fast and never fails. +*/ /*! \class QDnsMailExchangeRecord @@ -712,6 +724,12 @@ QDnsMailExchangeRecord &QDnsMailExchangeRecord::operator=(const QDnsMailExchange d = other.d; return *this; } +/*! + \fn void QDnsMailExchangeRecord::swap(QDnsMailExchangeRecord &other) + + Swaps this mail exchange record with \a other. This function is + very fast and never fails. +*/ /*! \class QDnsServiceRecord @@ -826,6 +844,12 @@ QDnsServiceRecord &QDnsServiceRecord::operator=(const QDnsServiceRecord &other) d = other.d; return *this; } +/*! + \fn void QDnsServiceRecord::swap(QDnsServiceRecord &other) + + Swaps this service record instance with \a other. This function is + very fast and never fails. +*/ /*! \class QDnsTextRecord @@ -906,6 +930,12 @@ QDnsTextRecord &QDnsTextRecord::operator=(const QDnsTextRecord &other) d = other.d; return *this; } +/*! + \fn void QDnsTextRecord::swap(QDnsTextRecord &other) + + Swaps this text record instance with \a other. This function is + very fast and never fails. +*/ void QDnsLookupPrivate::_q_lookupFinished(const QDnsLookupReply &_reply) { diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h index 89e8cbb852..f9f7261cbe 100644 --- a/src/network/kernel/qdnslookup.h +++ b/src/network/kernel/qdnslookup.h @@ -69,6 +69,8 @@ public: QDnsDomainNameRecord(const QDnsDomainNameRecord &other); ~QDnsDomainNameRecord(); + void swap(QDnsDomainNameRecord &other) { qSwap(d, other.d); } + QString name() const; quint32 timeToLive() const; QString value() const; @@ -87,6 +89,8 @@ public: QDnsHostAddressRecord(const QDnsHostAddressRecord &other); ~QDnsHostAddressRecord(); + void swap(QDnsHostAddressRecord &other) { qSwap(d, other.d); } + QString name() const; quint32 timeToLive() const; QHostAddress value() const; @@ -105,6 +109,8 @@ public: QDnsMailExchangeRecord(const QDnsMailExchangeRecord &other); ~QDnsMailExchangeRecord(); + void swap(QDnsMailExchangeRecord &other) { qSwap(d, other.d); } + QString exchange() const; QString name() const; quint16 preference() const; @@ -124,6 +130,8 @@ public: QDnsServiceRecord(const QDnsServiceRecord &other); ~QDnsServiceRecord(); + void swap(QDnsServiceRecord &other) { qSwap(d, other.d); } + QString name() const; quint16 port() const; quint16 priority() const; @@ -145,6 +153,8 @@ public: QDnsTextRecord(const QDnsTextRecord &other); ~QDnsTextRecord(); + void swap(QDnsTextRecord &other) { qSwap(d, other.d); } + QString name() const; quint32 timeToLive() const; QList<QByteArray> values() const; diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index 947b2ab0d9..422585113a 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -185,6 +185,14 @@ QNetworkAddressEntry &QNetworkAddressEntry::operator=(const QNetworkAddressEntry } /*! + \fn void QNetworkAddressEntry::swap(QNetworkAddressEntry &other) + \since 5.0 + + Swaps this network address entry instance with \a other. This + function is very fast and never fails. +*/ + +/*! Destroys this QNetworkAddressEntry object. */ QNetworkAddressEntry::~QNetworkAddressEntry() @@ -417,6 +425,14 @@ QNetworkInterface &QNetworkInterface::operator=(const QNetworkInterface &other) } /*! + \fn void QNetworkInterface::swap(QNetworkInterface &other) + \since 5.0 + + Swaps this network interface instance with \a other. This function + is very fast and never fails. +*/ + +/*! Returns true if this QNetworkInterface object contains valid information about a network interface. */ diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index dfdbb789fa..6ce5a9126a 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -63,6 +63,9 @@ public: QNetworkAddressEntry(const QNetworkAddressEntry &other); QNetworkAddressEntry &operator=(const QNetworkAddressEntry &other); ~QNetworkAddressEntry(); + + void swap(QNetworkAddressEntry &other) { qSwap(d, other.d); } + bool operator==(const QNetworkAddressEntry &other) const; inline bool operator!=(const QNetworkAddressEntry &other) const { return !(*this == other); } @@ -101,6 +104,8 @@ public: QNetworkInterface &operator=(const QNetworkInterface &other); ~QNetworkInterface(); + void swap(QNetworkInterface &other) { qSwap(d, other.d); } + bool isValid() const; int index() const; diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 7a10ecf7ed..21d5748562 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -511,6 +511,14 @@ QNetworkProxy &QNetworkProxy::operator=(const QNetworkProxy &other) } /*! + \fn void QNetworkProxy::swap(QNetworkProxy &other) + \since 5.0 + + Swaps this network proxy instance with \a other. This function is + very fast and never fails. +*/ + +/*! Sets the proxy type for this instance to be \a type. Note that changing the type of a proxy does not change @@ -1132,6 +1140,14 @@ QNetworkProxyQuery &QNetworkProxyQuery::operator=(const QNetworkProxyQuery &othe } /*! + \fn void QNetworkProxyQuery::swap(QNetworkProxyQuery &other) + \since 5.0 + + Swaps this network proxy query instance with \a other. This + function is very fast and never fails. +*/ + +/*! Returns true if this QNetworkProxyQuery object contains the same data as \a other. */ diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h index 2e5c3ed687..5287546849 100644 --- a/src/network/kernel/qnetworkproxy.h +++ b/src/network/kernel/qnetworkproxy.h @@ -86,6 +86,9 @@ public: #endif ~QNetworkProxyQuery(); QNetworkProxyQuery &operator=(const QNetworkProxyQuery &other); + + void swap(QNetworkProxyQuery &other) { qSwap(d, other.d); } + bool operator==(const QNetworkProxyQuery &other) const; inline bool operator!=(const QNetworkProxyQuery &other) const { return !(*this == other); } @@ -147,6 +150,9 @@ public: QNetworkProxy(const QNetworkProxy &other); QNetworkProxy &operator=(const QNetworkProxy &other); ~QNetworkProxy(); + + void swap(QNetworkProxy &other) { qSwap(d, other.d); } + bool operator==(const QNetworkProxy &other) const; inline bool operator!=(const QNetworkProxy &other) const { return !(*this == other); } |