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

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


#ifndef PARROT_PMC_SCHEDULER_H_GUARD
#define PARROT_PMC_SCHEDULER_H_GUARD

PARROT_EXPORT VTABLE* Parrot_Scheduler_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Scheduler_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_Scheduler_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_Scheduler_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_Scheduler_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_EXPORT Hash*   Parrot_Scheduler_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* Scheduler PMC's underlying struct. */
typedef struct Parrot_Scheduler_attributes {
    INTVAL id;
    PMC          * handlers;
    PMC          * messages;
    PMC          * task_queue;
    PMC          * foreign_tasks;
    Parrot_mutex task_queue_lock;
    PMC          * alarms;
    PMC          * all_tasks;
    UINTVAL next_task_id;
    Parrot_Interp interp;
} Parrot_Scheduler_attributes;

/* Macro to access underlying structure of a Scheduler PMC. */
#define PARROT_SCHEDULER(o) ((Parrot_Scheduler_attributes *) PMC_data(o))


/* Generated macro accessors for 'id' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_id(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_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_Scheduler_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_Scheduler_attributes *)PMC_data(pmc))->id = (value); \
    } while (0)


/* Generated macro accessors for 'handlers' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_handlers(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->handlers; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "handlers")); \
        } \
    } while (0)
#define SETATTR_Scheduler_handlers(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "handlers"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->handlers = (value); \
    } while (0)


/* Generated macro accessors for 'messages' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_messages(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->messages; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "messages")); \
        } \
    } while (0)
#define SETATTR_Scheduler_messages(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "messages"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->messages = (value); \
    } while (0)


/* Generated macro accessors for 'task_queue' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_task_queue(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->task_queue; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "task_queue")); \
        } \
    } while (0)
#define SETATTR_Scheduler_task_queue(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "task_queue"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->task_queue = (value); \
    } while (0)


/* Generated macro accessors for 'foreign_tasks' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_foreign_tasks(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->foreign_tasks; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "foreign_tasks")); \
        } \
    } while (0)
#define SETATTR_Scheduler_foreign_tasks(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "foreign_tasks"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->foreign_tasks = (value); \
    } while (0)


/* Generated macro accessors for 'task_queue_lock' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_task_queue_lock(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->task_queue_lock; \
        } \
        else { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_mutex' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)
#define SETATTR_Scheduler_task_queue_lock(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_mutex' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->task_queue_lock = (value); \
    } while (0)


/* Generated macro accessors for 'alarms' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_alarms(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->alarms; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "alarms")); \
        } \
    } while (0)
#define SETATTR_Scheduler_alarms(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "alarms"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->alarms = (value); \
    } while (0)


/* Generated macro accessors for 'all_tasks' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_all_tasks(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->all_tasks; \
        } \
        else { \
            (dest) = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "all_tasks")); \
        } \
    } while (0)
#define SETATTR_Scheduler_all_tasks(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "all_tasks"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->all_tasks = (value); \
    } while (0)


/* Generated macro accessors for 'next_task_id' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_next_task_id(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->next_task_id; \
        } \
        else { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'UINTVAL' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)
#define SETATTR_Scheduler_next_task_id(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'UINTVAL' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->next_task_id = (value); \
    } while (0)


/* Generated macro accessors for 'interp' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_interp(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->interp; \
        } \
        else { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_Interp' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)
#define SETATTR_Scheduler_interp(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_noargs(interp, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_Interp' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->interp = (value); \
    } while (0)


#endif /* PARROT_PMC_SCHEDULER_H_GUARD */

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

