#include <queuenode.h>
Inheritance diagram for QueueNode:
Public Member Functions | |
virtual | ~QueueNode () |
QueueNode Default constructor. | |
int | GetStatus () |
int | GetType () |
Return the type of the transaction. | |
float | GetProgress () |
Return the current progress of the QueueNode's operation. | |
Protected Member Functions | |
QueueNode (Server *pcServer, const String &zLocalPath, const String &zRemotePath, int nType, int nID) | |
QueueNode Constructor. Initializes the QueueNode storing all the data related to the node. | |
virtual CURLcode | SetupCurlHandleForTransfer (CURL *pHandle) |
Set the necessary options in the curl handle. The important parts are done in the subclasses. | |
Protected Attributes | |
Server * | m_pcServer |
Server that this QueueNode belongs to. | |
String | m_zLocalPath |
Local path of the file to be transfered. | |
String | m_zRemotePath |
Remote path of the file to be transfered. | |
int | m_nType |
Stores type of transfer this node represents. Could be: Upload, Download, Directory Listing, etc. | |
int | m_nStatus |
Stores the status of the node. Should use one of the enums for Active or Queued. | |
int | m_nID |
Our id for the Server's std::map. | |
Private Member Functions | |
virtual size_t | Read (void *pBuf, size_t nSize) |
Read data into the provided buffer. | |
virtual size_t | Write (void *pBuf, size_t nSize) |
Write data from the provided buffer. | |
virtual int | Seek (curl_off_t nOffset, int nOrigin) |
Seek into the data that is being manipulated. | |
virtual int | ProgressBar (double fDownTotal, double fDownNow, double fUpTotal, double fUpNow) |
Update the progress bar for the QueueNode. | |
Static Private Member Functions | |
static size_t | ReadCallback (void *pBuf, size_t nSize, size_t nMult, void *pCookie) |
Read Callback The libcurl read callback. Can't pass a virtual function to libcurl so we use these static wrappers. | |
static size_t | WriteCallback (void *pBuf, size_t nSize, size_t nMult, void *pCookie) |
Write Callback The libcurl write callback. Can't pass a virtual function to libcurl so we use these static wrappers. | |
static int | SeekCallback (void *pCookie, curl_off_t nOffset, int nOrigin) |
Seek Callback The libcurl seek callback. Can't pass a virtual function to libcurl so we use these static wrappers. | |
static int | ProgressBarCallback (void *pCookie, double fDownTotal, double fDownNow, double fUpTotal, double fUpNow) |
Progress Bar Callback The libcurl progress bar. callback. Can't pass a virtual function to libcurl so we use these static wrappers. | |
Friends | |
class | TransferThread |
int QueueNode::GetStatus | ( | ) | [inline] |
Return the current status of the node.
int QueueNode::GetType | ( | ) | [inline] |
float QueueNode::GetProgress | ( | ) | [inline] |
virtual size_t QueueNode::Read | ( | void * | pBuf, | |
size_t | nSize | |||
) | [inline, private, virtual] |
Read data into the provided buffer.
pBuf | Pointer to the buffer to read data into. | |
nSize | The amount of data to be read. |
Reimplemented in UploadNode.
virtual size_t QueueNode::Write | ( | void * | pBuf, | |
size_t | nSize | |||
) | [inline, private, virtual] |
Write data from the provided buffer.
pBuf | The location of the data that should be read from to write information. | |
nSize | Size of the data that is in pBuf. |
Reimplemented in DownloadNode, and DirListNode.
virtual int QueueNode::Seek | ( | curl_off_t | nOffset, | |
int | nOrigin | |||
) | [inline, private, virtual] |
Seek into the data that is being manipulated.
nOffset | Amount to offset into the data being manipulated. | |
nOrigin | Where to start offsetting from. |
Reimplemented in DownloadNode, and UploadNode.
virtual int QueueNode::ProgressBar | ( | double | fDownTotal, | |
double | fDownNow, | |||
double | fUpTotal, | |||
double | fUpNow | |||
) | [inline, private, virtual] |
Update the progress bar for the QueueNode.
fDownTotal | Total data downloaded to be downloaded | |
fDownNow | Total data downloaded so far. | |
fUpTotal | Total data to be uploaded. | |
fUpNow | Total data uploaded so far. |
Reimplemented in DownloadNode, UploadNode, and DirListNode.
size_t QueueNode::ReadCallback | ( | void * | pBuf, | |
size_t | nSize, | |||
size_t | nMult, | |||
void * | pCookie | |||
) | [static, private] |
Read Callback The libcurl read callback. Can't pass a virtual function to libcurl so we use these static wrappers.
pBuf | The location to read input data to. | |
nSize | The amount of data to be read. | |
nMult | The size in bytes of each data unit. | |
pCookie | This contains the QueueNode* that we want to call the Read method on. |
size_t QueueNode::WriteCallback | ( | void * | pBuf, | |
size_t | nSize, | |||
size_t | nMult, | |||
void * | pCookie | |||
) | [static, private] |
Write Callback The libcurl write callback. Can't pass a virtual function to libcurl so we use these static wrappers.
int QueueNode::SeekCallback | ( | void * | pCookie, | |
curl_off_t | nOffset, | |||
int | nOrigin | |||
) | [static, private] |
Seek Callback The libcurl seek callback. Can't pass a virtual function to libcurl so we use these static wrappers.
pCookie | This contains the QueueNode* that we want to call the Seek method on. | |
nOffset | How many bytes to offset into the file. | |
nOrigin | The origin from which to start the offset. |
int QueueNode::ProgressBarCallback | ( | void * | pCookie, | |
double | fDownTotal, | |||
double | fDownNow, | |||
double | fUpTotal, | |||
double | fUpNow | |||
) | [static, private] |
Progress Bar Callback The libcurl progress bar. callback. Can't pass a virtual function to libcurl so we use these static wrappers.
pCookie | The pointer to the QueueNode object to send the ProgreesBar update to. | |
fDownTotal | Total data downloaded to be downloaded | |
fDownNow | Total data downloaded so far. | |
fUpTotal | Total data to be uploaded. | |
fUpNow | Total data uploaded so far. |
int QueueNode::m_nType [protected] |
Stores type of transfer this node represents. Could be: Upload, Download, Directory Listing, etc.
See the enums in the header file.
int QueueNode::m_nStatus [protected] |
Stores the status of the node. Should use one of the enums for Active or Queued.
See the enums in the header file.