NAME ^

src/pmc/fixedintegerarray.pmc - fixed size array for integers only

DESCRIPTION ^

This class, FixedIntegerArray, implements an array of fixed size which stores INTVALs. It uses Integer PMCs for all of the conversions.

Functions ^

Methods ^

void init()

Initializes the array.

PMC new_from_string(STRING *rep, INTVAL flags)

Class method to construct an array from the string representation rep, which is a string "(el0, el1, ...)". flags may have the PObj_constant_FLAG bit set, which will be honored to create a PMC in the constant PMC pool.

void destroy()

Destroys the array.

PMC *clone()

Creates and returns a copy of the array.

INTVAL get_bool()

Returns whether the array has any elements (meaning been initialized, for a fixed sized array).

INTVAL elements()

INTVAL get_integer()

Returns the number of elements in the array.

INTVAL get_integer_keyed_int(INTVAL key)

Returns the integer value of the element at index key.

INTVAL get_integer_keyed(PMC *key)

Returns the integer value of the element at index *key.

FLOATVAL get_number_keyed_int(INTVAL key)

Returns the floating-point value of the element at index key.

FLOATVAL get_number_keyed(PMC *key)

Returns the floating-point value of the element at index *key.

STRING *get_string_keyed_int(INTVAL key)

Returns the Parrot string value of the element at index key.

STRING *get_repr()

Returns the Parrot string representation key.

STRING *get_string_keyed(PMC *key)

Returns the Parrot string value of the element at index *key.

PMC *get_pmc_keyed_int(INTVAL key)

Returns the PMC value of the element at index key.

PMC *get_pmc_keyed(PMC *key)

Returns the PMC value of the element at index *key.

void set_integer_native(INTVAL size)

Resizes the array to size elements.

void set_integer_keyed_int(INTVAL key, INTVAL value)

Sets the integer value of the element at index key to value.

void set_integer_keyed(PMC *key, INTVAL value)

Sets the integer value of the element at index key to value.

void set_number_keyed_int(INTVAL key, FLOATVAL value)

Sets the floating-point value of the element at index key to value.

void set_number_keyed(PMC *key, FLOATVAL value)

Sets the floating-point value of the element at index key to value.

void set_string_keyed_int(INTVAL key, STRING *value)

Sets the Parrot string value of the element at index key to value.

void set_string_keyed(PMC *key, STRING *value)

Sets the string value of the element at index key to value.

void set_pmc_keyed_int(INTVAL key, PMC *src)

Sets the PMC value of the element at index key to *src.

void set_pmc_keyed(PMC *key, PMC *value)

Sets the string value of the element at index key to value.

void visit(visit_info *info)

This is used by freeze/thaw to visit the contents of the array.

*info is the visit info, (see include/parrot/pmc_freeze.h).

void freeze(visit_info *info)

Used to archive the array.

void thaw(visit_info *info)

Used to unarchive the array.

SEE ALSO ^

docs/pdds/pdd17_basic_types.pod.


parrot