uvw/classuvw_1_1Emitter.html
2023-05-22 11:13:58 +02:00

233 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>uvw: uvw::emitter&lt; T, E &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">uvw<span id="projectnumber">&#160;3.1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceuvw.html">uvw</a></li><li class="navelem"><a class="el" href="classuvw_1_1emitter.html">emitter</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classuvw_1_1emitter-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">uvw::emitter&lt; T, E &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">
<p>Event emitter base class.
<a href="classuvw_1_1emitter.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="emitter_8h_source.html">emitter.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for uvw::emitter&lt; T, E &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classuvw_1_1emitter__inherit__graph.png" border="0" usemap="#auvw_1_1emitter_3_01T_00_01E_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="auvw_1_1emitter_3_01T_00_01E_01_4_inherit__map" id="auvw_1_1emitter_3_01T_00_01E_01_4_inherit__map">
<area shape="rect" title="Event emitter base class." alt="" coords="5,832,144,857"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="223,5,371,60"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="223,84,371,139"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="211,163,383,203"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="225,228,370,283"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="207,307,388,347"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="214,372,381,427"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="229,451,365,491"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="217,516,377,571"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="222,595,373,649"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="221,674,373,714"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="199,739,395,793"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="192,817,403,872"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="230,896,365,951"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="229,975,366,1029"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="230,1053,365,1108"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="219,1132,375,1187"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="218,1211,377,1265"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="224,1289,371,1344"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="216,1368,379,1423"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="226,1447,369,1501"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="218,1525,377,1580"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="215,1604,380,1659"/>
<area shape="rect" href="classuvw_1_1resource.html" title=" " alt="" coords="221,1683,374,1723"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab913fa1c005a33c73b2eb2b0d1051b1f"><td class="memTemplParams" colspan="2">template&lt;typename U &gt; </td></tr>
<tr class="memitem:ab913fa1c005a33c73b2eb2b0d1051b1f"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classuvw_1_1emitter.html#ab913fa1c005a33c73b2eb2b0d1051b1f">on</a> (listener_t&lt; U &gt; f)</td></tr>
<tr class="memdesc:ab913fa1c005a33c73b2eb2b0d1051b1f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a long-lived listener with the event emitter. <br /></td></tr>
<tr class="separator:ab913fa1c005a33c73b2eb2b0d1051b1f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:accff5c096692f5eebbe941189644e69d"><td class="memTemplParams" colspan="2"><a id="accff5c096692f5eebbe941189644e69d" name="accff5c096692f5eebbe941189644e69d"></a>
template&lt;typename U &gt; </td></tr>
<tr class="memitem:accff5c096692f5eebbe941189644e69d"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><b>reset</b> () noexcept</td></tr>
<tr class="memdesc:accff5c096692f5eebbe941189644e69d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnects the listener for the given event type. <br /></td></tr>
<tr class="separator:accff5c096692f5eebbe941189644e69d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa71435e74e775cfa7012fe2e52ca5193"><td class="memItemLeft" align="right" valign="top"><a id="aa71435e74e775cfa7012fe2e52ca5193" name="aa71435e74e775cfa7012fe2e52ca5193"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>reset</b> () noexcept</td></tr>
<tr class="memdesc:aa71435e74e775cfa7012fe2e52ca5193"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnects all listeners. <br /></td></tr>
<tr class="separator:aa71435e74e775cfa7012fe2e52ca5193"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac02a29fe156faba7571b50450fc4f780"><td class="memTemplParams" colspan="2">template&lt;typename U &gt; </td></tr>
<tr class="memitem:ac02a29fe156faba7571b50450fc4f780"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classuvw_1_1emitter.html#ac02a29fe156faba7571b50450fc4f780">has</a> () const noexcept</td></tr>
<tr class="memdesc:ac02a29fe156faba7571b50450fc4f780"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if there is a listener registered for the specific event. <br /></td></tr>
<tr class="separator:ac02a29fe156faba7571b50450fc4f780"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename T, typename... E&gt;<br />
class uvw::emitter&lt; T, E &gt;</div><p>Event emitter base class. </p>
<p>Almost everything in <code>uvw</code> is an event emitter.<br />
This is the base class from which resources and loops inherit. </p>
<p class="definition">Definition at line <a class="el" href="emitter_8h_source.html#l00083">83</a> of file <a class="el" href="emitter_8h_source.html">emitter.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ac02a29fe156faba7571b50450fc4f780" name="ac02a29fe156faba7571b50450fc4f780"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac02a29fe156faba7571b50450fc4f780">&#9670;&#160;</a></span>has()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , typename... E&gt; </div>
<div class="memtemplate">
template&lt;typename U &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classuvw_1_1emitter.html">uvw::emitter</a>&lt; T, E &gt;::has </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Checks if there is a listener registered for the specific event. </p>
<dl class="section return"><dt>Returns</dt><dd>True if there is a listener registered for the specific event, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="emitter_8h_source.html#l00145">145</a> of file <a class="el" href="emitter_8h_source.html">emitter.h</a>.</p>
</div>
</div>
<a id="ab913fa1c005a33c73b2eb2b0d1051b1f" name="ab913fa1c005a33c73b2eb2b0d1051b1f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab913fa1c005a33c73b2eb2b0d1051b1f">&#9670;&#160;</a></span>on()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T , typename... E&gt; </div>
<div class="memtemplate">
template&lt;typename U &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classuvw_1_1emitter.html">uvw::emitter</a>&lt; T, E &gt;::on </td>
<td>(</td>
<td class="paramtype">listener_t&lt; U &gt;&#160;</td>
<td class="paramname"><em>f</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Registers a long-lived listener with the event emitter. </p>
<p>This method is used to register a listener with the emitter.<br />
A listener is usually defined as a callable object assignable to a <code>std::function&lt;void(const E &amp;, T &amp;)</code>, where <code>E</code> is the type of the event and <code>T</code> is the type of the resource.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">f</td><td>A valid listener to be registered. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="emitter_8h_source.html#l00123">123</a> of file <a class="el" href="emitter_8h_source.html">emitter.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/uvw/<a class="el" href="emitter_8h_source.html">emitter.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>