GEOS  3.8.0dev
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 
20 namespace geos {
21 namespace util { // geos::util
22 
23 #define GEOS_CHECK_FOR_INTERRUPTS() geos::util::Interrupt::process()
24 
26 class GEOS_DLL Interrupt {
27 
28 public:
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
Definition: Interrupt.h:26
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25