GlobalUploaderDownloader Class Reference

The class to create or remove associations and to wake all sleeping uploaders and downloaders. More...

Static Public Member Functions

template<class DataType >
static void associate (DataUploader< DataType > *uploader, DataDownloader< DataType > *downloader)
 The function to associate an uploader and a downloader. More...
 
template<class DataType1 , class DataType2 >
static void associate (DataUploaderDownloader< DataType1, DataType2 > *first, DataUploaderDownloader< DataType2, DataType1 > *second)
 The function to associate two DataUploaderDownloader. More...
 
template<class DataType >
static void detach (DataUploader< DataType > *uploader)
 Removes an association. More...
 
template<class DataType >
static void detach (DataDownloader< DataType > *downloader)
 Removes an association. More...
 
template<class DataType1 , class DataType2 >
static void detach (DataUploaderDownloader< DataType1, DataType2 > *uploaderDownloader)
 Removes an association. More...
 
static void stopAllDataExchanges ()
 Stops all data exchanges. More...
 

Friends

template<class DataType_t >
class __DataExchange_internal::QueueHolder
 QueueHolder is friend to access private members. More...
 
template<class DataType_t >
class DataDownloader
 DataDownloader is friend to access private members. More...
 
template<class DataType_t >
class DataUploader
 DataUploader is friend to access private members. More...
 

Detailed Description

The class to create or remove associations and to wake all sleeping uploaders and downloaders.

This class is a singleton and only has static public functions. This class is used for two purposes: creating or removing associations between uploaders and downloaders and stopping all data exchange. See the description of functions for more information.

Note
All functions in this class (both public and private) are thread-safe

Definition at line 950 of file dataexchange.h.

Member Function Documentation

void associate ( DataUploader< DataType > *  uploader,
DataDownloader< DataType > *  downloader 
)
static

The function to associate an uploader and a downloader.

Call this function to create an association between an uploader and a downloader. Both must not be associated with anything else (use detach in case they are), otherwise an exception is thrown

Parameters
uploaderthe uploader to associate with the downloader. Must not be NULL
downloaderthe downloader to associate with the uploader. Must not be NULL

Definition at line 1773 of file dataexchange.h.

void associate ( DataUploaderDownloader< DataType1, DataType2 > *  first,
DataUploaderDownloader< DataType2, DataType1 > *  second 
)
static

The function to associate two DataUploaderDownloader.

This is the same as the associate function working on a single channel but performs the association of the two ends of two DataUploaderDownloader objects at the same time. Both objects must not be associated with anything else (use detach in case they are), otherwise an exception is thrown

Parameters
firstthe first object of the association. Must not be NULL
secondthe second object of the association. Must not be NULL

Definition at line 1779 of file dataexchange.h.

void detach ( DataUploader< DataType > *  uploader)
static

Removes an association.

This function breaks the association of the given uploader with the downloader. If the uploader is not associated, nothing is done

Parameters
uploaderthe uploader whose association to break

Definition at line 1785 of file dataexchange.h.

void detach ( DataDownloader< DataType > *  downloader)
static

Removes an association.

This function breaks the association of the given downloader with the uploader. If the downloader is not associated, nothing is done

Parameters
downloaderthe downloader whose association to break

Definition at line 1791 of file dataexchange.h.

void detach ( DataUploaderDownloader< DataType1, DataType2 > *  uploaderDownloader)
static

Removes an association.

This function breaks the association of the given DataUploaderDownloader with its peer. If the object is not associated, nothing is done

Parameters
uploaderDownloaderthe object whose association to break

Definition at line 1797 of file dataexchange.h.

void stopAllDataExchanges ( )
static

Stops all data exchanges.

Call this function to wake up all sleeping uploaders and downloaders and stop all data exchanges. The function only influences uploaders and downloaders that have been created before it is called. All attempts to get data to upload/download after this function is called will return NULL (see note in dataexchange.h description). It is not possible to resume exchanges, you must destroy uploaders and downloaders and then re-create them.

Definition at line 27 of file dataexchange.cpp.

Friends And Related Function Documentation

QueueHolder is friend to access private members.

Definition at line 1165 of file dataexchange.h.

friend class DataDownloader
friend

DataDownloader is friend to access private members.

Definition at line 1159 of file dataexchange.h.

friend class DataUploader
friend

DataUploader is friend to access private members.

Definition at line 1153 of file dataexchange.h.


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