<!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 - PackfileConstantTable PMC</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> » PackfileConstantTable PMC </div> <h1><a name="NAME" >NAME</a></h1> <p>src/pmc/packfileconstanttable.pmc - PackfileConstantTable PMC</p> <h1><a name="DESCRIPTION" >DESCRIPTION</a></h1> <p>This class implements a PackfileConstantTable object, a segment of the .pbc data file used for storing constants of various types. (int, string, PMC)</p> <p>See packfile.pmc for the toplevel Packfile interface, see packfilesegment.pmc for the list of common methods every packfile segment pmc must implement; see PDD13 for the design spec.</p> <h2><a name="Methods" >Methods</a></h2> <dl> <dt><a name="init" ><b><code>init</b></code></a></dt> Create empty PackfileConstantTable. <dt><a name="void_mark()" ><b><code>void mark()</b></code></a></dt> Marks the object as live. <dt><a name="set_pointer" ><b><code>set_pointer</b></code></a></dt> Set pointer to underlying PackFile_ConstTable <dt><a name="void_*get_pointer()" ><b><code>void *get_pointer()</b></code></a></dt> <dt><a name="INTVAL_elements()" ><b><code>INTVAL elements()</b></code></a></dt> Get the number of elements in the array. <dt><a name="FLOATVAL_get_number_keyed_int(INTVAL_index)" ><b><code>FLOATVAL get_number_keyed_int(INTVAL index)</b></code></a></dt> Fetch a numeric constant. An exception is thrown if the given constant isn't numeric. <dt><a name="STRING_*get_string_keyed_int(INTVAL_index)" ><b><code>STRING *get_string_keyed_int(INTVAL index)</b></code></a></dt> Fetch a string constant. An exception is thrown if the given constant isn't a string. <dt><a name="PMC_*get_pmc_keyed_int(INTVAL_index)" ><b><code>PMC *get_pmc_keyed_int(INTVAL index)</b></code></a></dt> Fetch a PMC constant. An exception is thrown if the given constant isn't a PMC. <dt><a name="void_set_number_keyed_int(INTVAL_index,_FLOATVAL_value)" ><b><code>void set_number_keyed_int(INTVAL index, FLOATVAL value)</b></code></a></dt> Set the constant to the given number. <dt><a name="void_set_string_keyed_int(INTVAL_index,_STRING_*value)" ><b><code>void set_string_keyed_int(INTVAL index, STRING *value)</b></code></a></dt> Set the constant to the given string. <dt><a name="void_set_pmc_keyed_int(INTVAL_index,_PMC_*value)" ><b><code>void set_pmc_keyed_int(INTVAL index, PMC *value)</b></code></a></dt> Set the constant to the given PMC (or key). <dt><a name="INTVAL_get_type(INTVAL_index)" ><b><code>INTVAL get_type(INTVAL index)</b></code></a></dt> Get the type of the specified constant. Possible type IDs: <dl> <dt><a name="0x00_-_No_constant" >0x00 - No constant</a></dt> <dt><a name="0x6E_-_Number_constant" >0x6E - Number constant</a></dt> <dt><a name="0x73_-_String_constant" >0x73 - String constant</a></dt> <dt><a name="0x70_-_PMC_constant" >0x70 - PMC constant</a></dt> <dt><a name="0x6B_-_Key_constant" >0x6B - Key constant</a></dt> </dl> <dt><a name="INTVAL_get_or_create_constant()" ><b><code>INTVAL get_or_create_constant()</b></code></a></dt> Get or create constant for passed value. <dt><a name="METHOD_type()" ><b><code>METHOD type()</b></code></a></dt> Set segment type.</dl> </div> <!-- "mainbody" --> <div id="divider"></div> <div id="footer"> Copyright © 2002-2009, Parrot Foundation. </div> </div> <!-- "wrapper" --> </body> </html>