parrotcode: Class and object | |
Contents | C |
objects.c - Class and object
Handles class and object manipulation.
static void create_deleg_pmc_vtable(Interp *, PMC *class, STRING *name)
PMC *Parrot_single_subclass(Parrot_Interp ointerpreter, PMC *base_class, STRING *child_class_name)
child_class
is NULL
,
this is an anonymous subclass we're creating,
which happens commonly enough to warrant an actual single-subclass function.void Parrot_new_class(Parrot_Interp interpreter, PMC *class, STRING *class_name)
class_name
.PMC *Parrot_class_lookup(Parrot_Interp interpreter, STRING *class_name)
class_name
and returns it if it exists.
Otherwise it returns PMCNULL
.INTVAL Parrot_class_register(Parrot_Interp interpreter, STRING *class_name, PMC *new_class)
init
method initializes objects of the class rather than the class itself,
and adding it to the interpreter's base type table so you can create a new foo
in PASM like this: new Px, foo
.void Parrot_instantiate_object(Parrot_Interp interpreter, PMC *object, PMC *init)
PMC *Parrot_add_parent(Parrot_Interp interpreter, PMC *new_base_class, PMC *existing_class)
PMC *Parrot_remove_parent(Parrot_Interp interpreter, PMC *removed_class, PMC *existing_class)
NULL
.PMC *Parrot_multi_subclass(Parrot_Interp interpreter, PMC *base_class_array, STRING *child_class_name)
NULL
.INTVAL Parrot_object_isa(Parrot_Interp interpreter, PMC *pmc, PMC *cl)
pmc
is an instance of class cl
.PMC *Parrot_new_method_cache(Parrot_Interp interpreter)
NULL
.PMC *Parrot_find_method_with_cache(Parrot_Interp interpreter, PMC *class, STRING *method_name)
void Parrot_note_method_offset(Parrot_Interp interpreter, UINTVAL offset, PMC *method)
INTVAL Parrot_add_attribute(Parrot_Interp interpreter, PMC *class, STRING *attr)
attr
to the class.PMC *Parrot_get_attrib_by_num(Parrot_Interp interpreter, PMC *object, INTVAL attrib)
attrib
from object
.
Presumably the code is asking for the correct attribute number.PMC *Parrot_get_attrib_by_str(Parrot_Interp interpreter, PMC *object, STRING *attr)
attr
from object
.PMC *Parrot_set_attrib_by_num(Parrot_Interp interpreter, PMC *object, INTVAL attrib, PMC *value)
attrib
from object
to value
.
Presumably the code is asking for the correct attribute number.PMC *Parrot_set_attrib_by_str(Parrot_Interp interpreter, PMC *object, STRING *attr, PMC *value)
attr
from object
to value
.PMC *Parrot_find_class_constructor(Parrot_Interp interpreter, STRING *class, INTVAL classtoken)
include/parrot/objects.h, docs/pdds/pdd15_objects.pod.
|