ThreadWeaver 5.109.0
queuepolicy.h
1/* -*- C++ -*-
2 This file declares the QueuePolicy class.
3
4 SPDX-FileCopyrightText: 2004, 2005, 2006 Mirko Boehm <mirko@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7
8 $Id: DebuggingAids.h 30 2005-08-16 16:16:04Z mirko $
9*/
10
11#ifndef QUEUEPOLICY_H
12#define QUEUEPOLICY_H
13
14#include "jobpointer.h"
15#include "threadweaver_export.h"
16
17namespace ThreadWeaver
18{
19class JobInterface;
20
38class THREADWEAVER_EXPORT QueuePolicy
39{
40public:
41 virtual ~QueuePolicy()
42 {
43 }
44
48 virtual bool canRun(JobPointer) = 0;
49
54 virtual void free(JobPointer) = 0;
55
60 virtual void release(JobPointer) = 0;
61
64 virtual void destructed(JobInterface *job) = 0;
65};
66
67}
68
69#endif
QueuePolicy is an interface for customizations of the queueing behaviour of jobs.
Definition queuepolicy.h:39
virtual void destructed(JobInterface *job)=0
destructing() is called when a Job that has this queue policy assigned gets destructed.
virtual void free(JobPointer)=0
free() is called after the job has been executed.
virtual void release(JobPointer)=0
release() is called if canRun() returned true, but the job has not been executed for external reasons...
virtual bool canRun(JobPointer)=0
canRun() is called before the job is executed.