NAME
src/pmc/resizablepmcarray.pmc - resizable array for PMCs only
DESCRIPTION
This class, ResizablePMCArray, implements an resizable array which stores PMCs. It puts things into Integer, Float, or String PMCs as appropriate.
Functions
void set_integer_native(INTVAL size)
Resizes the array to FLOATVAL shift_float()
INTVAL shift_integer()
PMC *shift_pmc()
STRING *shift_string()
Removes and returns an item from the start of the array.
PMC *get_pmc_keyed_int(INTVAL key)
Returns the PMC value of the element at index void set_pmc_keyed_int(INTVAL key, PMC *src)
Sets the PMC value of the element at index void set_pmc_keyed(PMC *key, PMC *src)
If key is a slice,
do a splice as set that item.
INTVAL exists_keyed_int(INTVAL key)
INTVAL exists_keyed_int(PMC *key)
Returns TRUE is the element at INTVAL defined_keyed_int(INTVAL key)
Returns TRUE is the element at void push_float(FLOATVAL value)
void push_integer(INTVAL value)
void push_pmc(PMC *value)
void push_string(STRING *value)
Extends the array by adding an element of value INTVAL pop_float()
INTVAL pop_integer()
PMC *pop_pmc()
STRING *pop_string()
void unshift_float(FLOATVAL value)
void unshift_integer(INTVAL value)
void unshift_pmc(PMC *value)
void unshift_string(STRING *value)
Extends the array by adding an element of value PMC *clone()
Creates and returns a copy of the array.
INTVAL is_equal(PMC *value)
The - METHOD append(PMC *other) Append the other array to this array.
STRING *get_repr()
Returns the Parrot string representation void splice(PMC *value, INTVAL offset, INTVAL count)
Replaces - METHOD PMC* shift()
- METHOD PMC* pop() Method forms to remove and return a PMC from the beginning or end of the array.
- METHOD unshift(PMC* value)
- METHOD push(PMC* value) Method forms to add a PMC to the beginning or end of the array.
size
elements.
key
.
key
to *src
.
key
exists; otherwise returns false.
key
is defined; otherwise returns false.
*value
to the end of the array.
*value
to the begin of the array.
==
operation.
Compares two array to hold equal elements.
ResizablePMCArray
.
count
elements starting at offset
with the elements in value
.Note that the value
PMC can be of any of the various array types.Note that this implementation can be *VERY *inefficient as it manipulates everything via the VTABLE api.
SEE ALSO
docs/pdds/pdd17_basic_types.pod.
HISTORY
Initial version - Matt Fowles 2004-06-11 Changed allocator to double size - Matt Fowles 2004-06-15