Fix crash on startup if an LV2 plugin has a bad .ttl file.
[ardour.git] / libs / glibmm2 / gio / src / cancellable.hg
1 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
3 /* Copyright (C) 2007 The gtkmm Development Team
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19
20
21 #include <glibmm/object.h>
22
23 _DEFS(giomm,gio)
24 _PINCLUDE(glibmm/private/object_p.h)
25
26 namespace Gio
27 {
28
29 /** Allows actions to be cancelled.
30  * Cancellable is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations.
31  *
32  * @newin2p16
33  */
34 class Cancellable : public Glib::Object
35 {
36   _CLASS_GOBJECT(Cancellable, GCancellable, G_CANCELLABLE, Glib::Object, GObject)
37
38 protected:
39   _CTOR_DEFAULT
40
41 public:
42   _WRAP_CREATE()
43
44   _WRAP_METHOD(bool is_cancelled() const, g_cancellable_is_cancelled)
45
46   _IGNORE(g_cancellable_set_error_if_cancelled)
47
48   //May return -1 if fds not supported, or on errors .
49   _WRAP_METHOD(int get_fd() const, g_cancellable_get_fd)
50
51   //This is safe to call from another thread.
52   _WRAP_METHOD(void cancel(), g_cancellable_cancel)
53
54   _WRAP_METHOD(static Glib::RefPtr<Cancellable> get_current(), g_cancellable_get_current, refreturn)
55
56   _WRAP_METHOD(void push_current(),
57                g_cancellable_push_current)
58   _WRAP_METHOD(void pop_current(),
59                g_cancellable_pop_current)
60   _WRAP_METHOD(void reset(), g_cancellable_reset)
61
62   _WRAP_SIGNAL(void cancelled(), cancelled)
63 };
64
65 } // namespace Gio
66