634 lines
40 KiB
HTML
634 lines
40 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.4.1</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_3_01Entity_00_01Component_01_4.html">View< Entity, Component ></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_1View_3_01Entity_00_01Component_01_4-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>Single component view specialization.
|
|
<a href="classentt_1_1View_3_01Entity_00_01Component_01_4.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:ac6be1bdfe4c0f864fc7deb04f418aadf"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">iterator_type</a> = typename pool_type::iterator_type</td></tr>
|
|
<tr class="separator:ac6be1bdfe4c0f864fc7deb04f418aadf"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a75fc64bf381a3003d8acf03ed66728f2"><td class="memItemLeft" align="right" valign="top"><a id="a75fc64bf381a3003d8acf03ed66728f2"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">entity_type</a> = typename pool_type::entity_type</td></tr>
|
|
<tr class="memdesc:a75fc64bf381a3003d8acf03ed66728f2"><td class="mdescLeft"> </td><td class="mdescRight">Underlying entity identifier. <br /></td></tr>
|
|
<tr class="separator:a75fc64bf381a3003d8acf03ed66728f2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afa754b0f10b28dbdb2149b5b8d0fdf73"><td class="memItemLeft" align="right" valign="top"><a id="afa754b0f10b28dbdb2149b5b8d0fdf73"></a>
|
|
using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#afa754b0f10b28dbdb2149b5b8d0fdf73">size_type</a> = typename pool_type::size_type</td></tr>
|
|
<tr class="memdesc:afa754b0f10b28dbdb2149b5b8d0fdf73"><td class="mdescLeft"> </td><td class="mdescRight">Unsigned integer type. <br /></td></tr>
|
|
<tr class="separator:afa754b0f10b28dbdb2149b5b8d0fdf73"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8bdfb1fbdd4340131be9c70bf02671b5"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a> = typename pool_type::object_type</td></tr>
|
|
<tr class="separator:a8bdfb1fbdd4340131be9c70bf02671b5"><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:a24c7693fd64b152591a1a63d46f8e91f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a24c7693fd64b152591a1a63d46f8e91f">View</a> (<a class="el" href="classentt_1_1SparseSet.html">pool_type</a> &pool) noexcept</td></tr>
|
|
<tr class="memdesc:a24c7693fd64b152591a1a63d46f8e91f"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a view out of a pool of components. <a href="#a24c7693fd64b152591a1a63d46f8e91f">More...</a><br /></td></tr>
|
|
<tr class="separator:a24c7693fd64b152591a1a63d46f8e91f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6f5d49e4b67890cf53d1c3c25879fb81"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#afa754b0f10b28dbdb2149b5b8d0fdf73">size_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a6f5d49e4b67890cf53d1c3c25879fb81">size</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a6f5d49e4b67890cf53d1c3c25879fb81"><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of entities that have the given component. <a href="#a6f5d49e4b67890cf53d1c3c25879fb81">More...</a><br /></td></tr>
|
|
<tr class="separator:a6f5d49e4b67890cf53d1c3c25879fb81"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa5bfe21925dfd6af9bb8aba65d9bccd5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#aa5bfe21925dfd6af9bb8aba65d9bccd5">raw</a> () noexcept</td></tr>
|
|
<tr class="memdesc:aa5bfe21925dfd6af9bb8aba65d9bccd5"><td class="mdescLeft"> </td><td class="mdescRight">Direct access to the list of components. <a href="#aa5bfe21925dfd6af9bb8aba65d9bccd5">More...</a><br /></td></tr>
|
|
<tr class="separator:aa5bfe21925dfd6af9bb8aba65d9bccd5"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1ad9504a013794b2e3f08feefc5b4c58"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a1ad9504a013794b2e3f08feefc5b4c58">raw</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a1ad9504a013794b2e3f08feefc5b4c58"><td class="mdescLeft"> </td><td class="mdescRight">Direct access to the list of components. <a href="#a1ad9504a013794b2e3f08feefc5b4c58">More...</a><br /></td></tr>
|
|
<tr class="separator:a1ad9504a013794b2e3f08feefc5b4c58"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a78f5d9ebb636c6acb391d802ad13fede"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">entity_type</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a78f5d9ebb636c6acb391d802ad13fede">data</a> () const noexcept</td></tr>
|
|
<tr class="memdesc:a78f5d9ebb636c6acb391d802ad13fede"><td class="mdescLeft"> </td><td class="mdescRight">Direct access to the list of entities. <a href="#a78f5d9ebb636c6acb391d802ad13fede">More...</a><br /></td></tr>
|
|
<tr class="separator:a78f5d9ebb636c6acb391d802ad13fede"><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_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.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 component. <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_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">iterator_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.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 component. <a href="#af683298434cb58f86f0025cdb585eda2">More...</a><br /></td></tr>
|
|
<tr class="separator:af683298434cb58f86f0025cdb585eda2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a831d0d782118c26ca8efe00c452f4b21"><td class="memItemLeft" align="right" valign="top">const Component & </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a831d0d782118c26ca8efe00c452f4b21">get</a> (<a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">entity_type</a> entity) const noexcept</td></tr>
|
|
<tr class="memdesc:a831d0d782118c26ca8efe00c452f4b21"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a831d0d782118c26ca8efe00c452f4b21">More...</a><br /></td></tr>
|
|
<tr class="separator:a831d0d782118c26ca8efe00c452f4b21"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a97f303e914e114df37e12fd4556efff6"><td class="memItemLeft" align="right" valign="top">Component & </td><td class="memItemRight" valign="bottom"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a97f303e914e114df37e12fd4556efff6">get</a> (<a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">entity_type</a> entity) noexcept</td></tr>
|
|
<tr class="memdesc:a97f303e914e114df37e12fd4556efff6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the component assigned to the given entity. <a href="#a97f303e914e114df37e12fd4556efff6">More...</a><br /></td></tr>
|
|
<tr class="separator:a97f303e914e114df37e12fd4556efff6"><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_3_01Entity_00_01Component_01_4.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_3_01Entity_00_01Component_01_4.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>
|
|
</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>Single component view specialization. </p>
|
|
<p>Single component views are specialized in order to get a boost in terms of performance. This kind of views can access the underlying data structure directly and avoid superflous checks.<br />
|
|
Order of elements during iterations are highly dependent on the order of the underlying data structure. 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 a reference to the underlying data structure 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.html" title="Multi component view. ">View</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>Type of the component iterated by the view. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00565">565</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="ac6be1bdfe4c0f864fc7deb04f418aadf"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac6be1bdfe4c0f864fc7deb04f418aadf">◆ </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_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">iterator_type</a> = typename pool_type::iterator_type</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#l00570">570</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8bdfb1fbdd4340131be9c70bf02671b5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8bdfb1fbdd4340131be9c70bf02671b5">◆ </a></span>raw_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_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a> = typename pool_type::object_type</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Type of the component iterated by the view. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00576">576</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="a24c7693fd64b152591a1a63d46f8e91f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a24c7693fd64b152591a1a63d46f8e91f">◆ </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> & </td>
|
|
<td class="paramname"><em>pool</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 pool 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>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00582">582</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_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">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 component. </p>
|
|
<p>The returned iterator points to the first entity that has the given component. If the view is empty, the returned iterator will be equal to <code><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#af683298434cb58f86f0025cdb585eda2" title="Returns an iterator that is past the last entity that has the given component. ">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 component. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00656">656</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a78f5d9ebb636c6acb391d802ad13fede"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a78f5d9ebb636c6acb391d802ad13fede">◆ </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_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">entity_type</a>* <a class="el" href="classentt_1_1View.html">entt::View</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_1View_3_01Entity_00_01Component_01_4.html#a78f5d9ebb636c6acb391d802ad13fede" title="Direct access to the list of entities. ">data()</a>, <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a78f5d9ebb636c6acb391d802ad13fede" title="Direct access to the list of entities. ">data()</a> + <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a6f5d49e4b67890cf53d1c3c25879fb81" title="Returns the number of entities that have the given component. ">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#l00638">638</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 const reference to the component 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_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">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#l00732">732</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 reference to the component 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_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">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#l00753">753</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_3_01Entity_00_01Component_01_4.html#ac6be1bdfe4c0f864fc7deb04f418aadf">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 component. </p>
|
|
<p>The returned iterator points to the entity following the last entity that has the given component. 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 component. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00675">675</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a831d0d782118c26ca8efe00c452f4b21"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a831d0d782118c26ca8efe00c452f4b21">◆ </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>
|
|
<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, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">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 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="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#l00694">694</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a97f303e914e114df37e12fd4556efff6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a97f303e914e114df37e12fd4556efff6">◆ </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>
|
|
<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, Component >::get </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a75fc64bf381a3003d8acf03ed66728f2">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 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="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#l00713">713</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa5bfe21925dfd6af9bb8aba65d9bccd5"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa5bfe21925dfd6af9bb8aba65d9bccd5">◆ </a></span>raw() <span class="overload">[1/2]</span></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_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a>* <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::raw </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 class="mlabel">noexcept</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Direct access to the list of components. </p>
|
|
<p>The returned pointer is such that range <code>[<a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#aa5bfe21925dfd6af9bb8aba65d9bccd5" title="Direct access to the list of components. ">raw()</a>, <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#aa5bfe21925dfd6af9bb8aba65d9bccd5" title="Direct access to the list of components. ">raw()</a> + <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a6f5d49e4b67890cf53d1c3c25879fb81" title="Returns the number of entities that have the given component. ">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 components. 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 components. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00606">606</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1ad9504a013794b2e3f08feefc5b4c58"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1ad9504a013794b2e3f08feefc5b4c58">◆ </a></span>raw() <span class="overload">[2/2]</span></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_1View_3_01Entity_00_01Component_01_4.html#a8bdfb1fbdd4340131be9c70bf02671b5">raw_type</a>* <a class="el" href="classentt_1_1View.html">entt::View</a>< Entity, Component >::raw </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 components. </p>
|
|
<p>The returned pointer is such that range <code>[<a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#aa5bfe21925dfd6af9bb8aba65d9bccd5" title="Direct access to the list of components. ">raw()</a>, <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#aa5bfe21925dfd6af9bb8aba65d9bccd5" title="Direct access to the list of components. ">raw()</a> + <a class="el" href="classentt_1_1View_3_01Entity_00_01Component_01_4.html#a6f5d49e4b67890cf53d1c3c25879fb81" title="Returns the number of entities that have the given component. ">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 components. 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 components. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00622">622</a> of file <a class="el" href="view_8hpp_source.html">view.hpp</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6f5d49e4b67890cf53d1c3c25879fb81"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6f5d49e4b67890cf53d1c3c25879fb81">◆ </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_1View_3_01Entity_00_01Component_01_4.html#afa754b0f10b28dbdb2149b5b8d0fdf73">size_type</a> <a class="el" href="classentt_1_1View.html">entt::View</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 component. </p>
|
|
<dl class="section return"><dt>Returns</dt><dd>Number of entities that have the given component. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="view_8hpp_source.html#l00590">590</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>
|