#include <downloadlist.h>
Public Member Functions | |
| uint32_t | getSourceCount () const |
| uint64_t | getLastSrcExch () const |
| uint64_t | getLastUdpQuery () const |
| PartData * | getPartData () const |
| uint32_t | getSourceLimit () const |
| Hash< ED2KHash > | getHash () const |
| uint32_t | getSize () const |
| void | addSource (Client *c) |
| void | delSource (Client *c) |
| void | setSourceLimit (uint32_t l) |
| void | setLastSrcExch (uint64_t t) |
| std::vector< Source > | getSources () const |
| Generate a vector of sources, for sending with AnswerSources packet for example. | |
| bool | isSourceReqAllowed (Client *c) const |
| Check if a client is allowed to request sources for this file at this time. | |
Private Types | |
| typedef boost::tuple< uint32_t, uint16_t, uint32_t, uint16_t > | Source |
| identical to AnswerSources::Source | |
| typedef std::set< Client * >::const_iterator | CIter |
Private Member Functions | |
| Download (PartData *pd, const Hash< ED2KHash > &hash) | |
| Construct new Download; this is allowed only by DownloadList. | |
| ~Download () | |
| Destructor only allowed by DownloadList. | |
| Download (const Download &) | |
| Copy-construction is forbidden and not implemented. | |
| Download & | operator= (const Download &) |
| Assignment operator is forbidden and not implemented. | |
| void | destroy () |
| Called prior to this object's destruction, signals all sources that download is being destroyed. | |
Private Attributes | |
| PartData * | m_partData |
| Implementation object. | |
| Hash< ED2KHash > | m_hash |
| hash of this file | |
| std::set< Client * > | m_sources |
| list of sources of this file | |
| uint64_t | m_lastSrcExch |
| time of last source-exchange req | |
| uint32_t | m_sourceLimit |
| limit sources | |
| uint64_t | m_lastUdpQuery |
| last udp query time | |
Friends | |
| class | DownloadList |
| bool | operator< (const Download &x, const Download &y) |
It keeps track of which clients are offering this file, providing means of getting an overview of sources-per-file and cross-reference. Download objects are owned and managed by DownloadList class.
Definition at line 50 of file downloadlist.h.
|
|
identical to AnswerSources::Source
Definition at line 52 of file downloadlist.h. |
|
|
Definition at line 53 of file downloadlist.h. |
|
||||||||||||
|
Construct new Download; this is allowed only by DownloadList.
Definition at line 40 of file downloadlist.cpp. |
|
|
Destructor only allowed by DownloadList.
Definition at line 43 of file downloadlist.cpp. |
|
|
Copy-construction is forbidden and not implemented.
|
|
|
Definition at line 55 of file downloadlist.h. References m_sources. Referenced by isSourceReqAllowed(), Client::onPacket(), and Client::reaskForDownload(). |
|
|
Definition at line 56 of file downloadlist.h. References m_lastSrcExch. |
|
|
Definition at line 57 of file downloadlist.h. References m_lastUdpQuery. |
|
|
Definition at line 58 of file downloadlist.h. References m_partData. Referenced by Detail::SourceInfo::checkNeedParts(), Client::onPacket(), Client::reaskForDownload(), Detail::SourceInfo::remOffered(), Client::reqDownload(), Detail::SourceInfo::setPartMap(), and Detail::SourceInfo::~SourceInfo(). |
|
|
Definition at line 59 of file downloadlist.h. References m_sourceLimit. |
|
|
Definition at line 60 of file downloadlist.h. References m_hash. Referenced by Client::onPacket(), Client::reaskForDownload(), Client::reqDownload(), and ServerList::udpGetSources(). |
|
|
Definition at line 98 of file downloadlist.cpp. References m_partData. Referenced by ServerList::udpGetSources(). |
|
|
Definition at line 63 of file downloadlist.h. References m_sources. Referenced by Detail::SourceInfo::addOffered(). |
|
|
Definition at line 64 of file downloadlist.h. References m_sources. Referenced by Detail::SourceInfo::remOffered(). |
|
|
Definition at line 65 of file downloadlist.h. References m_sourceLimit. |
|
|
Definition at line 66 of file downloadlist.h. References m_lastSrcExch. Referenced by Client::onPacket(). |
|
|
Generate a vector of sources, for sending with AnswerSources packet for example. Up to 500 sources may be returned. Definition at line 85 of file downloadlist.cpp. References m_sources. Referenced by Client::onPacket(). |
|
|
Check if a client is allowed to request sources for this file at this time.
Definition at line 45 of file downloadlist.cpp. References getSourceCount(), m_lastSrcExch, m_sourceLimit, m_sources, SRCEXCH_CTIME, and SRCEXCH_FTIME. Referenced by Client::onPacket(). |
|
|
Assignment operator is forbidden and not implemented.
|
|
|
Called prior to this object's destruction, signals all sources that download is being destroyed.
Definition at line 100 of file downloadlist.cpp. References m_sources. |
|
|
Definition at line 84 of file downloadlist.h. |
|
||||||||||||
|
Definition at line 85 of file downloadlist.h. |
|
|
Implementation object.
Definition at line 111 of file downloadlist.h. Referenced by getPartData(), and getSize(). |
|
|
hash of this file
Definition at line 112 of file downloadlist.h. Referenced by getHash(). |
|
|
list of sources of this file
Definition at line 113 of file downloadlist.h. Referenced by addSource(), delSource(), destroy(), getSourceCount(), getSources(), and isSourceReqAllowed(). |
|
|
time of last source-exchange req
Definition at line 114 of file downloadlist.h. Referenced by getLastSrcExch(), isSourceReqAllowed(), and setLastSrcExch(). |
|
|
limit sources
Definition at line 115 of file downloadlist.h. Referenced by getSourceLimit(), isSourceReqAllowed(), and setSourceLimit(). |
|
|
last udp query time
Definition at line 116 of file downloadlist.h. Referenced by getLastUdpQuery(). |