Ref T160, continous worker now CIdentifiable and name is mandatory

This commit is contained in:
Klaus Basan
2017-09-25 03:43:14 +02:00
parent 733ee7853d
commit 8324c2d305
3 changed files with 8 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
#include "blackmisc/logcategorylist.h"
#include "blackmisc/invoke.h"
#include "blackmisc/stacktrace.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/variant.h"
#include <QMetaObject>
@@ -266,7 +267,9 @@ namespace BlackMisc
/*!
* Base class for a long-lived worker object which lives in its own thread.
*/
class BLACKMISC_EXPORT CContinuousWorker : public CWorkerBase
class BLACKMISC_EXPORT CContinuousWorker :
public CWorkerBase,
public CIdentifiable
{
Q_OBJECT
@@ -276,7 +279,7 @@ namespace BlackMisc
* \param owner Will be the parent of the new thread (the worker has no parent).
* \param name A name for the worker, which will be used to create a name for the thread.
*/
CContinuousWorker(QObject *owner, const QString &name = "");
CContinuousWorker(QObject *owner, const QString &name);
//! Starts a thread and moves the worker into it.
void start(QThread::Priority priority = QThread::InheritPriority);