ThreadWeaver

queuestream.h
1/* -*- C++ -*-
2 This file is part of ThreadWeaver, a KDE framework.
3
4 SPDX-FileCopyrightText: 2013 Mirko Boehm <mirko@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef QUEUESTREAM_H
10#define QUEUESTREAM_H
11
12#include "jobinterface.h"
13#include "threadweaver_export.h"
14
15namespace ThreadWeaver
16{
17class Queue;
18class Job;
19
20/** @brief QueueStream implements a stream based API to access ThreadWeaver queues. */
21class THREADWEAVER_EXPORT QueueStream
22{
23public:
24 explicit QueueStream(Queue *queue);
26 void add(const JobPointer &job);
27 void flush();
28
29 QueueStream &operator<<(const JobPointer &job);
30 QueueStream &operator<<(JobInterface *job);
31 // FIXME try with QObjectDecorator (JobInterface&)
32 QueueStream &operator<<(Job &job);
33
34private:
35 class Private;
36 Private *const d;
37};
38
39QueueStream THREADWEAVER_EXPORT stream();
40
41}
42
43#endif // QUEUESTREAM_H
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition job.h:47
QueueStream implements a stream based API to access ThreadWeaver queues.
Definition queuestream.h:22
Queue implements a ThreadWeaver job queue.
Definition queue.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.