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

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


#ifndef PARROT_PMC_HASHITERATOR_H_GUARD
#define PARROT_PMC_HASHITERATOR_H_GUARD

PARROT_EXPORT VTABLE* Parrot_HashIterator_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_HashIterator_ro_update_vtable(ARGMOD(VTABLE*));
PARROT_EXPORT VTABLE* Parrot_HashIterator_get_vtable(PARROT_INTERP);
PARROT_EXPORT VTABLE* Parrot_HashIterator_ro_get_vtable(PARROT_INTERP);
PARROT_EXPORT PMC*    Parrot_HashIterator_get_mro(PARROT_INTERP, ARGMOD(PMC* mro));
PARROT_EXPORT Hash*   Parrot_HashIterator_get_isa(PARROT_INTERP, ARGMOD_NULLOK(Hash* isa));

/* HashIterator PMC's underlying struct. */
typedef struct Parrot_HashIterator_attributes {
    PMC        * pmc_hash;
    Hash       * parrot_hash;
    HashBucket * bucket;
    INTVAL total_buckets;
    INTVAL pos;
    INTVAL elements;
} Parrot_HashIterator_attributes;

/* Macro to access underlying structure of a HashIterator PMC. */
#define PARROT_HASHITERATOR(o) ((Parrot_HashIterator_attributes *) PMC_data(o))


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

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


/* Generated macro accessors for 'parrot_hash' attribute of HashIterator PMC. */
#define GETATTR_HashIterator_parrot_hash(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_HashIterator_attributes *)PMC_data(pmc))->parrot_hash; \
        } \
        else { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Hash       *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)

#define SETATTR_HashIterator_parrot_hash(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'Hash       *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_HashIterator_attributes *)PMC_data(pmc))->parrot_hash = (value); \
    } while (0)


/* Generated macro accessors for 'bucket' attribute of HashIterator PMC. */
#define GETATTR_HashIterator_bucket(interp, pmc, dest) \
    do { \
        if (!PObj_is_object_TEST(pmc)) { \
            (dest) = ((Parrot_HashIterator_attributes *)PMC_data(pmc))->bucket; \
        } \
        else { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'HashBucket *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
    } while (0)

#define SETATTR_HashIterator_bucket(interp, pmc, value) \
    do { \
        if (PObj_is_object_TEST(pmc)) { \
            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, \
                "Attributes of type 'HashBucket *' cannot be " \
                "subclassed from a high-level PMC."); \
        } \
        else \
            ((Parrot_HashIterator_attributes *)PMC_data(pmc))->bucket = (value); \
    } while (0)


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

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


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

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


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

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


#endif /* PARROT_PMC_HASHITERATOR_H_GUARD */

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

