618 lines
37 KiB
HTML
618 lines
37 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::PersistentView< 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.1.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_1PersistentView.html">PersistentView</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classentt_1_1PersistentView-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">entt::PersistentView< Entity, Component > Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Persistent view.
|
|
<a href="classentt_1_1PersistentView.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:ae563ed31a62fd9f33f93767f0ecdfff5"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#a1ad77aed1e49af60b61044c996969b9a">view_type::iterator_type</a></td></tr>
|
|
<tr class="separator:ae563ed31a62fd9f33f93767f0ecdfff5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5195c9d1dede0fe6c40bea576398022b"><td class="memItemLeft" align="right" valign="top"><a id="a5195c9d1dede0fe6c40bea576398022b"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">entity_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#a7d36e852257a965a9a0ed3fb636433e2">view_type::entity_type</a></td></tr>
|
|
<tr class="memdesc:a5195c9d1dede0fe6c40bea576398022b"><td class="mdescLeft"> </td><td class="mdescRight">Underlying entity identifier. <br /></td></tr>
|
|
<tr class="separator:a5195c9d1dede0fe6c40bea576398022b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac2e81caacece38b84f46c4430cd8cf4e"><td class="memItemLeft" align="right" valign="top"><a id="ac2e81caacece38b84f46c4430cd8cf4e"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ac2e81caacece38b84f46c4430cd8cf4e">size_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#ab81c48dcee7a1104ee82794613ee7ed2">view_type::size_type</a></td></tr>
|
|
<tr class="memdesc:ac2e81caacece38b84f46c4430cd8cf4e"><td class="mdescLeft"> </td><td class="mdescRight">Unsigned integer type. <br /></td></tr>
|
|
<tr class="separator:ac2e81caacece38b84f46c4430cd8cf4e"><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:ab673895244500555493f7eb31c2a1728"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ab673895244500555493f7eb31c2a1728">PersistentView</a> (<a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html">view_type</a> &view, <a class="el" href="classentt_1_1SparseSet.html">pool_type</a>< Component > &... pools) noexcept</td></tr>
|
|
<tr class="memdesc:ab673895244500555493f7eb31c2a1728"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a persistent view around a dedicated pool of entities. <a href="#ab673895244500555493f7eb31c2a1728">More...</a><br /></td></tr>
|
|
<tr class="separator:ab673895244500555493f7eb31c2a1728"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a416b2794ee8c13ac0f793e2a7a9ae769"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1PersistentView.html#ac2e81caacece38b84f46c4430cd8cf4e">size_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#a416b2794ee8c13ac0f793e2a7a9ae769">size</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a416b2794ee8c13ac0f793e2a7a9ae769"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of entities that have the given components. <a href="#a416b2794ee8c13ac0f793e2a7a9ae769">More...</a><br /></td></tr>
|
|
<tr class="separator:a416b2794ee8c13ac0f793e2a7a9ae769"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac6f07a78cd7cac6dc9574877e1073a19"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">entity_type</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ac6f07a78cd7cac6dc9574877e1073a19">data</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:ac6f07a78cd7cac6dc9574877e1073a19"><td class="mdescLeft"> </td><td class="mdescRight">Direct access to the list of entities. <a href="#ac6f07a78cd7cac6dc9574877e1073a19">More...</a><br /></td></tr>
|
|
<tr class="separator:ac6f07a78cd7cac6dc9574877e1073a19"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a56b0ad24d885281b2985b083553a1156"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#a56b0ad24d885281b2985b083553a1156">begin</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a56b0ad24d885281b2985b083553a1156"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator to the first entity that has the given components. <a href="#a56b0ad24d885281b2985b083553a1156">More...</a><br /></td></tr>
|
|
<tr class="separator:a56b0ad24d885281b2985b083553a1156"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a48703efeadcd08915f32e5c647db5754"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#a48703efeadcd08915f32e5c647db5754">end</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a48703efeadcd08915f32e5c647db5754"><td class="mdescLeft"> </td><td class="mdescRight">Returns an iterator that is past the last entity that has the given components. <a href="#a48703efeadcd08915f32e5c647db5754">More...</a><br /></td></tr>
|
|
<tr class="separator:a48703efeadcd08915f32e5c647db5754"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a7b1ca9cc827871a1dbab18e5cbc0826a"><td class="memTemplParams" colspan="2">template<typename Comp > </td></tr>
|
|
<tr class="memitem:a7b1ca9cc827871a1dbab18e5cbc0826a"><td class="memTemplItemLeft" align="right" valign="top">const Comp & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#a7b1ca9cc827871a1dbab18e5cbc0826a">get</a> (<a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">entity_type</a> entity) const noexcept</td></tr>
|
|
<tr class="memdesc:a7b1ca9cc827871a1dbab18e5cbc0826a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a7b1ca9cc827871a1dbab18e5cbc0826a">More...</a><br /></td></tr>
|
|
<tr class="separator:a7b1ca9cc827871a1dbab18e5cbc0826a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae9378e3f7e89b0f460874100d0e0ee56"><td class="memTemplParams" colspan="2">template<typename Comp > </td></tr>
|
|
<tr class="memitem:ae9378e3f7e89b0f460874100d0e0ee56"><td class="memTemplItemLeft" align="right" valign="top">Comp & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ae9378e3f7e89b0f460874100d0e0ee56">get</a> (<a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">entity_type</a> entity) noexcept</td></tr>
|
|
<tr class="memdesc:ae9378e3f7e89b0f460874100d0e0ee56"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#ae9378e3f7e89b0f460874100d0e0ee56">More...</a><br /></td></tr>
|
|
<tr class="separator:ae9378e3f7e89b0f460874100d0e0ee56"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab54c38a7a90a563d84bcb8a5a4cb35f0"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:ab54c38a7a90a563d84bcb8a5a4cb35f0"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#ab54c38a7a90a563d84bcb8a5a4cb35f0">each</a> (Func &&func)</td></tr>
|
|
<tr class="memdesc:ab54c38a7a90a563d84bcb8a5a4cb35f0"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#ab54c38a7a90a563d84bcb8a5a4cb35f0">More...</a><br /></td></tr>
|
|
<tr class="separator:ab54c38a7a90a563d84bcb8a5a4cb35f0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aebb19186c199c12890b64eed95173049"><td class="memTemplParams" colspan="2">template<typename Func > </td></tr>
|
|
<tr class="memitem:aebb19186c199c12890b64eed95173049"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#aebb19186c199c12890b64eed95173049">each</a> (Func &&func) const</td></tr>
|
|
<tr class="memdesc:aebb19186c199c12890b64eed95173049"><td class="mdescLeft"> </td><td class="mdescRight">Iterate the entities and applies them the given function object. <a href="#aebb19186c199c12890b64eed95173049">More...</a><br /></td></tr>
|
|
<tr class="separator:aebb19186c199c12890b64eed95173049"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:accde3d4b4a904e79c832f6b05f324b05"><td class="memTemplParams" colspan="2">template<typename Comp > </td></tr>
|
|
<tr class="memitem:accde3d4b4a904e79c832f6b05f324b05"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classentt_1_1PersistentView.html#accde3d4b4a904e79c832f6b05f324b05">sort</a> ()</td></tr>
|
|
<tr class="memdesc:accde3d4b4a904e79c832f6b05f324b05"><td class="mdescLeft"> </td><td class="mdescRight">Sort the shared pool of entities according to the given component. <a href="#accde3d4b4a904e79c832f6b05f324b05">More...</a><br /></td></tr>
|
|
<tr class="separator:accde3d4b4a904e79c832f6b05f324b05"><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::PersistentView< Entity, Component ></h3>
|
|
|
|
<p>Persistent view. </p>
|
|
<p>A persistent view returns all the entities and only the entities that have at least the given components. Moreover, it's guaranteed that the entity list is thightly packed in memory for fast iterations.<br />
|
|
In general, persistent views don't stay true to the order of any set of components unless users explicitly sort them.</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.<br />
|
|
Moreover, sorting a persistent view affects all the other views of the same type (it means that users don't have to call <code>sort</code> on each view to sort all of them because they share the set of entities).</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.html" title="Multi component view. ">View</a> </dd>
|
|
<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></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#l00053">53</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="ae563ed31a62fd9f33f93767f0ecdfff5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae563ed31a62fd9f33f93767f0ecdfff5">◆ </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_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::<a class="el" href="classentt_1_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> = typename <a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html#a1ad77aed1e49af60b61044c996969b9a">view_type::iterator_type</a></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#l00063">63</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="ab673895244500555493f7eb31c2a1728"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab673895244500555493f7eb31c2a1728">◆ </a></span>PersistentView()</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_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::<a class="el" href="classentt_1_1PersistentView.html">PersistentView</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1SparseSet_3_01Entity_01_4.html">view_type</a> & </td>
|
|
<td class="paramname"><em>view</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></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>
|
|
</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">explicit</span><span class="mlabel">noexcept</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Constructs a persistent view around a dedicated pool of entities. </p>
|
|
<p>A persistent view is created out of:</p><ul>
|
|
<li>A dedicated pool of entities that is shared between all the persistent views of the same type.</li>
|
|
<li>A bunch of pools of components to which to refer to get instances.</li>
|
|
</ul>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">view</td><td>Shared reference to a dedicated pool of entities. </td></tr>
|
|
<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#l00080">80</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="a56b0ad24d885281b2985b083553a1156"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a56b0ad24d885281b2985b083553a1156">◆ </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_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> <a class="el" href="classentt_1_1PersistentView.html">entt::PersistentView</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_1PersistentView.html#a48703efeadcd08915f32e5c647db5754" 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#l00122">122</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac6f07a78cd7cac6dc9574877e1073a19"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac6f07a78cd7cac6dc9574877e1073a19">◆ </a></span>data()</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">const <a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">entity_type</a>* <a class="el" href="classentt_1_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::data </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>Direct access to the list of entities. </p>
|
|
<p>The returned pointer is such that range <code>[<a class="el" href="classentt_1_1PersistentView.html#ac6f07a78cd7cac6dc9574877e1073a19" title="Direct access to the list of entities. ">data()</a>, <a class="el" href="classentt_1_1PersistentView.html#ac6f07a78cd7cac6dc9574877e1073a19" title="Direct access to the list of entities. ">data()</a> + <a class="el" href="classentt_1_1PersistentView.html#a416b2794ee8c13ac0f793e2a7a9ae769" title="Returns the number of entities that have the given components. ">size()</a>]</code> is always a valid range, even if the container is empty.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>There are no guarantees on the order of the entities. Use <code>begin</code> and <code>end</code> if you want to iterate the view in the expected order.</dd></dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>A pointer to the array of entities. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00104">104</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab54c38a7a90a563d84bcb8a5a4cb35f0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab54c38a7a90a563d84bcb8a5a4cb35f0">◆ </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_1PersistentView.html">entt::PersistentView</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_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">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#l00205">205</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aebb19186c199c12890b64eed95173049"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aebb19186c199c12890b64eed95173049">◆ </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_1PersistentView.html">entt::PersistentView</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_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">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#l00227">227</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a48703efeadcd08915f32e5c647db5754"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a48703efeadcd08915f32e5c647db5754">◆ </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_1PersistentView.html#ae563ed31a62fd9f33f93767f0ecdfff5">iterator_type</a> <a class="el" href="classentt_1_1PersistentView.html">entt::PersistentView</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#l00141">141</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a7b1ca9cc827871a1dbab18e5cbc0826a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a7b1ca9cc827871a1dbab18e5cbc0826a">◆ </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_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">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#a904b71bae3eaa69d534b4dc41c15e889" title="Gets a reference to the given component owned by the given entity. ">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#l00163">163</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ae9378e3f7e89b0f460874100d0e0ee56"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae9378e3f7e89b0f460874100d0e0ee56">◆ </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_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1PersistentView.html#a5195c9d1dede0fe6c40bea576398022b">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#a904b71bae3eaa69d534b4dc41c15e889" title="Gets a reference to the given component owned by the given entity. ">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#l00185">185</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a416b2794ee8c13ac0f793e2a7a9ae769"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a416b2794ee8c13ac0f793e2a7a9ae769">◆ </a></span>size()</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_1PersistentView.html#ac2e81caacece38b84f46c4430cd8cf4e">size_type</a> <a class="el" href="classentt_1_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::size </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 the number of entities that have the given components. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Number of entities that have the given components. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00088">88</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="accde3d4b4a904e79c832f6b05f324b05"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#accde3d4b4a904e79c832f6b05f324b05">◆ </a></span>sort()</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">void <a class="el" href="classentt_1_1PersistentView.html">entt::PersistentView</a>< Entity, Component >::sort </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>Sort the shared pool of entities according to the given component. </p>
|
|
<p>Persistent views of the same type share with the <a class="el" href="classentt_1_1Registry.html" title="Fast and reliable entity-component system. ">Registry</a> a pool of entities with its own order that doesn't depend on the order of any pool of components. Users can order the underlying data structure so that it respects the order of the pool of the given component.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>The shared pool of entities and thus its order is affected by the changes to each and every pool of components that it tracks. Therefore changes to the pools of components can quickly ruin the order imposed to the pool of entities shared between the persistent views.</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 use to impose the order. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00250">250</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>
|