NAME ^

src/pmc/default.pmc - Abstract root class

DESCRIPTION ^

These are the vtable functions for the default PMC class.

All methods which are not defined here get a default implementation generated from vtable.tbl by tools/build/pmc2c.pl.

Functions ^

static const char *caller(Interp *interpreter, PMC *pmc)

Returns a C string for the name of *pmc.

static void cant_do_method(Interp *interpreter, PMC *pmc, const char *methname)

Throws an exception "$methname() not implemented in class '$class'", used by all unimplemented messages.

static void check_set_std_props(Interp *interpreter, PMC *pmc, STRING *key, PMC *value)

Called from setprop().

static INTVAL does_isa(Interp *interpreter, STRING *method, STRING *what)

Compares *method and *what.

Methods ^

void init()

Does nothing.

void init_pmc(PMC *initializer)

With a null initializer, calls init(), else throws an exception.

PMC *instantiate(PMC *sig)

Default fallback. Creates a new PMC of the type of the class SELF and calls init().

void mark()

Panics with a "no custom mark routine defined" error message.

PMC *getprop(STRING *key)

Returns the property for *key. If no property is defined then the NULL PMC is returned.

void setprop(STRING *key, PMC *value)

Sets the property for *key to *value.

void delprop(STRING *key)

Deletes the property for *key.

PMC *getprops()

Returns the PMC's properties or the NULL PMC if no properties exist.

INTVAL type()

Returns the PMC's type.

INTVAL type_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling type_keyed() with it.

STRING *name()

Returns the name of the PMC.

PMC *namespace

Return the namespace for this PMC.

PMC *find_method(STRING *method_name)

Looks up the method for *method_name and returns it. If no method is found then NULL is returned.

void add_method(STRING *method_name, PMC *sub)

Store the method as a global in the namespace of this class.

INTVAL get_integer_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling get_integer_keyed() with it.

FLOATVAL get_number_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling get_number_keyed() with it.

STRING *get_string_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling get_string_keyed() with it.

INTVAL get_bool_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling get_bool_keyed() with it.

INTVAL elements_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling elements_keyed() with it.

PMC *get_pmc_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling get_pmc_keyed() with it.

INTVAL is_same(PMC *value)

Returns whether the PMC is numerically equal to value.

void assign_pmc (PMC *value)

void assign_string_native (PMC *value)

Defaults fall back to set_pmc and set_string_native.

void set_integer_keyed_int (INTVAL key, INTVAL value)

Converts key to a PMC key and calls set_integer_keyed() with it and value.

void set_number_keyed_int (INTVAL key, FLOATVAL value)

Converts key to a PMC key and calls set_number_keyed() with it and value.

void set_string_keyed_int(INTVAL key, STRING *string)

Converts key to a PMC key and calls set_string_keyed() with it and value.

void set_bool_keyed_int(INTVAL key, INTVAL value)

Converts key to a PMC key and calls set_bool_keyed() with it and value.

void set_pmc_keyed_int(INTVAL key, PMC *value)

Converts key to a PMC key and calls set_pmc_keyed() with it and value.

INTVAL is_equal(PMC *value)

Returns whether the PMC is equal to *value.

INTVAL is_equal_num(PMC *value)

Returns whether the PMC is numerically equal to *value.

INTVAL is_equal_str(PMC *value)

Returns whether the PMC is numerically equal to *value.

INTVAL exists_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling exists_keyed() with it.

INTVAL defined()

Returns true.

INTVAL defined_keyed_int(INTVAL key)

Converts key to a PMC key and returns the result of calling defined_keyed() with it.

void delete_keyed_int(INTVAL key)

Converts key to a PMC key and calls delete_keyed() with it.

PMC *nextkey_keyed_int(INTVAL key, INTVAL w)

Converts key to a PMC key and returns the result of calling nextkey_keyed() with it.

INTVAL can(STRING *method)

Returns whether the PMC "can" perform *method.

INTVAL does(STRING *interface)

Returns whether the PMC "does" perform *interface.

INTVAL isa(STRING *class)

Returns whether the PMC "isa" *class.

PMC *subclass(PMC *name)

Creates a subclass, optionally with a given name.

PMC *get_class()

Returns SELF. A PMC is it's own class.

PMC *get_attr_str(STRING *attr)

Look for NCI methods and properties.

void add_parent(PMC *parent)

Add class parent to the list of our parents.

void visit(visit_info *info)

Used by DOD to mark the PMC.

void freeze(visit_info *info)

Does nothing.

void thaw(visit_info *info)

Initializes the PMC during unarchiving.

void thawfinish(visit_info *info)

Does nothing.


parrot