/*
Copyright (C) 2004-2007, The Perl Foundation.
$Id: /mirror/trunk/src/pmc/deleg_pmc.pmc 35602 2009-01-15T00:44:41.220227Z Whiteknight  $

=head1 NAME

src/pmc/deleg_pmc.pmc - Delegate PMC

=head1 DESCRIPTION

Delegate functions to the PMC in attribute slot #0.

Almost all methods are auto-generated in lib/Parrot/Pmc2c.pm

=head2 Methods

=over 4

=cut

*/


#include "parrot/parrot.h"

pmclass deleg_pmc no_ro {

/*

=item C<void init()>



=cut

*/

    VTABLE void init() {
    }

    VTABLE void init_pmc(PMC *_class) {
    }

    VTABLE void mark() {
        /* don't pass that on */
    }

    VTABLE void destroy() {
        /* don't pass that on */
    }

    VTABLE PMC *clone() {
        PMC      *res          = pmc_new(INTERP, SELF->vtable->base_type);
        SLOTTYPE *attrib_array = PMC_data_typed(res, SLOTTYPE *);
        INTVAL    i;

        for (i = 0; i < PMC_int_val(SELF); ++i)
            attrib_array[i] = VTABLE_clone(INTERP, attrib_array[i]);

        return res;
    }

    VTABLE STRING *name() {
        return SELF->vtable->whoami;
    }

    VTABLE INTVAL type() {
        return SELF->vtable->base_type;
    }

    VTABLE void add_method(STRING *method_name, PMC *sub_pmc) {
        SUPER(method_name, sub_pmc);
    }

    VTABLE PMC *find_method(STRING *method_name) {
        return SUPER(method_name);
    }

    VTABLE PMC *get_namespace() {
        return SELF->vtable->_namespace;
    }

}

/*

=back

=cut

*/

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
