10#include "managedjobpointer.h"
13#include "iddecorator.h"
17const quintptr IdDecorator_AutoDelete = 1;
25IdDecorator::IdDecorator(JobInterface *decoratee,
bool autoDelete)
26 : d1(reinterpret_cast<Private1 *>(decoratee))
29 setAutoDelete(autoDelete);
32IdDecorator::~IdDecorator()
41QMutex *IdDecorator::mutex()
const
44 return job()->mutex();
47void IdDecorator::run(JobPointer self, Thread *thread)
50 job()->run(self, thread);
53void IdDecorator::defaultBegin(
const JobPointer &self, Thread *thread)
56 job()->defaultBegin(self, thread);
59void IdDecorator::defaultEnd(
const JobPointer &self, Thread *thread)
62 job()->defaultEnd(self, thread);
65void IdDecorator::removeQueuePolicy(QueuePolicy *policy)
68 job()->removeQueuePolicy(policy);
74 return job()->queuePolicies();
77void IdDecorator::assignQueuePolicy(QueuePolicy *policy)
80 job()->assignQueuePolicy(policy);
83bool IdDecorator::isFinished()
const
86 return job()->isFinished();
89void IdDecorator::aboutToBeQueued(QueueAPI *api)
92 job()->aboutToBeQueued(api);
95void IdDecorator::aboutToBeQueued_locked(QueueAPI *api)
98 job()->aboutToBeQueued_locked(api);
101void IdDecorator::aboutToBeDequeued(QueueAPI *api)
104 job()->aboutToBeDequeued(api);
107void IdDecorator::aboutToBeDequeued_locked(QueueAPI *api)
110 job()->aboutToBeDequeued_locked(api);
113void IdDecorator::requestAbort()
116 job()->requestAbort();
119bool IdDecorator::success()
const
122 return job()->success();
125int IdDecorator::priority()
const
128 return job()->priority();
131void IdDecorator::setStatus(JobInterface::Status
status)
137JobInterface::Status IdDecorator::status()
const
140 return job()->status();
143Executor *IdDecorator::executor()
const
146 return job()->executor();
149Executor *IdDecorator::setExecutor(Executor *executor)
152 return job()->setExecutor(executor);
158 job()->execute(self, thread);
161void IdDecorator::blockingExecute()
164 job()->blockingExecute();
167const ThreadWeaver::JobInterface *IdDecorator::job()
const
169 return reinterpret_cast<JobInterface *
>(d1);
172JobInterface *IdDecorator::job()
174 return reinterpret_cast<JobInterface *
>(d1);
177void IdDecorator::setAutoDelete(
bool onOff)
180 d2 =
reinterpret_cast<IdDecorator::Private2 *
>(IdDecorator_AutoDelete);
186bool IdDecorator::autoDelete()
const
188 return d2 ==
reinterpret_cast<IdDecorator::Private2 *
>(IdDecorator_AutoDelete);
193 return dynamic_cast<const Collection *
>(job());
203 return dynamic_cast<const Sequence *
>(job());
208 return dynamic_cast<Sequence *
>(job());
A Collection is a vector of Jobs that will be queued together.
A Sequence is a vector of Jobs that will be executed in a sequence.
Thread represents a worker thread in a Queue's inventory.
Q_SCRIPTABLE CaptureState status()