NAME ^

src/pmc/object.pmc - An instance of a class

DESCRIPTION ^

Implements an instance of a class.

Functions ^

void init()

Raises an exception; you can only instantiate objects from a class.

void init_pmc(PMC *class)

Raises an exception; you can only instantiate objects from a class.

void destroy()

Free the object's underlying struct.

STRING *name()

Returns the fully qualified name of the object's class.

void mark()

Mark any referenced strings and PMCs.

PMC *get_attr_str(STRING *name)

Gets the value of an attribute for this object. Will find the first attribute of the given name walking up the inheritance tree.

void set_attr_str(STRING *name, PMC *value)

Sets the value of an attribute for this object. Will set the first attribute of the given name walking up the inheritance tree.

PMC *find_method(STRING *name)

Queries this object's class to find the method with the given name.

PMC *get_class()

Get the class PMC representing the class that this object is an instance of.

INTVAL can(STRING *method_name)

Returns 0 if the class does not have a method with the given name and a non-zero value if it does.

INTVAL isa(STRING *classname)

Returns whether the class is or inherits from *classname.

SEE ALSO ^

docs/pdds/pdd15_objects.pod.


parrot