<!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> <title>Parrot - fixed size array for PMCs only</title> <link rel="stylesheet" type="text/css" href="../../../resources/parrot.css" media="all"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div id="wrapper"> <div id="header"> <a href="http://www.parrot.org"> <img border=0 src="../../../resources/parrot_logo.png" id="logo" alt="parrot"> </a> </div> <!-- "header" --> <div id="divider"></div> <div id="mainbody"> <div id="breadcrumb"> <a href="../../../html/index.html">Home</a> » <a href="../../../html/pmc.html">PMCs</a> » fixed size array for PMCs only </div> <h1><a name="NAME" >NAME</a></h1> <p>src/pmc/fixedpmcarray.pmc - fixed size array for PMCs only</p> <h1><a name="DESCRIPTION" >DESCRIPTION</a></h1> <p>This class, FixedPMCArray, implements an array of fixed size which stores PMCs. It puts things into Integer, Float, or String PMCs as appropriate</p> <h2><a name="Note" >Note</a></h2> <p>The flag <code>PObj_private0_FLAG</code> is used in the <code>NameSpace</code> PMC and should never be set for user arrays.</p> <h2><a name="Functions" >Functions</a></h2> <dl> <dt><a name="METHOD_sort(PMC_*cmp_func)" ><b><code>METHOD sort(PMC *cmp_func)</b></code></a></dt> Sort this array, optionally using the provided cmp_func</dl> <h2><a name="Methods" >Methods</a></h2> <dl> <dt><a name="void_init_int(INTVAL_size)" ><b><code>void init_int(INTVAL size)</b></code></a></dt> Initializes the array. <dt><a name="void_destroy()" ><b><code>void destroy()</b></code></a></dt> Destroys the array. <dt><a name="PMC_*clone()" ><b><code>PMC *clone()</b></code></a></dt> Creates and returns a copy of the array. <dt><a name="INTVAL_get_bool()" ><b><code>INTVAL get_bool()</b></code></a></dt> Returns whether the array has any elements (meaning been initialized, for a fixed sized array). <dt><a name="INTVAL_elements()" ><b><code>INTVAL elements()</b></code></a></dt> <dt><a name="INTVAL_get_integer()" ><b><code>INTVAL get_integer()</b></code></a></dt> Returns the number of elements in the array. <dt><a name="FLOATVAL_get_number()" ><b><code>FLOATVAL get_number()</b></code></a></dt> Returns the number of elements in the array. <dt><a name="STRING_*get_string()" ><b><code>STRING *get_string()</b></code></a></dt> Returns the number of elements in the array as a Parrot string. (??? -leo) <dt><a name="STRING_*get_repr()" ><b><code>STRING *get_repr()</b></code></a></dt> Returns a string representation of the array contents. TT #1229: implement freeze/thaw and use that instead. <dt><a name="INTVAL_get_integer_keyed_int(INTVAL_key)" ><b><code>INTVAL get_integer_keyed_int(INTVAL key)</b></code></a></dt> Returns the integer value of the element at index <code>key</code>. <dt><a name="INTVAL_get_integer_keyed(PMC_*key)" ><b><code>INTVAL get_integer_keyed(PMC *key)</b></code></a></dt> Returns the integer value of the element at index <code>*key</code>. <dt><a name="FLOATVAL_get_number_keyed_int(INTVAL_key)" ><b><code>FLOATVAL get_number_keyed_int(INTVAL key)</b></code></a></dt> Returns the floating-point value of the element at index <code>key</code>. <dt><a name="FLOATVAL_get_number_keyed(PMC_*key)" ><b><code>FLOATVAL get_number_keyed(PMC *key)</b></code></a></dt> Returns the floating-point value of the element at index <code>*key</code>. <dt><a name="STRING_*get_string_keyed_int(INTVAL_key)" ><b><code>STRING *get_string_keyed_int(INTVAL key)</b></code></a></dt> Returns the Parrot string value of the element at index <code>key</code>. <dt><a name="STRING_*get_string_keyed(PMC_*key)" ><b><code>STRING *get_string_keyed(PMC *key)</b></code></a></dt> Returns the Parrot string value of the element at index <code>*key</code>. <dt><a name="PMC_*get_pmc_keyed_int(INTVAL_key)" ><b><code>PMC *get_pmc_keyed_int(INTVAL key)</b></code></a></dt> Returns the PMC value of the element at index <code>key</code>. <dt><a name="PMC_*get_pmc_keyed(PMC_*key)" ><b><code>PMC *get_pmc_keyed(PMC *key)</b></code></a></dt> Returns the PMC value of the element at index <code>*key</code>. <dt><a name="void_set_integer_native(INTVAL_size)" ><b><code>void set_integer_native(INTVAL size)</b></code></a></dt> Sizes the array to <code>size</code> elements. Can't be used to resize an array. <dt><a name="void_set_integer_keyed_int(INTVAL_key,_INTVAL_value)" ><b><code>void set_integer_keyed_int(INTVAL key, INTVAL value)</b></code></a></dt> Sets the integer value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_integer_keyed(PMC_*key,_INTVAL_value)" ><b><code>void set_integer_keyed(PMC *key, INTVAL value)</b></code></a></dt> Sets the integer value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_number_keyed_int(INTVAL_key,_FLOATVAL_value)" ><b><code>void set_number_keyed_int(INTVAL key, FLOATVAL value)</b></code></a></dt> Sets the floating-point value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_number_keyed(PMC_*key,_FLOATVAL_value)" ><b><code>void set_number_keyed(PMC *key, FLOATVAL value)</b></code></a></dt> Sets the floating-point value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_string_keyed_int(INTVAL_key,_STRING_*value)" ><b><code>void set_string_keyed_int(INTVAL key, STRING *value)</b></code></a></dt> Sets the Parrot string value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_string_keyed(PMC_*key,_STRING_*value)" ><b><code>void set_string_keyed(PMC *key, STRING *value)</b></code></a></dt> Sets the string value of the element at index <code>key</code> to <code>value</code>. <dt><a name="void_set_pmc_keyed_int(INTVAL_key,_PMC_*src)" ><b><code>void set_pmc_keyed_int(INTVAL key, PMC *src)</b></code></a></dt> Sets the PMC value of the element at index <code>key</code> to <code>*src</code>. <dt><a name="void_set_pmc_keyed(PMC_*key,_PMC_*value)" ><b><code>void set_pmc_keyed(PMC *key, PMC *value)</b></code></a></dt> Sets the PMC at index <code>key</code> to <code>value</code>. <dt><a name="INTVAL_is_equal(PMC_*value)" ><b><code>INTVAL is_equal(PMC *value)</b></code></a></dt> The <code>==</code> operation. Compares two array to hold equal elements. <dt><a name="PMC_*get_iter()" ><b><code>PMC *get_iter()</b></code></a></dt> Return a new iterator for SELF. <dt><a name="INTVAL_exists_keyed_int(INTVAL_key)" ><b><code>INTVAL exists_keyed_int(INTVAL key)</b></code></a></dt> <dt><a name="INTVAL_exists_keyed_int(PMC_*key)" ><b><code>INTVAL exists_keyed_int(PMC *key)</b></code></a></dt> Returns TRUE is the element at <code>key</code> exists; otherwise returns false. <dt><a name="void_splice(PMC_*value,_INTVAL_offset,_INTVAL_count)" ><b><code>void splice(PMC *value, INTVAL offset, INTVAL count)</b></code></a></dt> Replaces <code>count</code> elements starting at <code>offset</code> with the elements in <code>value</code>.If <code>count</code> is 0 then the elements in <code>value</code> will be inserted after <code>offset</code>.This throws an exception if any of the spliced in values are out of the range of this array. <dt><a name="void_visit(PMC_*info)" ><b><code>void visit(PMC *info)</b></code></a></dt> This is used by freeze/thaw to visit the contents of the array.<code>*info</code> is the visit info, (see <em>include/parrot/pmc_freeze.h</em>). <dt><a name="void_freeze(PMC_*info)" ><b><code>void freeze(PMC *info)</b></code></a></dt> Used to archive the array. <dt><a name="void_thaw(PMC_*info)" ><b><code>void thaw(PMC *info)</b></code></a></dt> Used to unarchive the array. <dt><a name="INTVAL_defined_keyed_int(INTVAL_key)" ><b><code>INTVAL defined_keyed_int(INTVAL key)</b></code></a></dt> Returns TRUE is the element at <code>key</code> is defined; otherwise returns false. <dt><a name="void_mark(void)" ><b><code>void mark(void)</b></code></a></dt> Mark the array.</dl> <h1><a name="Auxiliar_functions" >Auxiliar functions</a></h1> <dl> <dt><a name="static_void_cannot_autovivify_nested(PARROT_INTERP)" ><b><code>static void cannot_autovivify_nested(PARROT_INTERP)</b></code></a></dt> */PARROT_DOES_NOT_RETURN static void cannot_autovivify_nested(PARROT_INTERP) { ASSERT_ARGS(cannot_autovivify_nested) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, "Cannot autovivify nested arrays"); }/*</dl> <h1><a name="SEE_ALSO" >SEE ALSO</a></h1> <p><em>docs/pdds/pdd17_basic_types.pod</em>.</p> </div> <!-- "mainbody" --> <div id="divider"></div> <div id="footer"> Copyright © 2002-2011, Parrot Foundation. </div> </div> <!-- "wrapper" --> </body> </html>