|parrotcode: proxy class object for a PMC enabling introspection
Contents | PMCs
src/pmc/pmcproxy.pmc - proxy class object for a PMC enabling introspection
This class is used to describe a PMC.
It can sit in an inheritance hierarchy of a PDD15 class as well as allowing introspection of the PMC.
PMCProxy is not derived from any other PMC.
This class stores its state in the Parrot_PMCProxy structure,
which has the following fields.
- The type number of the PMC that is being described.
- The name of the PMC -- a STRING.
- The namespace the PMC is associated with,
- An array of immediate parent classes.
An empty ResizablePMCArray PMC is allocated during initialization.
- A cached array of ourself and all parent classes,
in MRO order.
A ResizablePMCArray PMC is allocated during initialization,
and is populated with the current class.
NOTE: No doubt we will need other things later; this is a start.
- Initializes a PMCProxy PMC.
- Free the memory associated with the object's underlying struct.
- Mark any referenced strings and PMCs in the structure as live.
PMC *inspect_str(STRING *what)
- Provides introspection of a specific piece of information about the PMC.
The available information is:
- String PMC containing the name of the PMC
- NameSpace PMC of the the namespace attached to the PMC
- Hash keyed on method name,
value is an invokable PMC
- Array of PMCProxy PMCs representing the direct parents of this class.
- Returns a Hash describing the PMC,
with key/value pairs as described in inspect_str.
- Gets the name of the PMC.
- Gets the namespace that this class is attached to.
void new(PMC *args)
- Creates an instance of the PMC.
- Return a hash where the keys are method names and the values are methods.
- Return the parents array PMC.
void inspect(STRING *what :optional)
- Gets all introspection data for the PMC or,
if the optional string parameter is supplied,
a particular item of introspection data.