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 | |
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 |
44 | |