#include <PeerInfo.h> [code]
Collaboration diagram for Protocols::BitTorrent::Trackers::PeerInfo:
Provides value semantics (objects copying is allowed).
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 TrackerRequest object will be left in an unchanged state. Thus the class meets the strong guarantee of exception safety.
Definition at line 45 of file PeerInfo.h.
Public Types | |
| typedef FixedSizeByteArray< 20 > | PeerId |
| Peer ID - used as a unique ID for the client (20B long). | |
Public Member Functions | |
| PeerInfo (const PeerInfo &) | |
| Copy constructor. | |
| PeerInfo & | operator= (const PeerInfo &) |
| Assignment operator. | |
| bool | operator== (const PeerInfo &) const |
| Equality comparison. | |
| bool | operator!= (const PeerInfo &) const |
| Inequality comparison. | |
| PeerInfo () | |
| Default constructor. | |
| PeerInfo (const QByteArray &host, uint port, const PeerId &peerId) | |
| Constructor. | |
| ~PeerInfo () | |
| Destructor. | |
| PeerId | peerId () const |
| QByteArray | host () const |
| uint | port () const |
| void | setPeerId (PeerId peerId) |
| Sets the peer ID. | |
| void | setHost (QByteArray host) |
| Sets the host. | |
| void | setPort (uint port) |
| Sets the port. | |
| Uri | toUri () const |
Static Public Member Functions | |
| static PeerInfo | fromUri (const Uri &peerInfo) |
| Named ctor for creating a PeerInfo object from URI object. | |
Private Attributes | |
| Uri | peerInfo |
Static Private Attributes | |
| static const char * | PeerSchemeName = "bt-peer" |
| BitPeerInfo peer scheme name. | |
| static const char * | PeerIdQueryItemKeyName = "id" |
| Name of the peer ID query item key in the PeerInfo query part. | |
| static const char * | PeerNullPort = "0" |
| Peer port default value. | |
| static const char * | PeerNullHost = "0.0.0.0" |
| Peer host default value. | |
|
|
Peer ID - used as a unique ID for the client (20B long).
Definition at line 52 of file PeerInfo.h. |
|
|
Copy constructor.
Definition at line 75 of file PeerInfo.cpp. |
|
|
Default constructor. Creates and initializes an empty PeerInfo object. It will have host set to "0.0.0.0", port will be set to zero and peer ID to 20B long array of zero bytes. Definition at line 33 of file PeerInfo.cpp. |
|
||||||||||||||||
|
Constructor.
Definition at line 51 of file PeerInfo.cpp. |
|
|
Destructor. Destroys a PeerInfo object. Definition at line 65 of file PeerInfo.cpp. |
|
|
Named ctor for creating a PeerInfo object from URI object.
Definition at line 196 of file PeerInfo.cpp. |
|
|
Definition at line 122 of file PeerInfo.cpp. |
|
|
Inequality comparison.
Definition at line 109 of file PeerInfo.cpp. |
|
|
Assignment operator.
Definition at line 85 of file PeerInfo.cpp. |
|
|
Equality comparison.
Definition at line 96 of file PeerInfo.cpp. |
|
|
Definition at line 115 of file PeerInfo.cpp. |
|
|
Definition at line 128 of file PeerInfo.cpp. |
|
|
Sets the host.
Definition at line 152 of file PeerInfo.cpp. |
|
|
Sets the peer ID.
Definition at line 137 of file PeerInfo.cpp. |
|
|
Sets the port.
Definition at line 162 of file PeerInfo.cpp. |
|
|
The URI will be in the following format: bt-peer://host:port?id=peerId
Definition at line 176 of file PeerInfo.cpp. |
|
|
Name of the peer ID query item key in the PeerInfo query part.
Definition at line 76 of file PeerInfo.h. |
|
|
Definition at line 73 of file PeerInfo.h. |
|
|
Peer host default value.
Definition at line 78 of file PeerInfo.h. |
|
|
Peer port default value.
Definition at line 77 of file PeerInfo.h. |
|
|
BitPeerInfo peer scheme name.
Definition at line 75 of file PeerInfo.h. |