/* ex: set ro ft=c:
 * !!!!!!!   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, ARGIN_NULLOK(PMC* mro));
PARROT_EXPORT Hash*   Parrot_Scheduler_get_isa(PARROT_INTERP, ARGIN_NULLOK(Hash* isa));

/* Scheduler PMC's underlying struct. */
typedef struct Parrot_Scheduler_attributes {
    INTVAL id;
    INTVAL max_tid;
    INTVAL pending;
    PMC          * task_list;
    PMC          * task_index;
    PMC          * wait_index;
    PMC          * handlers;
    PMC          * messages;
    Parrot_mutex msg_lock;
    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 'max_tid' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_max_tid(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->max_tid; \
        } \
        else { \
            PMC * const attr_value = VTABLE_get_attr_str(interp, \
                              pmc, Parrot_str_new_constant(interp, "max_tid")); \
            (dest) = (PMC_IS_NULL(attr_value) ? (INTVAL) 0: VTABLE_get_integer(interp, attr_value)); \
        } \
    } while (0)

#define SETATTR_Scheduler_max_tid(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, "max_tid"), attr_value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->max_tid = (value); \
    } while (0)


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

#define SETATTR_Scheduler_pending(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, "pending"), attr_value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->pending = (value); \
    } while (0)


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

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


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

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


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

#define SETATTR_Scheduler_wait_index(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            VTABLE_set_attr_str(interp, pmc, \
                              Parrot_str_new_constant(interp, "wait_index"), value); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->wait_index = (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 'msg_lock' attribute of Scheduler PMC. */
#define GETATTR_Scheduler_msg_lock(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_Scheduler_attributes *)PMC_data(pmc))->msg_lock; \
        } \
        else { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_mutex' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)

#define SETATTR_Scheduler_msg_lock(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Parrot_mutex' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_Scheduler_attributes *)PMC_data(pmc))->msg_lock = (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_args(interp, NULL, 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_args(interp, NULL, 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:
 */

