39
39
<tr><td class="mdescLeft"> </td><td class="mdescRight">Connects an I/O channel. <a href="#779227bae6390b055243d1f3083a5388"></a><br></td></tr>
41
41
<hr><h2>Member Function Documentation</h2>
42
<a class="anchor" name="c205b21234d26094e75e0931c968c5d2"></a><!-- doxytag: member="Glib::SignalIO::connect" ref="c205b21234d26094e75e0931c968c5d2" args="(const sigc::slot< bool, IOCondition > &slot, int fd, IOCondition condition, int priority=PRIORITY_DEFAULT)" -->
44
<div class="memproto">
45
<table class="memname">
47
<td class="memname">sigc::connection Glib::SignalIO::connect </td>
49
<td class="paramtype">const sigc::slot<bool, <a class="el" href="group__MainLoop.html#gbd96381793b70d4ae32c725926990918">IOCondition</a>>& </td>
50
<td class="paramname"> <em>slot</em>, </td>
53
<td class="paramkey"></td>
55
<td class="paramtype">int </td>
56
<td class="paramname"> <em>fd</em>, </td>
59
<td class="paramkey"></td>
61
<td class="paramtype"><a class="el" href="group__MainLoop.html#gbd96381793b70d4ae32c725926990918">IOCondition</a> </td>
62
<td class="paramname"> <em>condition</em>, </td>
65
<td class="paramkey"></td>
67
<td class="paramtype">int </td>
68
<td class="paramname"> <em>priority</em> = <code>PRIORITY_DEFAULT</code></td><td> </td>
73
<td></td><td></td><td></td>
80
Connects an I/O handler.
82
<div class="fragment"><pre class="fragment"> <a class="code" href="group__MainLoop.html#gf391654b755a32169d18be4835677376" title="Convenience I/O signal.">Glib::signal_io</a>().connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#ga1">sigc::ptr_fun</a>(&io_handler), fd, <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918f244f3e8c1c9525762f3630befd76336">Glib::IO_IN</a> | <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918b5dcc0e24c236c027b041d362dcff35b">Glib::IO_HUP</a>);
83
</pre></div> is equivalent to: <div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <a class="code" href="classGlib_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">Glib::RefPtr<Glib::IOSource></a> io_source = <a class="code" href="classGlib_1_1Source.html#eaffb039abf99982d7a89403bca71569">Glib::IOSource::create</a>(fd, <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918f244f3e8c1c9525762f3630befd76336">Glib::IO_IN</a> | <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918b5dcc0e24c236c027b041d362dcff35b">Glib::IO_HUP</a>);
84
io_source->connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#ga1">sigc::ptr_fun</a>(&io_handler));
85
io_source->attach(<a class="code" href="classGlib_1_1MainContext.html#1502cbed045a9fb27d18c6975e1d255d" title="Returns the default main context.">Glib::MainContext::get_default</a>());
86
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
87
<table border="0" cellspacing="2" cellpadding="0">
88
<tr><td valign="top"></td><td valign="top"><em>slot</em> </td><td>A slot to call when polling <em>fd</em> results in an event that matches <em>condition</em>. The event will be passed as a parameter to <em>slot</em>. If <em>io_handler</em> returns <code>false</code> the signal is disconnected. </td></tr>
89
<tr><td valign="top"></td><td valign="top"><em>fd</em> </td><td>The file descriptor (or a <code>HANDLE</code> on Win32 systems) to watch. </td></tr>
90
<tr><td valign="top"></td><td valign="top"><em>condition</em> </td><td>The conditions to watch for. </td></tr>
91
<tr><td valign="top"></td><td valign="top"><em>priority</em> </td><td>The priority of the new event source. </td></tr>
94
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A connection handle, which can be used to disconnect the handler. </dd></dl>
98
42
<a class="anchor" name="779227bae6390b055243d1f3083a5388"></a><!-- doxytag: member="Glib::SignalIO::connect" ref="779227bae6390b055243d1f3083a5388" args="(const sigc::slot< bool, IOCondition > &slot, const Glib::RefPtr< IOChannel > &channel, IOCondition condition, int priority=PRIORITY_DEFAULT)" -->
99
43
<div class="memitem">
100
44
<div class="memproto">
98
<a class="anchor" name="c205b21234d26094e75e0931c968c5d2"></a><!-- doxytag: member="Glib::SignalIO::connect" ref="c205b21234d26094e75e0931c968c5d2" args="(const sigc::slot< bool, IOCondition > &slot, int fd, IOCondition condition, int priority=PRIORITY_DEFAULT)" -->
100
<div class="memproto">
101
<table class="memname">
103
<td class="memname">sigc::connection Glib::SignalIO::connect </td>
105
<td class="paramtype">const sigc::slot<bool, <a class="el" href="group__MainLoop.html#gbd96381793b70d4ae32c725926990918">IOCondition</a>>& </td>
106
<td class="paramname"> <em>slot</em>, </td>
109
<td class="paramkey"></td>
111
<td class="paramtype">int </td>
112
<td class="paramname"> <em>fd</em>, </td>
115
<td class="paramkey"></td>
117
<td class="paramtype"><a class="el" href="group__MainLoop.html#gbd96381793b70d4ae32c725926990918">IOCondition</a> </td>
118
<td class="paramname"> <em>condition</em>, </td>
121
<td class="paramkey"></td>
123
<td class="paramtype">int </td>
124
<td class="paramname"> <em>priority</em> = <code>PRIORITY_DEFAULT</code></td><td> </td>
129
<td></td><td></td><td></td>
136
Connects an I/O handler.
138
<div class="fragment"><pre class="fragment"> <a class="code" href="group__MainLoop.html#gf391654b755a32169d18be4835677376" title="Convenience I/O signal.">Glib::signal_io</a>().connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#ga1">sigc::ptr_fun</a>(&io_handler), fd, <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918f244f3e8c1c9525762f3630befd76336">Glib::IO_IN</a> | <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918b5dcc0e24c236c027b041d362dcff35b">Glib::IO_HUP</a>);
139
</pre></div> is equivalent to: <div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <a class="code" href="classGlib_1_1RefPtr.html" title="RefPtr&lt;&gt; is a reference-counting shared smartpointer.">Glib::RefPtr<Glib::IOSource></a> io_source = <a class="code" href="classGlib_1_1Source.html#eaffb039abf99982d7a89403bca71569">Glib::IOSource::create</a>(fd, <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918f244f3e8c1c9525762f3630befd76336">Glib::IO_IN</a> | <a class="code" href="group__MainLoop.html#ggbd96381793b70d4ae32c725926990918b5dcc0e24c236c027b041d362dcff35b">Glib::IO_HUP</a>);
140
io_source->connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#ga1">sigc::ptr_fun</a>(&io_handler));
141
io_source->attach(<a class="code" href="classGlib_1_1MainContext.html#1502cbed045a9fb27d18c6975e1d255d" title="Returns the default main context.">Glib::MainContext::get_default</a>());
142
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
143
<table border="0" cellspacing="2" cellpadding="0">
144
<tr><td valign="top"></td><td valign="top"><em>slot</em> </td><td>A slot to call when polling <em>fd</em> results in an event that matches <em>condition</em>. The event will be passed as a parameter to <em>slot</em>. If <em>io_handler</em> returns <code>false</code> the signal is disconnected. </td></tr>
145
<tr><td valign="top"></td><td valign="top"><em>fd</em> </td><td>The file descriptor (or a <code>HANDLE</code> on Win32 systems) to watch. </td></tr>
146
<tr><td valign="top"></td><td valign="top"><em>condition</em> </td><td>The conditions to watch for. </td></tr>
147
<tr><td valign="top"></td><td valign="top"><em>priority</em> </td><td>The priority of the new event source. </td></tr>
150
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A connection handle, which can be used to disconnect the handler. </dd></dl>
154
154
<hr>The documentation for this class was generated from the following file:<ul>
155
155
<li><a class="el" href="main_8h.html">main.h</a></ul>