libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout
include
osmscout
async
Breaker.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_UTIL_BREAKER_H
2
#define OSMSCOUT_UTIL_BREAKER_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2009 Tim Teulings
7
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Lesser General Public
10
License as published by the Free Software Foundation; either
11
version 2.1 of the License, or (at your option) any later version.
12
13
This library is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Lesser General Public License for more details.
17
18
You should have received a copy of the GNU Lesser General Public
19
License along with this library; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
*/
22
23
#include <atomic>
24
#include <memory>
25
26
#include <osmscout/lib/CoreFeatures.h>
27
#include <
osmscout/lib/CoreImportExport.h
>
28
29
namespace
osmscout
{
30
36
class
OSMSCOUT_API
Breaker
37
{
38
public
:
39
virtual
~Breaker
() =
default
;
40
48
virtual
void
Break
() = 0;
49
56
virtual
bool
IsAborted
()
const
= 0;
57
61
virtual
void
Reset
() = 0;
62
};
63
64
using
BreakerRef
= std::shared_ptr<Breaker>;
65
66
class
OSMSCOUT_API
ThreadedBreaker
:
public
Breaker
67
{
68
private
:
69
std::atomic<bool> aborted{
false
};
70
71
public
:
72
ThreadedBreaker
() =
default
;
73
74
void
Break
()
override
;
75
bool
IsAborted
()
const override
;
76
void
Reset
()
override
;
77
};
78
}
79
80
#endif
CoreImportExport.h
OSMSCOUT_API
#define OSMSCOUT_API
Definition
CoreImportExport.h:45
osmscout::Breaker
Definition
Breaker.h:37
osmscout::Breaker::~Breaker
virtual ~Breaker()=default
osmscout::Breaker::IsAborted
virtual bool IsAborted() const =0
osmscout::Breaker::Break
virtual void Break()=0
osmscout::Breaker::Reset
virtual void Reset()=0
osmscout::ThreadedBreaker::Reset
void Reset() override
osmscout::ThreadedBreaker::IsAborted
bool IsAborted() const override
osmscout::ThreadedBreaker::Break
void Break() override
osmscout::ThreadedBreaker::ThreadedBreaker
ThreadedBreaker()=default
osmscout
Definition
Area.h:39
osmscout::BreakerRef
std::shared_ptr< Breaker > BreakerRef
Definition
Breaker.h:64
Generated by
1.17.0