GEOS  3.9.1dev
Interrupt.h
Go to the documentation of this file.
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 
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
#define GEOS_DLL
Definition: export.h:28
Used to manage interruption requests and callbacks.
Definition: Interrupt.h:26
Basic namespace for all GEOS functionalities.