/* ex: set ro ft=c:
 * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
 *
 * This file is generated automatically from './src/pmc/schedulermessage.pmc'
 * by tools/build/pmc2c.pl.
 *
 * Any changes made here will be lost!
 *
 */

/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */


#ifndef PARROT_PMC_SCHEDULERMESSAGE_H_GUARD
#define PARROT_PMC_SCHEDULERMESSAGE_H_GUARD

PARROT_EXPORT VTABLE* Parrot_SchedulerMessage_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_SchedulerMessage_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_SchedulerMessage_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_SchedulerMessage_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_SchedulerMessage_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_EXPORT Hash*   Parrot_SchedulerMessage_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* SchedulerMessage PMC's underlying struct. */
typedef struct Parrot_SchedulerMessage_attributes {
    INTVAL id;
    STRING * type;
    PMC    * data;
} Parrot_SchedulerMessage_attributes;

/* Macro to access underlying structure of a SchedulerMessage PMC. */
#define PARROT_SCHEDULERMESSAGE(o) ((Parrot_SchedulerMessage_attributes *) PMC_data(o))


/* Generated macro accessors for 'id' attribute of SchedulerMessage PMC. */
#define GETATTR_SchedulerMessage_id(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->id; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "id")); \
            (dest) = (PMC_IS_NULL(attr_value) ? (INTVAL) 0: VTABLE_get_integer(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SchedulerMessage_id(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new_init_int(interp, enum_class_Integer, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "id"), attr_value); \
        } \
        else \
            ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->id = (value); \
    } while (0)


/* Generated macro accessors for 'type' attribute of SchedulerMessage PMC. */
#define GETATTR_SchedulerMessage_type(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->type; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "type")); \
            (dest) =  (PMC_IS_NULL(attr_value) ? (STRING *)NULL : VTABLE_get_string(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_SchedulerMessage_type(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \
            VTABLE_set_string_native(interp, attr_value, value); \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "type"), attr_value); \
        } \
        else \
            ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->type = (value); \
    } while (0)


/* Generated macro accessors for 'data' attribute of SchedulerMessage PMC. */
#define GETATTR_SchedulerMessage_data(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->data; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "data")); \
        } \
    } while (0)

#define SETATTR_SchedulerMessage_data(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "data"), value); \
        } \
        else \
            ((Parrot_SchedulerMessage_attributes *)PMC_data(pmc))->data = (value); \
    } while (0)


#endif /* PARROT_PMC_SCHEDULERMESSAGE_H_GUARD */

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

