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

Providing networking functionality. More...

#include <VisualDownloadQueue.h>

List of all members.

Classes

struct  DownloadItem
 A DownloadItem is an item of the download queue where data is retrieved from a remote source. More...

Static Public Member Functions

static void dispose (void)
 Disposes the VisualDownloadQueue.
static bool addToDownloadQueue (const VisualString &aURL, VisualObject *theRequestingObject, const VisualItemIdentifier &identifier)
 Adds a URL to the download queue.
static bool removeDownload (const VisualItemIdentifier &identifier)
 Removes an item from the download queue.
static bool removeDownloadForObject (const VisualItemIdentifier &visualObjectIdentifier)
 Removes an item from the download queue.
static bool startDownloadThreadIfNeeded (void)
 If download items are waiting to be fetched, the download process is started.
static void setDownloadIsProcessingToFalse (void)
 Set the internal variable downloadIsProcessing to false.

Private Types

typedef std::vector< DownloadItemDownloadQueue
 An downloadQueue is a queue of scheduled and running downloads.
typedef DownloadQueue::iterator DownloadQueueIterator
 An DownloadQueueIterator is an iterator of a DownloadQueue.
typedef std::vector< DownloadItemDownloadAddRequestQueue
 An DownloadAddRequestQueue is a queue of DownloadItems which are supposed to be added as soon as possible.
typedef
DownloadAddRequestQueue::iterator 
DownloadAddRequestQueueIterator
 An DownloadAddRequestQueueIterator is an iterator of a DownloadAddRequestQueue.
typedef std::vector
< VisualItemIdentifier
DownloadStopRequestQueue
 An DownloadStopRequestQueue is a queue of VisualItemIdentifiers of DownloadItems which are supposed to be stopped as soon as possible.
typedef
DownloadStopRequestQueue::iterator 
DownloadStopRequestQueueIterator
 An DownloadStopRequestQueueIterator is an iterator of a DownloadStopRequestQueue.

Private Member Functions

 VisualDownloadQueue ()
 The constructor.
 ~VisualDownloadQueue ()
 The destructor.
 VisualDownloadQueue (const VisualDownloadQueue &other)
 Copy constructor.
VisualDownloadQueueoperator= (const VisualDownloadQueue &other)
 Assignment operator.
bool shouldStartDownload (void)
 Answers the question whether there are download items waiting to be fetched.

Static Private Member Functions

static VisualDownloadQueuegetInstance (void)
 Constructs a VisualDownloadQueue.

Private Attributes

DownloadQueue downloadQueue
 The queue with the scheduled and running downloads of remote data.
DownloadAddRequestQueue downloadAddRequestQueue
 The queue with the add requests.
bool downloadAddRequestQueueIsEmpty
 Synchronized flag which answers whether the downloadAddRequestQueue is empty or not.
DownloadStopRequestQueue downloadStopRequestQueue
 The queue with the stop requests.
bool downloadIsProcessing
 Answers the question whether currently download data is being fetched.
bool stopDownloadProcess
 Signal to stop the download process by external thread.

Static Private Attributes

static VisualDownloadQueuetheVisualDownloadQueue = NULL
 VisualDownloadQueue is a singleton class.

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 May 3 2015 20:26:31 for VizKit by doxygen 1.8.0