chromium/native_client_sdk/doc_generated/pepper_stable/cpp/classpp_1_1_var_array.html

{{+bindTo:partials.standard_nacl_api}}
<h1>pp::VarArray Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->



</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::VarArray" --><!-- doxytag: inherits="pp::Var" --><div class="dynheader">
Inheritance diagram for pp::VarArray:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_var_array__inherit__graph.png" border="0" usemap="#pp_1_1_var_array_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_var_array_inherit__map" id="pp_1_1_var_array_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page." alt="" coords="23,5,89,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_var_array-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a780daccc2dc02eac8a52b3c6acf245ed">VarArray</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a3aabef79f9d8af79a4ef5dda73a09c05">VarArray</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;var)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#abb66ecc726d9aca28bd4a430a391a5d3">VarArray</a> (const PP_Var &amp;var)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a839cc2aa7b5a4698f3a11214f76e56c0">VarArray</a> (const <a class="el" href="classpp_1_1_var_array.html">VarArray</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a667aca2cad8fd48469dab1228f479284">~VarArray</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var_array.html">VarArray</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a5acb01cba7823e5b4096a3d1c1cf31be">operator=</a> (const <a class="el" href="classpp_1_1_var_array.html">VarArray</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#aeb98c95929dd46d1f64eba13db724154">operator=</a> (const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a61f3bd9357da964824bc3dfbc7715b12">Get</a> (uint32_t index) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a6769d254d64ca6f0e5a5321ad9158d89">Set</a> (uint32_t index, const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#afaa8006ed2c7fa4fb99a6d9d96b91f5a">GetLength</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_var_array.html#a6d37da10169a4e9f66152d74231694b9">SetLength</a> (uint32_t length)</td></tr>
</table>
<hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a780daccc2dc02eac8a52b3c6acf245ed"></a><!-- doxytag: member="pp::VarArray::VarArray" ref="a780daccc2dc02eac8a52b3c6acf245ed" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html#a780daccc2dc02eac8a52b3c6acf245ed">pp::VarArray::VarArray</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a new array var. </p>
</div>
</div>
<a class="anchor" id="a3aabef79f9d8af79a4ef5dda73a09c05"></a><!-- doxytag: member="pp::VarArray::VarArray" ref="a3aabef79f9d8af79a4ef5dda73a09c05" args="(const Var &amp;var)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html#a780daccc2dc02eac8a52b3c6acf245ed">pp::VarArray::VarArray</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>var</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <code><a class="el" href="classpp_1_1_var_array.html">VarArray</a></code> given a var for which <a class="el" href="classpp_1_1_var.html#a7a28894a77f9d69d1a4b0272bf80d657" title="This function determines if this Var is an array.">is_array()</a> is true. </p>
<p>This will refer to the same array var, but allow you to access methods specific to arrays.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>An array var. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="abb66ecc726d9aca28bd4a430a391a5d3"></a><!-- doxytag: member="pp::VarArray::VarArray" ref="abb66ecc726d9aca28bd4a430a391a5d3" args="(const PP_Var &amp;var)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html#a780daccc2dc02eac8a52b3c6acf245ed">pp::VarArray::VarArray</a> </td>
<td>(</td>
<td class="paramtype">const PP_Var &amp;&#160;</td>
<td class="paramname"><em>var</em></td><td>)</td>
<td><code> [explicit]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructs a <code><a class="el" href="classpp_1_1_var_array.html">VarArray</a></code> given a <code>PP_Var</code> of type PP_VARTYPE_ARRAY. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">var</td><td>A <code>PP_Var</code> of type PP_VARTYPE_ARRAY. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a839cc2aa7b5a4698f3a11214f76e56c0"></a><!-- doxytag: member="pp::VarArray::VarArray" ref="a839cc2aa7b5a4698f3a11214f76e56c0" args="(const VarArray &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html#a780daccc2dc02eac8a52b3c6acf245ed">pp::VarArray::VarArray</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var_array.html">VarArray</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Copy constructor. </p>
</div>
</div>
<a class="anchor" id="a667aca2cad8fd48469dab1228f479284"></a><!-- doxytag: member="pp::VarArray::~VarArray" ref="a667aca2cad8fd48469dab1228f479284" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_var_array.html#a667aca2cad8fd48469dab1228f479284">pp::VarArray::~VarArray</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a61f3bd9357da964824bc3dfbc7715b12"></a><!-- doxytag: member="pp::VarArray::Get" ref="a61f3bd9357da964824bc3dfbc7715b12" args="(uint32_t index) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var.html">Var</a> <a class="el" href="classpp_1_1_var_array.html#a61f3bd9357da964824bc3dfbc7715b12">pp::VarArray::Get</a> </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets an element from the array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which element to return.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The element at the specified position. If <code>index</code> is larger than or equal to the array length, an undefined var is returned. </dd></dl>
</div>
</div>
<a class="anchor" id="afaa8006ed2c7fa4fb99a6d9d96b91f5a"></a><!-- doxytag: member="pp::VarArray::GetLength" ref="afaa8006ed2c7fa4fb99a6d9d96b91f5a" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">uint32_t <a class="el" href="classpp_1_1_var_array.html#afaa8006ed2c7fa4fb99a6d9d96b91f5a">pp::VarArray::GetLength</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the array length. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The array length. </dd></dl>
</div>
</div>
<a class="anchor" id="a5acb01cba7823e5b4096a3d1c1cf31be"></a><!-- doxytag: member="pp::VarArray::operator=" ref="a5acb01cba7823e5b4096a3d1c1cf31be" args="(const VarArray &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var_array.html">VarArray</a>&amp; pp::VarArray::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var_array.html">VarArray</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Assignment operator. </p>
</div>
</div>
<a class="anchor" id="aeb98c95929dd46d1f64eba13db724154"></a><!-- doxytag: member="pp::VarArray::operator=" ref="aeb98c95929dd46d1f64eba13db724154" args="(const Var &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_var.html">Var</a>&amp; pp::VarArray::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> assignment operator is overridden here so that we can check for assigning a non-array var to a <code><a class="el" href="classpp_1_1_var_array.html">VarArray</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>The array var to be assigned.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The resulting <code><a class="el" href="classpp_1_1_var_array.html">VarArray</a></code> (as a <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code>&amp;). </dd></dl>
<p>Reimplemented from <a class="el" href="classpp_1_1_var.html#a65601024610f1625c9945acb8725d7c4">pp::Var</a>.</p>
</div>
</div>
<a class="anchor" id="a6769d254d64ca6f0e5a5321ad9158d89"></a><!-- doxytag: member="pp::VarArray::Set" ref="a6769d254d64ca6f0e5a5321ad9158d89" args="(uint32_t index, const Var &amp;value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_var_array.html#a6769d254d64ca6f0e5a5321ad9158d89">pp::VarArray::Set</a> </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>index</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the value of an element in the array. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which element to modify. If <code>index</code> is larger than or equal to the array length, the length is updated to be <code>index</code> + 1. Any position in the array that hasn't been set before is set to undefined, i.e., <code>PP_Var</code> of type <code>PP_VARTYPE_UNDEFINED</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to set.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the operation succeeds. </dd></dl>
</div>
</div>
<a class="anchor" id="a6d37da10169a4e9f66152d74231694b9"></a><!-- doxytag: member="pp::VarArray::SetLength" ref="a6d37da10169a4e9f66152d74231694b9" args="(uint32_t length)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_var_array.html#a6d37da10169a4e9f66152d74231694b9">pp::VarArray::SetLength</a> </td>
<td>(</td>
<td class="paramtype">uint32_t&#160;</td>
<td class="paramname"><em>length</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets the array length. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>The new array length. If <code>length</code> is smaller than its current value, the array is truncated to the new length; any elements that no longer fit are removed. If <code>length</code> is larger than its current value, undefined vars are appended to increase the array to the specified length.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>bool</code> indicating whether the operation succeeds. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="var__array_8h.html">var_array.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}