ThreadWeaver

queuestream.h
1 /* -*- C++ -*-
2  This file is part of ThreadWeaver, a KDE framework.
3 
4  SPDX-FileCopyrightText: 2013 Mirko Boehm <[email protected]>
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 
15 namespace ThreadWeaver
16 {
17 class Queue;
18 class Job;
19 
20 /** @brief QueueStream implements a stream based API to access ThreadWeaver queues. */
21 class THREADWEAVER_EXPORT QueueStream
22 {
23 public:
24  explicit QueueStream(Queue *queue);
25  ~QueueStream();
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 
34 private:
35  class Private;
36  Private *const d;
37 };
38 
39 QueueStream THREADWEAVER_EXPORT stream();
40 
41 }
42 
43 #endif // QUEUESTREAM_H
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
QueueStream implements a stream based API to access ThreadWeaver queues.
Definition: queuestream.h:21
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition: job.h:46
Queue implements a ThreadWeaver job queue.
Definition: queue.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Sep 30 2023 04:07:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.