ProgressSignal
ProgressSignal
#include <icy/http/connection.h>class ProgressSignalDefined in src/http/include/icy/http/connection.h:223
Inherits:
Signal< void(const double &)>
HTTP progress signal for upload and download progress notifications.
Emits a double in the range [0, 100] as data is transferred. Set total to the expected byte count before calling [update()](#update-5).
List of all members
| Name | Kind | Owner |
|---|---|---|
sender | variable | Declared here |
current | variable | Declared here |
total | variable | Declared here |
ProgressSignal | function | Declared here |
progress | function | Declared here |
update | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
void * | sender | Optional context pointer identifying the sender. |
uint64_t | current | Bytes transferred so far. |
uint64_t | total | Total expected bytes (from Content-Length). |
sender
void * senderDefined in src/http/include/icy/http/connection.h:226
Optional context pointer identifying the sender.
current
uint64_t currentDefined in src/http/include/icy/http/connection.h:227
Bytes transferred so far.
total
uint64_t totalDefined in src/http/include/icy/http/connection.h:228
Total expected bytes (from Content-Length).
Public Methods
| Return | Name | Description |
|---|---|---|
ProgressSignal inline | ||
double | progress const inline | Returns the current transfer progress as a percentage (0-100). |
void | update inline | Advances the progress counter by nread bytes and emits the updated percentage. |
ProgressSignal
inline
inline ProgressSignal()Defined in src/http/include/icy/http/connection.h:230
progress
const inline
inline double progress() constDefined in src/http/include/icy/http/connection.h:238
Returns the current transfer progress as a percentage (0-100).
update
inline
inline void update(int nread)Defined in src/http/include/icy/http/connection.h:243
Advances the progress counter by nread bytes and emits the updated percentage.
Parameters
nreadNumber of bytes just transferred.
Exceptions
std::runtime_errorif current would exceed total.
