mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Ref T105, use enabled in CContinuousWorker
* removed slots * getName
This commit is contained in:
committed by
Mathew Sutcliffe
parent
291af98770
commit
7f3643fb0e
@@ -289,18 +289,28 @@ namespace BlackMisc
|
||||
//! \threadsafe Will deadlock if called by the worker thread.
|
||||
virtual void quitAndWait() noexcept final override;
|
||||
|
||||
protected slots:
|
||||
//! Enabled (running)?
|
||||
//! \threadsafe
|
||||
bool isEnabled() const { return m_enabled; }
|
||||
|
||||
//! Enabled (running)?
|
||||
//! \threadsafe
|
||||
void setEnabled(bool enabled) { m_enabled = enabled; }
|
||||
|
||||
protected:
|
||||
//! Called when the thread is started.
|
||||
virtual void initialize() {}
|
||||
|
||||
//! Called when the thread is finished.
|
||||
virtual void cleanup() {}
|
||||
|
||||
private slots:
|
||||
//! Called after cleanup().
|
||||
void ps_finish();
|
||||
//! Name of the worker
|
||||
const QString &getName() { return m_name; }
|
||||
|
||||
private:
|
||||
//! Called after cleanup().
|
||||
void finish();
|
||||
|
||||
template <typename T>
|
||||
friend class CWorkerPointer;
|
||||
|
||||
@@ -309,7 +319,8 @@ namespace BlackMisc
|
||||
using CWorkerBase::setFinished;
|
||||
|
||||
QObject *m_owner = nullptr;
|
||||
QString m_name;
|
||||
QString m_name; //!< worker's name
|
||||
std::atomic<bool> m_enabled { true }; //!< marker it is enabled
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user