NAME

src/pmc/packfileconstanttable.pmc - PackfileConstantTable PMC

DESCRIPTION

This class implements a PackfileConstantTable object, a segment of the .pbc data file used for storing constants of various types. (int, string, PMC)

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.

Methods

init
Create empty PackfileConstantTable.
void mark()
Marks the object as live.
set_pointer
Set pointer to underlying PackFile_ConstTable
void *get_pointer()
INTVAL num_count()
INTVAL str_count()
INTVAL pmc_count()
Get the number of constants.
FLOATVAL get_number_keyed_int(INTVAL index)
Fetch a numeric constant.
STRING *get_string_keyed_int(INTVAL index)
Fetch a string constant.
PMC *get_pmc_keyed_int(INTVAL index)
Fetch a PMC constant.
void set_number_keyed_int(INTVAL index, FLOATVAL value)
Set the constant to the given number.
void set_string_keyed_int(INTVAL index, STRING *value)
Set the constant to the given string.
void set_pmc_keyed_int(INTVAL index, PMC *value)
Set the constant to the given PMC (or key).
void set_main(INTVAL index)
Set the :main flag in a Sub in the constant table.Experimental. Use with care. There is no way to set the private flags from PIR, so we need something like this.If something goes wrong, blame NotFound.
INTVAL get_or_create_constant()
Get or create constant for passed value.
METHOD type()
Set segment type.