Classes | |
| class | DataArrivalInfo |
Public Member Functions | |
| long double | estimatedTimeUntilArrival () const |
| In seconds. | |
| qint64 | expectedDataSize () const |
| long double | getSpeed () const |
| In bytes per second. | |
| qint64 | lastRegisteredDataAmount () const |
| Last amount of data registered through registerDataAmount() method. | |
| qint64 | lastRegisterAttemptedDataAmount () const |
| Last amount of data that was passed to registerDataAmount() | |
| void | registerDataAmount (qint64 totalAmountOfArrivedData) |
| Register new total amount of data. | |
| void | setExpectedDataSize (qint64 size) |
| Maximum expected size of the data. | |
| void | start () |
| Clears all values. Prepares SpeedCalculator for new speed measure. | |
| long double SpeedCalculator::estimatedTimeUntilArrival | ( | ) | const |
In seconds.
| long double SpeedCalculator::getSpeed | ( | ) | const |
In bytes per second.
| qint64 SpeedCalculator::lastRegisterAttemptedDataAmount | ( | ) | const [inline] |
Last amount of data that was passed to registerDataAmount()
It doesn't matter whether the data was actually registered for the speed calculation or not.
| qint64 SpeedCalculator::lastRegisteredDataAmount | ( | ) | const |
Last amount of data registered through registerDataAmount() method.
If SpeedCalculator is used properly this will equal to total amount of downloaded data.
| void SpeedCalculator::registerDataAmount | ( | qint64 | totalAmountOfArrivedData | ) |
Register new total amount of data.
This will be used to calculate speed and ETA. Internally this will store data only once per second. It is not a problem to call this method more often as in such case it will change no data inside the object of this class.
| void SpeedCalculator::setExpectedDataSize | ( | qint64 | size | ) |
Maximum expected size of the data.
This value is used to calculate ETA.
| void SpeedCalculator::start | ( | ) |
Clears all values. Prepares SpeedCalculator for new speed measure.
This will clear arrivalData and dataSizeExpected variables and restart the clock.