RhythmGame 1.4.3
Loading...
Searching...
No Matches
Signals | Public Member Functions | Static Public Attributes | Properties | List of all members
qml_components::ScoreSyncOperation Class Reference

#include <ScoreSyncOperation.h>

Inheritance diagram for qml_components::ScoreSyncOperation:
Inheritance graph
[legend]
Collaboration diagram for qml_components::ScoreSyncOperation:
Collaboration graph
[legend]

Signals

void progressChanged ()
 
void finishedChanged ()
 
void error (const QString &message)
 
void errorsChanged ()
 

Public Member Functions

 ScoreSyncOperation (QObject *parent=nullptr)
 
 ~ScoreSyncOperation () override
 
void start (QStringList guids, std::function< void(const QString &)> dispatch)
 
void ownReply (QNetworkReply *reply)
 
Q_INVOKABLE void cancel ()
 
auto getDone () const -> int
 
auto getTotal () const -> int
 
auto isFinished () const -> bool
 
auto isCancelled () const -> bool
 
auto getErrorCount () const -> int
 
auto getLastError () const -> QString
 
void setTotal (int total)
 
void setFinished (bool value)
 
void increment ()
 
void reportError (const QString &message)
 Records an error without stopping the operation.
 

Static Public Attributes

static constexpr int concurrency = 4
 

Properties

QML_ELEMENTint done
 
int total { 0 }
 
bool finished
 
int errorCount
 
QString lastError
 
bool cancelled
 

Detailed Description

Tracks progress and errors for a score upload, download, or import. Uploads and downloads queue scores once the server diff is known and prepare or transfer at most four at once. Errors do not stop the queue. Cancellation aborts owned replies and discards queued work. Finished operations cannot restart.

Constructor & Destructor Documentation

◆ ScoreSyncOperation()

qml_components::ScoreSyncOperation::ScoreSyncOperation ( QObject *  parent = nullptr)
explicit

◆ ~ScoreSyncOperation()

qml_components::ScoreSyncOperation::~ScoreSyncOperation ( )
override

Member Function Documentation

◆ cancel()

void qml_components::ScoreSyncOperation::cancel ( )

◆ error

void qml_components::ScoreSyncOperation::error ( const QString &  message)
signal

◆ errorsChanged

void qml_components::ScoreSyncOperation::errorsChanged ( )
signal

◆ finishedChanged

void qml_components::ScoreSyncOperation::finishedChanged ( )
signal

◆ getDone()

auto qml_components::ScoreSyncOperation::getDone ( ) const -> int
inline

◆ getErrorCount()

auto qml_components::ScoreSyncOperation::getErrorCount ( ) const -> int
inline

◆ getLastError()

auto qml_components::ScoreSyncOperation::getLastError ( ) const -> QString
inline

◆ getTotal()

auto qml_components::ScoreSyncOperation::getTotal ( ) const -> int
inline

◆ increment()

void qml_components::ScoreSyncOperation::increment ( )

Marks one item done and emits progressChanged(). Finishes the operation when done reaches total.

◆ isCancelled()

auto qml_components::ScoreSyncOperation::isCancelled ( ) const -> bool
inline

◆ isFinished()

auto qml_components::ScoreSyncOperation::isFinished ( ) const -> bool

◆ ownReply()

void qml_components::ScoreSyncOperation::ownReply ( QNetworkReply *  reply)

◆ progressChanged

void qml_components::ScoreSyncOperation::progressChanged ( )
signal

◆ reportError()

void qml_components::ScoreSyncOperation::reportError ( const QString &  message)

Records an error without stopping the operation.

◆ setFinished()

void qml_components::ScoreSyncOperation::setFinished ( bool  value)

Marks the operation finished when value is true. Emits finishedChanged() once.

◆ setTotal()

void qml_components::ScoreSyncOperation::setTotal ( int  total)

Sets the total number of items and emits progressChanged(). A zero total finishes the operation.

◆ start()

void qml_components::ScoreSyncOperation::start ( QStringList  guids,
std::function< void(const QString &)>  dispatch 
)

Member Data Documentation

◆ concurrency

constexpr int qml_components::ScoreSyncOperation::concurrency = 4
staticconstexpr

Property Documentation

◆ cancelled

bool qml_components::ScoreSyncOperation::cancelled
read

◆ done

QML_ELEMENTint qml_components::ScoreSyncOperation::done
read

◆ errorCount

int qml_components::ScoreSyncOperation::errorCount
read

◆ finished

bool qml_components::ScoreSyncOperation::finished
read

◆ lastError

QString qml_components::ScoreSyncOperation::lastError
read

◆ total

int qml_components::ScoreSyncOperation::total { 0 }
read

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