Logo Search packages:      
Sourcecode: dc-qt version File versions  Download package

DownloadManager Class Reference

#include <DownloadManager.h>

Inheritance diagram for DownloadManager:

List of all members.


Detailed Description

Singleton. Use its listener interface to update the download list in the user interface.

Definition at line 168 of file DownloadManager.h.


Public Member Functions

void abortDownload (const string &aTarget)
void addConnection (UserConnection::Ptr conn)
void addListener (Listener *aListener)
template<typename T0, class T1, class T2, class T3, class T4, class T5, class T6>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5, const T6 &p6) throw ()
template<typename T0, class T1, class T2, class T3, class T4, class T5>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4, const T5 &p5) throw ()
template<typename T0, class T1, class T2, class T3, class T4>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3, const T4 &p4) throw ()
template<typename T0, class T1, class T2, class T3>
void fire (T0 type, const T1 &p1, const T2 &p2, const T3 &p3) throw ()
template<typename T0, class T1, class T2>
void fire (T0 type, const T1 &p1, const T2 &p2) throw ()
template<typename T0, class T1>
void fire (T0 type, const T1 &p1) throw ()
template<typename T0>
void fire (T0 type) throw ()
int getAverageSpeed ()
size_t getDownloadCount ()
void removeListener (Listener *aListener)
void removeListeners ()

Static Public Member Functions

static void deleteInstance ()
static T * getInstance ()
static void newInstance ()

Protected Attributes

CriticalSection listenerCS
ListenerList listeners
ListenerList tmp

Static Protected Attributes

static T * instance = NULL

Private Types

enum  { MOVER_LIMIT = 10*1024*1024 }
typedef X< 20 > ADCGet
typedef X< 21 > ADCSnd
typedef X< 22 > ADCSta
typedef X< 0 > BytesSent
typedef X< 4 > CLock
typedef X< 1 > Connected
typedef X< 2 > Data
typedef X< 6 > Direction
typedef X< 3 > Failed
typedef X< 11 > FileLength
typedef X< 19 > FileNotAvailable
typedef X< 7 > Get
typedef X< 8 > GetBlock
typedef X< 13 > GetListLength
typedef X< 9 > GetZBlock
typedef X< 5 > Key
typedef X< 14 > MaxedOut
typedef X< 1 > Minute
typedef X< 15 > ModeChange
typedef X< 16 > MyNick
typedef X< 0 > Second
typedef X< 12 > Send
typedef X< 10 > Sending
typedef X< 18 > Supports
typedef X< 17 > TransmitDone

Private Member Functions

u_int32_t calcCrc32 (const string &file) throw (FileException)
void checkDownloads (UserConnection *aConn)
bool checkRollback (Download *aDownload, const u_int8_t *aBuf, int aLen) throw (FileException)
bool checkSfv (UserConnection *aSource, Download *d, u_int32_t crc)
void fileNotAvailable (UserConnection *aSource)
int64_t getResumePos (const string &file, const TigerTree &tt, int64_t startPos)
void handleEndData (UserConnection *aSource)
void logDownload (UserConnection *aSource, Download *d)
void moveFile (const string &source, const string &target)
void noSlots (UserConnection *aSource)
virtual void on (AdcCommand::GFI, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::RES, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::GET, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::NTD, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::INF, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::SUP, UserConnection *, const AdcCommand &) throw ()
virtual void on (Supports, UserConnection *, const StringList &) throw ()
virtual void on (GetBlock, UserConnection *, const string &, int64_t, int64_t) throw ()
virtual void on (Get, UserConnection *, const string &, int64_t) throw ()
virtual void on (CLock, UserConnection *, const string &, const string &) throw ()
virtual void on (BytesSent, UserConnection *, size_t, size_t) throw ()
virtual void on (TimerManagerListener::Second, u_int32_t aTick) throw ()
virtual void on (AdcCommand::STA, UserConnection *, const AdcCommand &) throw ()
virtual void on (AdcCommand::SND, UserConnection *, const AdcCommand &) throw ()
virtual void on (FileNotAvailable, UserConnection *) throw ()
virtual void on (MaxedOut, UserConnection *) throw ()
virtual void on (FileLength, UserConnection *, int64_t) throw ()
virtual void on (Sending, UserConnection *, int64_t) throw ()
virtual void on (Failed, UserConnection *, const string &) throw ()
virtual void on (Data, UserConnection *, const u_int8_t *, size_t) throw ()
bool prepareFile (UserConnection *aSource, int64_t newSize, bool z)
void removeConnection (UserConnection::Ptr aConn, bool reuse=false, bool ntd=false)
void removeDownload (Download *aDown)

Private Attributes

CriticalSection cs
Download::List downloads
DownloadManager::FileMover mover

Friends

class Singleton< DownloadManager >

Classes

class  FileMover

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index