534 lines
31 KiB
HTML
534 lines
31 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, First, Other > 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.2.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, First, Other > 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:ada871f4f73d072442cad5da1926eb0a8"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">iterator_type</a> = Iterator</td></tr>
|
|
<tr class="separator:ada871f4f73d072442cad5da1926eb0a8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad9dc37ca8b83a1ebcc0c5860e3327c0f"><td class="memItemLeft" align="right" valign="top"><a id="ad9dc37ca8b83a1ebcc0c5860e3327c0f"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#ad9dc37ca8b83a1ebcc0c5860e3327c0f">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:ad9dc37ca8b83a1ebcc0c5860e3327c0f"><td class="mdescLeft"> </td><td class="mdescRight">Underlying entity identifier. <br /></td></tr>
|
|
<tr class="separator:ad9dc37ca8b83a1ebcc0c5860e3327c0f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1f398913dffcfcdc1200c1fc0f28b1dd"><td class="memItemLeft" align="right" valign="top"><a id="a1f398913dffcfcdc1200c1fc0f28b1dd"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a1f398913dffcfcdc1200c1fc0f28b1dd">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:a1f398913dffcfcdc1200c1fc0f28b1dd"><td class="mdescLeft"> </td><td class="mdescRight">Unsigned integer type. <br /></td></tr>
|
|
<tr class="separator:a1f398913dffcfcdc1200c1fc0f28b1dd"><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:a87458191a9cffea5e9fc10e36f85cf3e"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a87458191a9cffea5e9fc10e36f85cf3e">View</a> (<a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< First > &pool, <a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< Other > &... other) noexcept</td></tr>
|
|
<tr class="memdesc:a87458191a9cffea5e9fc10e36f85cf3e"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a view out of a bunch of pools of components. <a href="#a87458191a9cffea5e9fc10e36f85cf3e">More...</a><br /></td></tr>
|
|
<tr class="separator:a87458191a9cffea5e9fc10e36f85cf3e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aecf54fad5f9fce08a3e452fcd304ed9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#aecf54fad5f9fce08a3e452fcd304ed9c">begin</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:aecf54fad5f9fce08a3e452fcd304ed9c"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator to the first entity that has the given components. <a href="#aecf54fad5f9fce08a3e452fcd304ed9c">More...</a><br /></td></tr>
|
|
<tr class="separator:aecf54fad5f9fce08a3e452fcd304ed9c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a61dbd65a57f56771f6b9aff282592055"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a61dbd65a57f56771f6b9aff282592055">end</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a61dbd65a57f56771f6b9aff282592055"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator that is past the last entity that has the given components. <a href="#a61dbd65a57f56771f6b9aff282592055">More...</a><br /></td></tr>
|
|
<tr class="separator:a61dbd65a57f56771f6b9aff282592055"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a180a7c5c8dc1974f4549ce3198e3fd97"><td class="memTemplParams" colspan="2">template<typename Component > </td></tr>
|
|
<tr class="memitem:a180a7c5c8dc1974f4549ce3198e3fd97"><td class="memTemplItemLeft" align="right" valign="top">const Component & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a180a7c5c8dc1974f4549ce3198e3fd97">get</a> (<a class="el" href="classentt_1_1View.html#ad9dc37ca8b83a1ebcc0c5860e3327c0f">entity_type</a> entity) const noexcept</td></tr>
|
|
<tr class="memdesc:a180a7c5c8dc1974f4549ce3198e3fd97"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a180a7c5c8dc1974f4549ce3198e3fd97">More...</a><br /></td></tr>
|
|
<tr class="separator:a180a7c5c8dc1974f4549ce3198e3fd97"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2118e7980d218aaf2c8f1083bee42812"><td class="memTemplParams" colspan="2">template<typename Component > </td></tr>
|
|
<tr class="memitem:a2118e7980d218aaf2c8f1083bee42812"><td class="memTemplItemLeft" align="right" valign="top">Component & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a2118e7980d218aaf2c8f1083bee42812">get</a> (<a class="el" href="classentt_1_1View.html#ad9dc37ca8b83a1ebcc0c5860e3327c0f">entity_type</a> entity) noexcept</td></tr>
|
|
<tr class="memdesc:a2118e7980d218aaf2c8f1083bee42812"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a2118e7980d218aaf2c8f1083bee42812">More...</a><br /></td></tr>
|
|
<tr class="separator:a2118e7980d218aaf2c8f1083bee42812"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5b6e5a111649d0f539595908dc86c7bc"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:a5b6e5a111649d0f539595908dc86c7bc"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a5b6e5a111649d0f539595908dc86c7bc">each</a> (Func &&func)</td></tr>
|
|
<tr class="memdesc:a5b6e5a111649d0f539595908dc86c7bc"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#a5b6e5a111649d0f539595908dc86c7bc">More...</a><br /></td></tr>
|
|
<tr class="separator:a5b6e5a111649d0f539595908dc86c7bc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a202a9758bbfc0494a7c19e501bbc292c"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:a202a9758bbfc0494a7c19e501bbc292c"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a202a9758bbfc0494a7c19e501bbc292c">each</a> (Func &&func) const</td></tr>
|
|
<tr class="memdesc:a202a9758bbfc0494a7c19e501bbc292c"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#a202a9758bbfc0494a7c19e501bbc292c">More...</a><br /></td></tr>
|
|
<tr class="separator:a202a9758bbfc0494a7c19e501bbc292c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2a12951d1032876dd9c534cba78f0f14"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View.html#a2a12951d1032876dd9c534cba78f0f14">reset</a> ()</td></tr>
|
|
<tr class="memdesc:a2a12951d1032876dd9c534cba78f0f14"><td class="mdescLeft"> </td><td class="mdescRight">Resets the view and reinitializes it. <a href="#a2a12951d1032876dd9c534cba78f0f14">More...</a><br /></td></tr>
|
|
<tr class="separator:a2a12951d1032876dd9c534cba78f0f14"><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 First, typename... Other><br />
|
|
class entt::View< Entity, First, Other ></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">First</td><td>One of the components to iterate. </td></tr>
|
|
<tr><td class="paramname">Other</td><td>The rest of the components to iterate. </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="ada871f4f73d072442cad5da1926eb0a8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ada871f4f73d072442cad5da1926eb0a8">◆ </a></span>iterator_type</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">using <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, First, Other >::<a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">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#l00361">361</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="a87458191a9cffea5e9fc10e36f85cf3e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a87458191a9cffea5e9fc10e36f85cf3e">◆ </a></span>View()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </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, First, Other >::<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>< First > & </td>
|
|
<td class="paramname"><em>pool</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< Other > &... </td>
|
|
<td class="paramname"><em>other</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</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">pool</td><td>A reference to a pool of components. </td></tr>
|
|
<tr><td class="paramname">other</td><td>Other references to pools of components. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00372">372</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="aecf54fad5f9fce08a3e452fcd304ed9c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aecf54fad5f9fce08a3e452fcd304ed9c">◆ </a></span>begin()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">iterator_type</a> <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, First, Other >::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#a61dbd65a57f56771f6b9aff282592055" 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#l00392">392</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5b6e5a111649d0f539595908dc86c7bc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5b6e5a111649d0f539595908dc86c7bc">◆ </a></span>each() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </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, First, Other >::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#ad9dc37ca8b83a1ebcc0c5860e3327c0f">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#l00475">475</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a202a9758bbfc0494a7c19e501bbc292c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a202a9758bbfc0494a7c19e501bbc292c">◆ </a></span>each() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </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, First, Other >::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#ad9dc37ca8b83a1ebcc0c5860e3327c0f">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#l00497">497</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a61dbd65a57f56771f6b9aff282592055"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a61dbd65a57f56771f6b9aff282592055">◆ </a></span>end()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classentt_1_1View.html#ada871f4f73d072442cad5da1926eb0a8">iterator_type</a> <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, First, Other >::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#l00411">411</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a180a7c5c8dc1974f4549ce3198e3fd97"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a180a7c5c8dc1974f4549ce3198e3fd97">◆ </a></span>get() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </div>
|
|
<div class="memtemplate">
|
|
template<typename Component > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const Component& <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, First, Other >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View.html#ad9dc37ca8b83a1ebcc0c5860e3327c0f">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">Component</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#l00433">433</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2118e7980d218aaf2c8f1083bee42812"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2118e7980d218aaf2c8f1083bee42812">◆ </a></span>get() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </div>
|
|
<div class="memtemplate">
|
|
template<typename Component > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">Component& <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, First, Other >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View.html#ad9dc37ca8b83a1ebcc0c5860e3327c0f">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">Component</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#l00455">455</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2a12951d1032876dd9c534cba78f0f14"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2a12951d1032876dd9c534cba78f0f14">◆ </a></span>reset()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename Entity , typename First , typename... Other> </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, First, Other >::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#l00513">513</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>
|