TrackerRequest.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "Qt.h"
00024 #include "TrackerRequest.h"
00025 #include "Imports.cpp"
00026
00028
00045 TrackerRequest::TrackerRequest (const Uri &announceUrl,
00046 const PeerInfo &peerInfo,
00047 const Torrent::InfoHash &infoHash,
00048 quint64 uploaded,
00049 quint64 downloaded,
00050 quint64 left,
00051 bool compact,
00052 Event event,
00053 uint numWant,
00054 QByteArray key,
00055 QByteArray trackerId)
00056 : d (new PrivateData())
00057 {
00058 Q_ASSERT (!announceUrl.scheme().isEmpty());
00059 Q_ASSERT (!announceUrl.authority().isEmpty());
00060
00061 d->announceUrl = announceUrl;
00062 d->peerInfo = peerInfo;
00063 d->infoHash = infoHash;
00064 d->uploaded = uploaded;
00065 d->downloaded = downloaded;
00066 d->left = left;
00067 d->compact = compact;
00068 d->event = event;
00069 d->numWant = numWant;
00070 d->key = key;
00071 d->trackerId = trackerId;
00072 }
00073
00075
00078 TrackerRequest::~TrackerRequest()
00079 {
00080 }
00081
00083
00088 TrackerRequest::TrackerRequest (const TrackerRequest &other)
00089 : d (other.d)
00090 {
00091 }
00092
00094
00098 TrackerRequest & TrackerRequest::operator= (const TrackerRequest &other)
00099 {
00100 d = other.d;
00101 return *this;
00102 }
00103
00105
00109 bool TrackerRequest::operator== (const TrackerRequest &other) const
00110 {
00111 return (d->announceUrl == other.d->announceUrl) &&
00112 (d->peerInfo == other.d->peerInfo) &&
00113 (d->infoHash == other.d->infoHash) &&
00114 (d->uploaded == other.d->uploaded) &&
00115 (d->downloaded == other.d->downloaded) &&
00116 (d->left == other.d->left) &&
00117 (d->compact == other.d->compact) &&
00118 (d->event == other.d->event) &&
00119 (d->numWant == other.d->numWant) &&
00120 (d->key == other.d->key) &&
00121 (d->trackerId == other.d->trackerId);
00122 }
00123
00125
00129 bool TrackerRequest::operator!= (const TrackerRequest &other) const
00130 {
00131 return !(*this == other);
00132 }