Matrix Science header
Public Member Functions

ms_http_helper_progress Class Reference
[Accessing a Mascot Server using HTTP]

This holds information on the progress of a running HTTP transfer. More...

#include <ms_http_helper_progress.hpp>

List of all members.

Public Member Functions

 ms_http_helper_progress ()
 C++ STL collection support.
UINT64 getCurrentBytes () const
 Returns the number of bytes sent or received.
double getProportion () const
 Returns a number from 0 to 1.0 that indicates how far the transaction has progressed.
UINT64 getTotalBytes () const
 Returns the total number of bytes that are due to be sent or received, or zero if the number is unknown.
bool isAbortSet () const
 Returns true if the transaction has been asked to abort.
bool isComplete () const
 Returns true if the transaction has run to completion (not terminated by error or abort).
bool isStarted () const
 Returns true if the transaction has started running.
void setAbort ()
 Cause the transaction to abort at the next available point.

Detailed Description

This holds information on the progress of a running HTTP transfer.

A progress object is passed to the connection when an extended transaction is started. The transaction updates the information as the transaction is going on.

Often, extended transacions are started on a worker thread so that other task (for example, the user interface) may continue to function while the transaction is in progress). An object of this class allows communication with the transaction while being processed on that thread.

This object can also be used to cancel the transaction prematurely if required.


Constructor & Destructor Documentation

C++ STL collection support.

STL collections, such as vector need a default constructor.


Member Function Documentation

UINT64 getCurrentBytes (  ) const

Returns the number of bytes sent or received.

This is the number of characters actually transferred so far.

Returns:
The number of characters transferred so far.
double getProportion (  ) const

Returns a number from 0 to 1.0 that indicates how far the transaction has progressed.

If the total amount to be transferred is unknown then the proportion value will change but does not represent any indication of the amount remaining.

Returns:
The proportion of the task that has been completed. Sero if the amount is unknown.
UINT64 getTotalBytes (  ) const

Returns the total number of bytes that are due to be sent or received, or zero if the number is unknown.

This is the size (in characters) of the file to be transferred.

For a download, te number of characters that are going to be sent by the server is not usually known until after the transfer is complete. In this case, this number remains zero.

Returns:
The number of characters to be transferred (including those already transferred).
bool isAbortSet (  ) const

Returns true if the transaction has been asked to abort.

This will return true after the setAbort() function has been called.

Returns:
True if the task is to be aborted at user request (i.e. setAbort() has been called).
bool isComplete (  ) const

Returns true if the transaction has run to completion (not terminated by error or abort).

If the transfer ended for any reason other than a successful transfer of all the data then this will continue to return false. The sumbit / download function will exit once the data transfer has ceased (for whatever reason).

Returns:
True if the task has completed.
bool isStarted (  ) const

Returns true if the transaction has started running.

Once the file transfer function has been called, there may be a delay before the transfer itself actually starts. This will only return true once the transfer of data has begun.

Returns:
True if the task has started (i.e. setStarted() has been called).
void setAbort (  )

Cause the transaction to abort at the next available point.

The file transfer, running on another thread, will continue until it gets to a suitable point and then exit.


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

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:33