<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>glibmm 2.4: Gio::Cancellable Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table border="0" width="100%"> <tr> <td width="10%" height="40"><img src="../../images/gtkmm_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td> <td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td> </tr> </table> <center> <a class="qindex" href="../../../../gtkmm-2.4/docs/index.html">Main Page</a> <a href="../../../../gtkmm-2.4/docs/reference/html/group__Widgets.html">Widgets</a> <a class="qindex" href="namespaces.html">glibmm Namespaces</a> <a href="../../../../gtkmm-2.4/docs/tutorial/html/index.html"> Book</a> </center> <hr width="100%"/> <!-- begin main content --> <div id="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="nav"> <a class="el" href="namespaceGio.html">Gio</a>::<a class="el" href="classGio_1_1Cancellable.html">Cancellable</a></div> <h1>Gio::Cancellable Class Reference</h1><!-- doxytag: class="Gio::Cancellable" --><!-- doxytag: inherits="Glib::Object" -->Allows actions to be cancelled. <a href="#_details">More...</a> <p> <div class="dynheader"> Inheritance diagram for Gio::Cancellable:</div> <div class="dynsection"> <p><center><img src="classGio_1_1Cancellable__inherit__graph.png" border="0" usemap="#Gio_1_1Cancellable__inherit__map" alt="Inheritance graph"></center> <map name="Gio_1_1Cancellable__inherit__map"> <area shape="rect" href="classGlib_1_1Object.html" title="Glib::Object" alt="" coords="21,161,115,188"><area shape="rect" href="classGlib_1_1ObjectBase.html" title="Glib::ObjectBase is a common base class for Objects and Interfaces." alt="" coords="5,84,131,111"><area shape="rect" href="classsigc_1_1trackable.html" title="sigc::trackable" alt="" coords="12,7,124,33"></map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div> <p> <a href="classGio_1_1Cancellable-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#97c7c4d728865129bc6f0cd3f4ecfce7">~Cancellable</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">GCancellable* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#e19ec1e85fd9cd7893914d4d7c20120d">gobj</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#e19ec1e85fd9cd7893914d4d7c20120d"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">const GCancellable* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#668176a01f7ad3cc13c7448378f37b41">gobj</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C GObject. <a href="#668176a01f7ad3cc13c7448378f37b41"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">GCancellable* </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#379e6394bad0fff1eb11e1a160f30235">gobj_copy</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. <a href="#379e6394bad0fff1eb11e1a160f30235"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#47ce5f2f16541b7ae18bc5114b366d8c">is_cancelled</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks if a cancellable job has been cancelled. <a href="#47ce5f2f16541b7ae18bc5114b366d8c"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#80df23049daf594fda884f2932ce3b95">get_fd</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the file descriptor for a cancellable job. <a href="#80df23049daf594fda884f2932ce3b95"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#86adae0645cec20d09d1a2903fe46cc0">cancel</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Will set <em>cancellable</em> to cancelled, and will emit the CANCELLED signal. <a href="#86adae0645cec20d09d1a2903fe46cc0"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#d893da5aebfb4baf34ecdbdad7a3608b">push_current</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Pushes <em>cancellable</em> onto the cancellable stack. <a href="#d893da5aebfb4baf34ecdbdad7a3608b"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#93b5a39447d2b4eb9fb56748cb687fc8">pop_current</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Pops <em>cancellable</em> off the cancellable stack (verifying that <em>cancellable</em> is on the top of the stack). <a href="#93b5a39447d2b4eb9fb56748cb687fc8"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#2285370aea5d98141e742e73743b9c3e">reset</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Resets <em>cancellable</em> to its uncancelled state. <a href="#2285370aea5d98141e742e73743b9c3e"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGlib_1_1SignalProxy0.html">Glib::SignalProxy0</a><br> <void> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#5a34d4782ccec014684c4eb6c20cf0a6">signal_cancelled</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight"><dl class="user" compact><dt><b>Prototype:</b></dt><dd><code>void on_my_cancelled()</code> </dd></dl> <a href="#5a34d4782ccec014684c4eb6c20cf0a6"></a><br></td></tr> <tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br> <<a class="el" href="classGio_1_1Cancellable.html">Cancellable</a>> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#8d59324b4c253f8c890901cd934203a7">create</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br> <<a class="el" href="classGio_1_1Cancellable.html">Cancellable</a>> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#af923ce91ddf21fc03bf2902e12cd4e1">get_current</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the top cancellable from the stack. <a href="#af923ce91ddf21fc03bf2902e12cd4e1"></a><br></td></tr> <tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#ab7733b6e915e4ebe280fbb669b6af2a">Cancellable</a> ()</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#ff017e200824997b9c26d82f147e078f">on_cancelled</a> ()</td></tr> <tr><td colspan="2"><br><h2>Related Functions</h2></td></tr> <tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><br> <<a class="el" href="classGio_1_1Cancellable.html">Gio::Cancellable</a>> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGio_1_1Cancellable.html#c45875da91c9c870a0f154a8249047c0">wrap</a> (GCancellable* object, bool take_copy=false)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A <a class="el" href="namespaceGlib.html#671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. <a href="#c45875da91c9c870a0f154a8249047c0"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Allows actions to be cancelled. <p> <a class="el" href="classGio_1_1Cancellable.html" title="Allows actions to be cancelled.">Cancellable</a> is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations.<p> <dl compact><dt><b><a class="el" href="newin2p16s.html#_newin2p16s000015">Since glibmm 2.16:</a></b></dt><dd></dd></dl> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="97c7c4d728865129bc6f0cd3f4ecfce7"></a><!-- doxytag: member="Gio::Cancellable::~Cancellable" ref="97c7c4d728865129bc6f0cd3f4ecfce7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual Gio::Cancellable::~Cancellable </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="ab7733b6e915e4ebe280fbb669b6af2a"></a><!-- doxytag: member="Gio::Cancellable::Cancellable" ref="ab7733b6e915e4ebe280fbb669b6af2a" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Gio::Cancellable::Cancellable </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="e19ec1e85fd9cd7893914d4d7c20120d"></a><!-- doxytag: member="Gio::Cancellable::gobj" ref="e19ec1e85fd9cd7893914d4d7c20120d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GCancellable* Gio::Cancellable::gobj </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Provides access to the underlying C GObject. <p> <p>Reimplemented from <a class="el" href="classGlib_1_1ObjectBase.html#4c6efc18be8cb9c56e58fc0bd20fafbe">Glib::ObjectBase</a>.</p> </div> </div><p> <a class="anchor" name="668176a01f7ad3cc13c7448378f37b41"></a><!-- doxytag: member="Gio::Cancellable::gobj" ref="668176a01f7ad3cc13c7448378f37b41" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const GCancellable* Gio::Cancellable::gobj </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Provides access to the underlying C GObject. <p> <p>Reimplemented from <a class="el" href="classGlib_1_1ObjectBase.html#778a94181132976bbfb0519793f3b32e">Glib::ObjectBase</a>.</p> </div> </div><p> <a class="anchor" name="379e6394bad0fff1eb11e1a160f30235"></a><!-- doxytag: member="Gio::Cancellable::gobj_copy" ref="379e6394bad0fff1eb11e1a160f30235" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GCancellable* Gio::Cancellable::gobj_copy </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. <p> </div> </div><p> <a class="anchor" name="8d59324b4c253f8c890901cd934203a7"></a><!-- doxytag: member="Gio::Cancellable::create" ref="8d59324b4c253f8c890901cd934203a7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Cancellable.html">Cancellable</a>> Gio::Cancellable::create </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="47ce5f2f16541b7ae18bc5114b366d8c"></a><!-- doxytag: member="Gio::Cancellable::is_cancelled" ref="47ce5f2f16541b7ae18bc5114b366d8c" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Gio::Cancellable::is_cancelled </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table> </div> <div class="memdoc"> <p> Checks if a cancellable job has been cancelled. <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd><code>true</code> if <em>cancellable</em> is cancelled, <code>false</code> if called with <code>0</code> or if item is not cancelled. </dd></dl> </div> </div><p> <a class="anchor" name="80df23049daf594fda884f2932ce3b95"></a><!-- doxytag: member="Gio::Cancellable::get_fd" ref="80df23049daf594fda884f2932ce3b95" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int Gio::Cancellable::get_fd </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const</td> </tr> </table> </div> <div class="memdoc"> <p> Gets the file descriptor for a cancellable job. <p> This can be used to implement cancellable operations on Unix systems. The returned fd will turn readable when <em>cancellable</em> is cancelled. <dl class="return" compact><dt><b>Returns:</b></dt><dd>A valid file descriptor. -1 if the file descriptor is not supported, or on errors. </dd></dl> </div> </div><p> <a class="anchor" name="86adae0645cec20d09d1a2903fe46cc0"></a><!-- doxytag: member="Gio::Cancellable::cancel" ref="86adae0645cec20d09d1a2903fe46cc0" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gio::Cancellable::cancel </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Will set <em>cancellable</em> to cancelled, and will emit the CANCELLED signal. <p> This function is thread-safe. In other words, you can safely call it from another thread than the one running an operation that was passed the <em>cancellable</em>. </div> </div><p> <a class="anchor" name="af923ce91ddf21fc03bf2902e12cd4e1"></a><!-- doxytag: member="Gio::Cancellable::get_current" ref="af923ce91ddf21fc03bf2902e12cd4e1" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Cancellable.html">Cancellable</a>> Gio::Cancellable::get_current </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [static]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Gets the top cancellable from the stack. <p> <dl class="return" compact><dt><b>Returns:</b></dt><dd>A <a class="el" href="classGio_1_1Cancellable.html" title="Allows actions to be cancelled.">Cancellable</a> from the top of the stack, or <code>0</code> if the stack is empty. </dd></dl> </div> </div><p> <a class="anchor" name="d893da5aebfb4baf34ecdbdad7a3608b"></a><!-- doxytag: member="Gio::Cancellable::push_current" ref="d893da5aebfb4baf34ecdbdad7a3608b" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gio::Cancellable::push_current </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Pushes <em>cancellable</em> onto the cancellable stack. <p> The current cancllable can then be recieved using g_cancellable_get_current().<p> This is useful when implementing cancellable operations in code that does not allow you to pass down the cancellable object.<p> This is typically called automatically by e.g. <a class="el" href="classGio_1_1File.html" title="File and directory handling.">File</a> operations, so you rarely have to call this yourself. </div> </div><p> <a class="anchor" name="93b5a39447d2b4eb9fb56748cb687fc8"></a><!-- doxytag: member="Gio::Cancellable::pop_current" ref="93b5a39447d2b4eb9fb56748cb687fc8" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gio::Cancellable::pop_current </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Pops <em>cancellable</em> off the cancellable stack (verifying that <em>cancellable</em> is on the top of the stack). <p> </div> </div><p> <a class="anchor" name="2285370aea5d98141e742e73743b9c3e"></a><!-- doxytag: member="Gio::Cancellable::reset" ref="2285370aea5d98141e742e73743b9c3e" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Gio::Cancellable::reset </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Resets <em>cancellable</em> to its uncancelled state. <p> </div> </div><p> <a class="anchor" name="5a34d4782ccec014684c4eb6c20cf0a6"></a><!-- doxytag: member="Gio::Cancellable::signal_cancelled" ref="5a34d4782ccec014684c4eb6c20cf0a6" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1SignalProxy0.html">Glib::SignalProxy0</a><void> Gio::Cancellable::signal_cancelled </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> <dl class="user" compact><dt><b>Prototype:</b></dt><dd><code>void on_my_cancelled()</code> </dd></dl> <p> </div> </div><p> <a class="anchor" name="ff017e200824997b9c26d82f147e078f"></a><!-- doxytag: member="Gio::Cancellable::on_cancelled" ref="ff017e200824997b9c26d82f147e078f" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void Gio::Cancellable::on_cancelled </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr><h2>Friends And Related Function Documentation</h2> <a class="anchor" name="c45875da91c9c870a0f154a8249047c0"></a><!-- doxytag: member="Gio::Cancellable::wrap" ref="c45875da91c9c870a0f154a8249047c0" args="(GCancellable *object, bool take_copy=false)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classGlib_1_1RefPtr.html">Glib::RefPtr</a><<a class="el" href="classGio_1_1Cancellable.html">Gio::Cancellable</a>> wrap </td> <td>(</td> <td class="paramtype">GCancellable * </td> <td class="paramname"> <em>object</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>take_copy</em> = <code>false</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [related]</code></td> </tr> </table> </div> <div class="memdoc"> <p> A <a class="el" href="namespaceGlib.html#671306f4a3a0cae5ab4d7a9d54886592">Glib::wrap()</a> method for this object. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>object</em> </td><td>The C instance. </td></tr> <tr><td valign="top"></td><td valign="top"><em>take_copy</em> </td><td>False if the result should take ownership of the C instance. True if it should take a new copy or ref. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>A C++ instance that wraps this C instance. </dd></dl> </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="cancellable_8h.html">cancellable.h</a></ul> </div> <!-- end main content --> <hr><address><small> Generated for glibmm 2.4 by <a href="http://www.doxygen.org/index.html"> Doxygen</a> 1.5.3 © 1997-2001</small></address> </body> </html>