522 lines
30 KiB
HTML
522 lines
30 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.13"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>entt: entt::View< Entity, Component > 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 style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">entt
|
|
 <span id="projectnumber">2.3.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.13 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</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">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespaceentt.html">entt</a></li><li class="navelem"><a class="el" href="classentt_1_1View.html">View</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Classes</a> |
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classentt_1_1View-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">entt::View< Entity, Component > Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Multi component view.
|
|
<a href="classentt_1_1View.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="view_8hpp_source.html">view.hpp</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:a738fb04a466b1f858a1eb5d7bc8fd668"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> = Iterator</td></tr>
|
|
<tr class="separator:a738fb04a466b1f858a1eb5d7bc8fd668"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad167f4bc8202231d768a7b18218bae5b"><td class="memItemLeft" align="right" valign="top"><a id="ad167f4bc8202231d768a7b18218bae5b"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#a7d36e852257a965a9a0ed3fb636433e2">base_pool_type::entity_type</a></td></tr>
|
|
<tr class="memdesc:ad167f4bc8202231d768a7b18218bae5b"><td class="mdescLeft"> </td><td class="mdescRight">Underlying entity identifier. <br /></td></tr>
|
|
<tr class="separator:ad167f4bc8202231d768a7b18218bae5b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5e5dea5b319460081befdf84ec3aacf4"><td class="memItemLeft" align="right" valign="top"><a id="a5e5dea5b319460081befdf84ec3aacf4"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a5e5dea5b319460081befdf84ec3aacf4">size_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#ab81c48dcee7a1104ee82794613ee7ed2">base_pool_type::size_type</a></td></tr>
|
|
<tr class="memdesc:a5e5dea5b319460081befdf84ec3aacf4"><td class="mdescLeft"> </td><td class="mdescRight">Unsigned integer type. <br /></td></tr>
|
|
<tr class="separator:a5e5dea5b319460081befdf84ec3aacf4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a8eb8d63c9db031af7203b5ca7801c7e3"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a8eb8d63c9db031af7203b5ca7801c7e3">View</a> (<a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< Component > &... pools) noexcept</td></tr>
|
|
<tr class="memdesc:a8eb8d63c9db031af7203b5ca7801c7e3"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a view out of a bunch of pools of components. <a href="#a8eb8d63c9db031af7203b5ca7801c7e3">More...</a><br /></td></tr>
|
|
<tr class="separator:a8eb8d63c9db031af7203b5ca7801c7e3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae351dc5fef90e54a61187310d1e7d9ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#ae351dc5fef90e54a61187310d1e7d9ba">begin</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:ae351dc5fef90e54a61187310d1e7d9ba"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator to the first entity that has the given components. <a href="#ae351dc5fef90e54a61187310d1e7d9ba">More...</a><br /></td></tr>
|
|
<tr class="separator:ae351dc5fef90e54a61187310d1e7d9ba"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af683298434cb58f86f0025cdb585eda2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#af683298434cb58f86f0025cdb585eda2">end</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:af683298434cb58f86f0025cdb585eda2"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator that is past the last entity that has the given components. <a href="#af683298434cb58f86f0025cdb585eda2">More...</a><br /></td></tr>
|
|
<tr class="separator:af683298434cb58f86f0025cdb585eda2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8d304a255fae2eb2f027dcc7f8d9618d"><td class="memTemplParams" colspan="2">template<typename Comp > </td></tr>
|
|
<tr class="memitem:a8d304a255fae2eb2f027dcc7f8d9618d"><td class="memTemplItemLeft" align="right" valign="top">const Comp & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a8d304a255fae2eb2f027dcc7f8d9618d">get</a> (<a class="el" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a> entity) const noexcept</td></tr>
|
|
<tr class="memdesc:a8d304a255fae2eb2f027dcc7f8d9618d"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a8d304a255fae2eb2f027dcc7f8d9618d">More...</a><br /></td></tr>
|
|
<tr class="separator:a8d304a255fae2eb2f027dcc7f8d9618d"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a643c0ea0a035790f7dc45b1a7c79429f"><td class="memTemplParams" colspan="2">template<typename Comp > </td></tr>
|
|
<tr class="memitem:a643c0ea0a035790f7dc45b1a7c79429f"><td class="memTemplItemLeft" align="right" valign="top">Comp & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a643c0ea0a035790f7dc45b1a7c79429f">get</a> (<a class="el" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a> entity) noexcept</td></tr>
|
|
<tr class="memdesc:a643c0ea0a035790f7dc45b1a7c79429f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a643c0ea0a035790f7dc45b1a7c79429f">More...</a><br /></td></tr>
|
|
<tr class="separator:a643c0ea0a035790f7dc45b1a7c79429f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a85eea1ef9655368de8da355019fbeaa0"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:a85eea1ef9655368de8da355019fbeaa0"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a85eea1ef9655368de8da355019fbeaa0">each</a> (Func func) const</td></tr>
|
|
<tr class="memdesc:a85eea1ef9655368de8da355019fbeaa0"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#a85eea1ef9655368de8da355019fbeaa0">More...</a><br /></td></tr>
|
|
<tr class="separator:a85eea1ef9655368de8da355019fbeaa0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6c540ac6937e6e9cf931cccaabcec745"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:a6c540ac6937e6e9cf931cccaabcec745"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a6c540ac6937e6e9cf931cccaabcec745">each</a> (Func func)</td></tr>
|
|
<tr class="memdesc:a6c540ac6937e6e9cf931cccaabcec745"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#a6c540ac6937e6e9cf931cccaabcec745">More...</a><br /></td></tr>
|
|
<tr class="separator:a6c540ac6937e6e9cf931cccaabcec745"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aba5aedb326adfcc24d6a6d8d0c7d21b3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#aba5aedb326adfcc24d6a6d8d0c7d21b3">reset</a> ()</td></tr>
|
|
<tr class="memdesc:aba5aedb326adfcc24d6a6d8d0c7d21b3"><td class="mdescLeft"> </td><td class="mdescRight">Resets the view and reinitializes it. <a href="#aba5aedb326adfcc24d6a6d8d0c7d21b3">More...</a><br /></td></tr>
|
|
<tr class="separator:aba5aedb326adfcc24d6a6d8d0c7d21b3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<typename Entity, typename... Component><br />
|
|
class entt::View< Entity, Component ></h3>
|
|
|
|
<p>Multi component view. </p>
|
|
<p>Multi component views iterate over those entities that have at least all the given components in their bags. During initialization, a multi component view looks at the number of entities available for each component and picks up a reference to the smallest set of candidate entities in order to get a performance boost when iterate.<br />
|
|
Order of elements during iterations are highly dependent on the order of the underlying data strctures. See <a class="el" href="classentt_1_1SparseSet.html" title="Sparse set. ">SparseSet</a> and its specializations for more details.</p>
|
|
<p><b>Important</b> </p>
|
|
<p>Iterators aren't invalidated if:</p>
|
|
<ul>
|
|
<li>New instances of the given components are created and assigned to entities.</li>
|
|
<li>The entity currently pointed is modified (as an example, if one of the given components is removed from the entity to which the iterator points).</li>
|
|
</ul>
|
|
<p>In all the other cases, modify the pools of the given components somehow invalidates all the iterators and using them results in undefined behavior.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>Views share references to the underlying data structures with the <a class="el" href="classentt_1_1Registry.html" title="Fast and reliable entity-component system. ">Registry</a> that generated them. Therefore any change to the entities and to the components made by means of the registry are immediately reflected by views.</dd></dl>
|
|
<dl class="section warning"><dt>Warning</dt><dd>Lifetime of a view must overcome the one of the registry that generated it. In any other case, attempting to use a view results in undefined behavior.</dd></dl>
|
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html" title="Single component view specialization. ">View<Entity, Component></a> </dd>
|
|
<dd>
|
|
<a class="el" href="classentt_1_1PersistentView.html" title="Persistent view. ">PersistentView</a></dd></dl>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">Entity</td><td>A valid entity type (see <a class="el" href="structentt_1_1entt__traits.html" title="Entity traits. ">entt_traits</a> for more details). </td></tr>
|
|
<tr><td class="paramname">Component</td><td>Types of components iterated by the view. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00301">301</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
</div><h2 class="groupheader">Member Typedef Documentation</h2>
|
|
<a id="a738fb04a466b1f858a1eb5d7bc8fd668"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a738fb04a466b1f858a1eb5d7bc8fd668">◆ </a></span>iterator_type</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">using <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::<a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> = Iterator</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Input iterator type. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00363">363</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="a8eb8d63c9db031af7203b5ca7801c7e3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8eb8d63c9db031af7203b5ca7801c7e3">◆ </a></span>View()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::<a class="el" href="classentt_1_1View.html">View</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< Component > &... </td>
|
|
<td class="paramname"><em>pools</em></td><td>)</td>
|
|
<td></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>Constructs a view out of a bunch of pools of components. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">pools</td><td>References to pools of components. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00373">373</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="ae351dc5fef90e54a61187310d1e7d9ba"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae351dc5fef90e54a61187310d1e7d9ba">◆ </a></span>begin()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::begin </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>Returns an iterator to the first entity that has the given components. </p>
|
|
<p>The returned iterator points to the first entity that has the given components. If the view is empty, the returned iterator will be equal to <code><a class="el" href="classentt_1_1View.html#af683298434cb58f86f0025cdb585eda2" title="Returns an iterator that is past the last entity that has the given components. ">end()</a></code>.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>Input iterators stay true to the order imposed to the underlying data structures.</dd></dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An iterator to the first entity that has the given components. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00393">393</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a85eea1ef9655368de8da355019fbeaa0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a85eea1ef9655368de8da355019fbeaa0">◆ </a></span>each() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<div class="memtemplate">
|
|
template<typename Func > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::each </td>
|
|
<td>(</td>
|
|
<td class="paramtype">Func </td>
|
|
<td class="paramname"><em>func</em></td><td>)</td>
|
|
<td> const</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>Iterate the entities and applies them the given function object. </p>
|
|
<p>The function object is invoked for each entity. It is provided with the entity itself and a set of const references to all the components of the view.<br />
|
|
The signature of the function should be equivalent to the following:</p>
|
|
<div class="fragment"><div class="line">void(<a class="code" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a>, <span class="keyword">const</span> Component &...);</div></div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">Func</td><td>Type of the function object to invoke. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">func</td><td>A valid function object. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00476">476</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6c540ac6937e6e9cf931cccaabcec745"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6c540ac6937e6e9cf931cccaabcec745">◆ </a></span>each() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<div class="memtemplate">
|
|
template<typename Func > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::each </td>
|
|
<td>(</td>
|
|
<td class="paramtype">Func </td>
|
|
<td class="paramname"><em>func</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>Iterate the entities and applies them the given function object. </p>
|
|
<p>The function object is invoked for each entity. It is provided with the entity itself and a set of references to all the components of the view.<br />
|
|
The signature of the function should be equivalent to the following:</p>
|
|
<div class="fragment"><div class="line">void(<a class="code" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a>, Component &...);</div></div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">Func</td><td>Type of the function object to invoke. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">func</td><td>A valid function object. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00498">498</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="af683298434cb58f86f0025cdb585eda2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af683298434cb58f86f0025cdb585eda2">◆ </a></span>end()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classentt_1_1View.html#a738fb04a466b1f858a1eb5d7bc8fd668">iterator_type</a> <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::end </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>Returns an iterator that is past the last entity that has the given components. </p>
|
|
<p>The returned iterator points to the entity following the last entity that has the given components. Attempting to dereference the returned iterator results in undefined behavior.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>Input iterators stay true to the order imposed to the underlying data structures.</dd></dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>An iterator to the entity following the last entity that has the given components. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00412">412</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8d304a255fae2eb2f027dcc7f8d9618d"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8d304a255fae2eb2f027dcc7f8d9618d">◆ </a></span>get() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<div class="memtemplate">
|
|
template<typename Comp > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const Comp& <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a> </td>
|
|
<td class="paramname"><em>entity</em></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>Returns the component assigned to the given entity. </p>
|
|
<p>Prefer this function instead of <code><a class="el" href="classentt_1_1Registry.html#aad2f79d8d9637a5f666a7121f379a0dd" title="Returns a reference to a tag. ">Registry::get</a></code> during iterations. It has far better performance than its companion function.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>Attempting to use an invalid component type results in a compilation error. Attempting to use an entity that doesn't belong to the view results in undefined behavior.<br />
|
|
An assertion will abort the execution at runtime in debug mode if the view doesn't contain the given entity.</dd></dl>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">Comp</td><td>Type of the component to get. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">entity</td><td>A valid entity identifier. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The component assigned to the entity. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00434">434</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a643c0ea0a035790f7dc45b1a7c79429f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a643c0ea0a035790f7dc45b1a7c79429f">◆ </a></span>get() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<div class="memtemplate">
|
|
template<typename Comp > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">Comp& <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View.html#ad167f4bc8202231d768a7b18218bae5b">entity_type</a> </td>
|
|
<td class="paramname"><em>entity</em></td><td>)</td>
|
|
<td></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>Returns the component assigned to the given entity. </p>
|
|
<p>Prefer this function instead of <code><a class="el" href="classentt_1_1Registry.html#aad2f79d8d9637a5f666a7121f379a0dd" title="Returns a reference to a tag. ">Registry::get</a></code> during iterations. It has far better performance than its companion function.</p>
|
|
<dl class="section warning"><dt>Warning</dt><dd>Attempting to use an invalid component type results in a compilation error. Attempting to use an entity that doesn't belong to the view results in undefined behavior.<br />
|
|
An assertion will abort the execution at runtime in debug mode if the view doesn't contain the given entity.</dd></dl>
|
|
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
|
<table class="tparams">
|
|
<tr><td class="paramname">Comp</td><td>Type of the component to get. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">entity</td><td>A valid entity identifier. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>The component assigned to the entity. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00456">456</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aba5aedb326adfcc24d6a6d8d0c7d21b3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aba5aedb326adfcc24d6a6d8d0c7d21b3">◆ </a></span>reset()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename... Component> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::reset </td>
|
|
<td>(</td>
|
|
<td class="paramname"></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>Resets the view and reinitializes it. </p>
|
|
<p>A multi component view keeps a reference to the smallest set of candidate entities to iterate. Resetting a view means querying the underlying data structures and reinitializing the view.<br />
|
|
Use it only if copies of views are stored around and there is a possibility that a component has become the best candidate in the meantime. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00514">514</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>src/entt/entity/<a class="el" href="view_8hpp_source.html">view.hpp</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.13
|
|
</small></address>
|
|
</body>
|
|
</html>
|