class DownloadManager

A multiple concurrent downloads manager class.

Constructors

DownloadManager (const int, DownloadManager::DownloadEvent, var)Constructs a new instance of the download manager.

Methods

int AddDownload (const string)Adds a new download to the manager.
int AddDownload (const string, const string)Additionally passes a referrer string for the new download to add.
int CheckComplete ()Checks if there are completed downloads in the queue and if so, removes them.
int WaitComplete ()Waits until all remaining downloads in the queue have been completed.

Properties

int Capacity ()Returns the number of concurrent downloads this manager can handle.
int Size ()Returns the actual number of active downloads in the queue.

Reference

method DownloadManager (const int capacity, DownloadManager::DownloadEvent fn, var args)

Constructs a new instance of the download manager.

The capacity specifies the number of simultaneous downloads the manager can handle. The specified delegate will be called when a download has completed or failed. Parameter 'args' will be passed on to the delegate as user data.


method int AddDownload (const string url)

Adds a new download to the manager.

This function will block if there are no more free slots in the queue for the download and wait until another download has finished.


method int AddDownload (const string url, const string ref)

Additionally passes a referrer string for the new download to add.


method int CheckComplete ()

Checks if there are completed downloads in the queue and if so, removes them.

Unlike WaitComplete(), this function does not block. The function returns the number of downloads still active.


method int WaitComplete ()

Waits until all remaining downloads in the queue have been completed.


accessor int Capacity ()

Returns the number of concurrent downloads this manager can handle.


accessor int Size ()

Returns the actual number of active downloads in the queue.