#include <TrackerResponse.h> [code]
This class is used to store all needed tracker response properties. It provides value semantics (objects copying allowed) and implicit data sharing.
Response structure is made according to this specification: http://wiki.theory.org/BitTorrentSpecification#Tracker_Response .
If the return value of failureReason() member function is not empty, then the original request to the tracker failed. If so, other getters will return default (e.g. empty) values. If there were no problem, failureReason() would return an empty string and other member functions would return values that were specified in the response, but only if the response was valid and was parsed correctly! See TrackerResponseParser for more details about parsing.
It does not throw its own exceptions and lets any thrown exceptions through to the user. In case an exception (e.g. bad_alloc) gets thrown, the TrackerResponse object will be left in an unchanged state. Thus the class meets the strong guarantee of exception safety.
Definition at line 61 of file TrackerResponse.h.
Public Types | |
| typedef QList< PeerInfo > | PeerInfoList |
| List of information about peers. | |
Public Member Functions | |
| TrackerResponse (const TrackerResponse &) | |
| Copy constructor. | |
| TrackerResponse & | operator= (const TrackerResponse &) |
| Assignment operator. | |
| bool | operator== (const TrackerResponse &) const |
| Equality comparison. | |
| bool | operator!= (const TrackerResponse &) const |
| Inequality comparison. | |
| TrackerResponse () | |
| Default constructor. | |
| ~TrackerResponse () | |
| Destructor. | |
| QString | failureReason () const |
| QString | warningMessage () const |
| uint | interval () const |
| uint | minInterval () const |
| QByteArray | trackerId () const |
| uint | complete () const |
| uint | incomplete () const |
| PeerInfoList | peers () const |
Private Attributes | |
| QSharedDataPointer< PrivateData > | d |
| Private data with implicit sharing. | |
Friends | |
| class | TrackerResponseParser |
Classes | |
| struct | PrivateData |
| Stores the private members of TrackerResponse using implicit sharing. More... | |
|
|
List of information about peers.
Definition at line 68 of file TrackerResponse.h. |
|
|
Copy constructor.
Definition at line 54 of file TrackerResponse.cpp. |
|
|
Default constructor. Constructs an empty TrackerResponse object. Definition at line 31 of file TrackerResponse.cpp. |
|
|
Destructor. Destroys a TrackerResponse object. Definition at line 44 of file TrackerResponse.cpp. |
|
|
Definition at line 133 of file TrackerResponse.h. |
|
|
Return value will be non-empty only if the original request to the tracker failed. See class description for more info. Definition at line 109 of file TrackerResponse.h. |
|
|
Definition at line 137 of file TrackerResponse.h. |
|
|
Definition at line 121 of file TrackerResponse.h. |
|
|
Definition at line 125 of file TrackerResponse.h. |
|
|
Inequality comparison.
Definition at line 94 of file TrackerResponse.cpp. |
|
|
Assignment operator.
Definition at line 64 of file TrackerResponse.cpp. |
|
|
Equality comparison.
Definition at line 76 of file TrackerResponse.cpp. |
|
|
Definition at line 141 of file TrackerResponse.h. |
|
|
Definition at line 129 of file TrackerResponse.h. |
|
|
This is similar to failure reason, but the response still got processed normally, so other data are present. Definition at line 117 of file TrackerResponse.h. |
|
|
Definition at line 86 of file TrackerResponse.h. |
|
|
Private data with implicit sharing.
Definition at line 101 of file TrackerResponse.h. |