projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove unused using statement.
[dcpomatic.git]
/
src
/
wx
/
suspender.cc
diff --git
a/src/wx/suspender.cc
b/src/wx/suspender.cc
index 9b1b64c8504e260ff84dd5b718a3f4c5da8aa283..7680c147b097c9e36a3f14d9a7ae84f93039a086 100644
(file)
--- a/
src/wx/suspender.cc
+++ b/
src/wx/suspender.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020
-2021
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,51
+18,57
@@
*/
*/
+
#include "suspender.h"
#include "suspender.h"
-#include <boost/foreach.hpp>
-Suspender::Suspender(boost::function<void (int)> handler)
+
+Suspender::Suspender(std::function<void (int)> handler)
: _handler (handler)
: _handler (handler)
- , _count (0)
{
}
{
}
+
Suspender::Block::Block (Suspender* s)
: _suspender (s)
{
_suspender->increment ();
}
Suspender::Block::Block (Suspender* s)
: _suspender (s)
{
_suspender->increment ();
}
+
Suspender::Block::~Block ()
{
_suspender->decrement ();
}
Suspender::Block::~Block ()
{
_suspender->decrement ();
}
+
Suspender::Block
Suspender::block ()
{
return Block (this);
}
Suspender::Block
Suspender::block ()
{
return Block (this);
}
+
void
Suspender::increment ()
{
++_count;
}
void
Suspender::increment ()
{
++_count;
}
+
void
Suspender::decrement ()
{
--_count;
if (_count == 0) {
void
Suspender::decrement ()
{
--_count;
if (_count == 0) {
-
BOOST_FOREACH (int i,
_pending) {
+
for (auto i:
_pending) {
_handler (i);
}
_pending.clear ();
}
}
_handler (i);
}
_pending.clear ();
}
}
+
bool
Suspender::check (int property)
{
bool
Suspender::check (int property)
{