VizKit  3.0
Classes | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
VizKit::VisualDownloadQueue Class Reference

#include <VisualDownloadQueue.h>

List of all members.

Classes

struct  DownloadItem

Static Public Member Functions

static void dispose (void)
static bool addToDownloadQueue (const VisualString &aURL, VisualObject *theRequestingObject, const VisualItemIdentifier &identifier)
static bool removeDownload (const VisualItemIdentifier &identifier)
static bool removeDownloadForObject (const VisualItemIdentifier &visualObjectIdentifier)
static bool startDownloadThreadIfNeeded (void)
static void setDownloadIsProcessingToFalse (void)

Private Types

typedef std::vector< DownloadItemDownloadQueue
typedef DownloadQueue::iterator DownloadQueueIterator
typedef std::vector< DownloadItemDownloadAddRequestQueue
typedef
DownloadAddRequestQueue::iterator 
DownloadAddRequestQueueIterator
typedef std::vector
< VisualItemIdentifier
DownloadStopRequestQueue
typedef
DownloadStopRequestQueue::iterator 
DownloadStopRequestQueueIterator

Private Member Functions

 VisualDownloadQueue ()
 ~VisualDownloadQueue ()
 VisualDownloadQueue (const VisualDownloadQueue &other)
VisualDownloadQueueoperator= (const VisualDownloadQueue &other)
bool shouldStartDownload (void)

Static Private Member Functions

static VisualDownloadQueuegetInstance (void)

Private Attributes

DownloadQueue downloadQueue
DownloadAddRequestQueue downloadAddRequestQueue
bool downloadAddRequestQueueIsEmpty
DownloadStopRequestQueue downloadStopRequestQueue
bool downloadIsProcessing
bool stopDownloadProcess

Static Private Attributes

static VisualDownloadQueuetheVisualDownloadQueue = NULL

Detailed Description

Providing networking functionality.


Member Typedef Documentation

An DownloadAddRequestQueue is a queue of DownloadItems which are supposed to be added as soon as possible.

typedef DownloadAddRequestQueue::iterator VizKit::VisualDownloadQueue::DownloadAddRequestQueueIterator [private]

An DownloadAddRequestQueueIterator is an iterator of a DownloadAddRequestQueue.

An downloadQueue is a queue of scheduled and running downloads.

typedef DownloadQueue::iterator VizKit::VisualDownloadQueue::DownloadQueueIterator [private]

An DownloadQueueIterator is an iterator of a DownloadQueue.

An DownloadStopRequestQueue is a queue of VisualItemIdentifiers of DownloadItems which are supposed to be stopped as soon as possible.

typedef DownloadStopRequestQueue::iterator VizKit::VisualDownloadQueue::DownloadStopRequestQueueIterator [private]

An DownloadStopRequestQueueIterator is an iterator of a DownloadStopRequestQueue.


Constructor & Destructor Documentation

The constructor. VisualDownloadQueue is a singleton class. The constructor is private. New instance of class can only be created internally.

The destructor. VisualDownloadQueue is a singleton class. The destructor is private. Instance of class can only be destructed internally.

Copy constructor.

Parameters:
otherAnother VisualNetwork.
Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.

Member Function Documentation

bool VisualDownloadQueue::addToDownloadQueue ( const VisualString aURL,
VisualObject theRequestingObject,
const VisualItemIdentifier identifier 
) [static]

Adds a URL to the download queue.

Parameters:
aURLThe URL from where to fetch the data.
theRequestingObjectThe object requesting remote data.
identifierAn identifier of the download process.
Returns:
True on success, false on failure.
void VisualDownloadQueue::dispose ( void  ) [static]

Disposes the VisualDownloadQueue.

VisualDownloadQueue * VisualDownloadQueue::getInstance ( void  ) [static, private]

Constructs a VisualDownloadQueue. The VisualDownloadQueue acts as a singleton. Returns a pointer to the initialised VisualDownloadQueue.

Returns:
A pointer to the singleton instance.
VisualDownloadQueue& VizKit::VisualDownloadQueue::operator= ( const VisualDownloadQueue other) [private]

Assignment operator.

Remarks:
Explicitely declared in private section and not implemented to enforce uniqueness of singleton pattern.
bool VisualDownloadQueue::removeDownload ( const VisualItemIdentifier identifier) [static]

Removes an item from the download queue.

Parameters:
identifierIdentifier of the download item.
Returns:
True on success, false on failure.
bool VisualDownloadQueue::removeDownloadForObject ( const VisualItemIdentifier visualObjectIdentifier) [static]

Removes an item from the download queue.

Parameters:
visualObjectIdentifierIdentifier of the object.
Returns:
True on success, false on failure.

Set the internal variable downloadIsProcessing to false.

Remarks:
This is called after the download thread ended.
bool VisualDownloadQueue::shouldStartDownload ( void  ) [private]

Answers the question whether there are download items waiting to be fetched.

Returns:
True if download should start, false if not.
Remarks:
Download data is fetched in a separate thread.

If download items are waiting to be fetched, the download process is started.

Returns:
True if download process started, false if not.
Remarks:
Called by main loop. Download data is fetched in a separate thread.

Member Data Documentation

The queue with the add requests.

Synchronized flag which answers whether the downloadAddRequestQueue is empty or not.

Answers the question whether currently download data is being fetched.

The queue with the scheduled and running downloads of remote data.

The queue with the stop requests.

Signal to stop the download process by external thread.

VisualDownloadQueue is a singleton class. Pointer to private instance is handled internally.


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

Generated on Sun Mar 25 2012 14:27:43 for VizKit by doxygen 1.8.0