/*
Copyright (C) 2004, The Perl Foundation.
$Id: deleg_pmc.pmc 16275 2006-12-28 01:20:44Z particle $

=head1 NAME

src/pmc/deleg_pmc.pmc - Delegate PMC

=head1 DESCRIPTION

Delegate functions to the PMC in attribute slote #0.

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

=head2 Methods

=over 4

=cut

*/


#include "parrot/parrot.h"
#include <assert.h>

pmclass deleg_pmc no_ro {

/*

=item C<void init()>



=cut

*/

    void init() {
    }

    void init_pmc(PMC* class) {
    }

    void mark() {
        /* don't pass that on
         *
         * NB objects have the flag PObj_data_is_PMC_array_FLAG set,
         * marking is done internally in src/dod.c
         */
    }

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

    PMC* clone() {
        PMC* res = pmc_new(INTERP, SELF->vtable->base_type);
        INTVAL i;
        SLOTTYPE *attrib_array = PMC_data(res);
        for (i = 0; i < PMC_int_val(SELF); ++i)
            attrib_array[i] = VTABLE_clone(INTERP, attrib_array[i]);
        return res;
    }

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

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

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

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

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

}

/*

=back

=cut

*/

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