GEOS 3.9.1
Interrupt.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2012 Sandro Santilli <strk@kbt.io>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#ifndef GEOS_UTIL_INTERRUPT_H
16#define GEOS_UTIL_INTERRUPT_H
17
18#include <geos/export.h>
19
20namespace geos {
21namespace util { // geos::util
22
23#define GEOS_CHECK_FOR_INTERRUPTS() geos::util::Interrupt::process()
24
26class GEOS_DLL Interrupt {
27
28public:
29
30 typedef void (Callback)(void);
31
38 static void request();
39
41 static void cancel();
42
44 static bool check();
45
56 static Callback* registerCallback(Callback* cb);
57
62 static void process();
63
64 /* Perform the actual interruption (simply throw an exception) */
65 static void interrupt();
66
67};
68
69
70} // namespace geos::util
71} // namespace geos
72
73
74#endif // GEOS_UTIL_INTERRUPT_H
Used to manage interruption requests and callbacks.
Definition: Interrupt.h:26
static bool check()
static void cancel()
static void process()
static void request()
static Callback * registerCallback(Callback *cb)
Register a callback that will be invoked before checking for interruption requests.
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26