parrotcode: Class and object | |
Contents | C |
objects.c - Class and object
Handles class and object manipulation.
int Parrot_is_vtable_name(Interp *, const char *name)
name
is a valid vtable slot name.static PMC *find_vtable_override_byname(Interp *interp, PMC *class, STRING *method_name)
static void create_deleg_pmc_vtable(Interp *, PMC *class, PMC *class_name, int full)
const char *Parrot_MMD_method_name(Interp*, INTVAL)
INTVAL Parrot_MMD_method_idx(Interp*, STRING *)
PMC *Parrot_single_subclass(Interp *interp, PMC *base_class, PMC *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(Interp *interp, PMC *class, PMC *class_name)
class_name
.PMC *Parrot_class_lookup(Interp *interp, STRING *class_name)
PMC *Parrot_class_lookup_p(Interp *interp, PMC *class_name)
class_name
and returns it if it exists.
Otherwise it returns PMCNULL
.static void parrot_class_register(Interp *interp, PMC *class_name, PMC *new_class, PMC *mro)
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(Interp *interp, PMC *object, PMC *init)
PMC *Parrot_add_parent(Interp *interp, PMC *class, PMC *parent)
PMC *Parrot_remove_parent(Interp *interp, PMC *removed_class, PMC *existing_class)
NULL
.PMC *Parrot_multi_subclass(Interp *interp, PMC *base_class_array, STRING *child_class_name)
NULL
.INTVAL Parrot_object_isa(Interp *interp, PMC *pmc, PMC *cl)
pmc
is an instance of class cl
.PMC *Parrot_new_method_cache(Interp *interp)
NULL
.PMC *Parrot_find_method_with_cache(Interp *interp, PMC *class, STRING *method_name)
PMC *Parrot_find_method_direct(Interp *interp, PMC *class, STRING *method_name)
void Parrot_note_method_offset(Interp *interp, UINTVAL offset, PMC *method)
INTVAL Parrot_add_attribute(Interp *interp, PMC *class, STRING *attr)
attr
to the class.PMC *Parrot_get_attrib_by_num(Interp *interp, PMC *object, INTVAL attrib)
attrib
from object
.
Presumably the code is asking for the correct attribute number.PMC *Parrot_get_attrib_by_str(Interp *interp, PMC *object, STRING *attr)
attr
from object
.PMC *Parrot_set_attrib_by_num(Interp *interp, 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(Interp *interp, PMC *object, STRING *attr, PMC *value)
attr
from object
to value
.PMC *Parrot_find_class_constructor(Interp *interp, STRING *class, INTVAL classtoken)
include/parrot/objects.h, docs/pdds/pdd15_objects.pod.
|