Scroom 0.14-49-gb7ae7a6d
Loading...
Searching...
No Matches
queue.hh
Go to the documentation of this file.
1/*
2 * Scroom - Generic viewer for 2D data
3 * Copyright (C) 2009-2026 Kees-Jan Dijkzeul
4 *
5 * SPDX-License-Identifier: LGPL-2.1
6 */
7
8#pragma once
9
10#include <scroom/threadpool.hh>
11
13{
23 {
24 public:
25 using Ptr = std::shared_ptr<QueueImpl>;
26
27 static Ptr create();
28
35 bool jobStarted();
36
38 void jobFinished();
39
45 void deletingQueue();
46
48 int getCount();
49
50 private:
51 boost::mutex mut;
52 boost::condition_variable cond;
53 unsigned int count{0};
54 bool isDeleted{false};
56 private:
57 QueueImpl() = default;
58 };
59
64 {
66 bool isValid;
68 public:
69 explicit QueueLock(QueueImpl::Ptr queue);
70 QueueLock(const QueueLock&) = delete;
71 QueueLock(QueueLock&&) = delete;
72 QueueLock& operator=(const QueueLock&) = delete;
74 ~QueueLock();
75
77 [[nodiscard]] bool queueExists() const;
78 };
79
80} // namespace Scroom::Detail::ThreadPool
unsigned int count
Definition queue.hh:53
void deletingQueue()
Definition queue.cc:20
boost::mutex mut
Definition queue.hh:51
void jobFinished()
Definition queue.cc:38
int getCount()
Definition queue.cc:45
static Ptr create()
QueueImpl.
Definition queue.cc:18
bool jobStarted()
Definition queue.cc:30
boost::condition_variable cond
Definition queue.hh:52
bool isDeleted
Definition queue.hh:54
std::shared_ptr< QueueImpl > Ptr
Definition queue.hh:25
QueueLock & operator=(const QueueLock &)=delete
~QueueLock()
Definition queue.cc:63
QueueImpl::Ptr q
Definition queue.hh:65
QueueLock & operator=(QueueLock &&)=delete
QueueLock(const QueueLock &)=delete
bool isValid
Definition queue.hh:66
bool queueExists() const
Definition queue.cc:61
Definition async-deleter.hh:22