NAME
src/pmc/hash.pmc - Hash PMC
DESCRIPTION
These are the vtable functions for the Hash PMC.
Functions
static PMC *get_integer_pmc(PARROT_INTERP, INTVAL base_type )
Lookup the PMC type which is used for storing native integers.
static PMC *get_number_pmc(PARROT_INTERP, INTVAL base_type )
Lookup the PMC type which is used for floating point numbers.
static PMC *get_string_pmc(PARROT_INTERP, INTVAL base_type )
Lookup the PMC type which is used for storing strings.
static STRING *make_hash_key(PARROT_INTERP, PMC *key)
Returns a Parrot string for void init()
Initializes the instance.
void destroy()
Free hash structure.
void mark()
Marks the hash as live.
PMC *clone()
Creates and returns a clone of the hash.
void set_pointer(void *ptr)
Use void *get_pointer()
Get a pointer to this PMC's Hash*.
INTVAL get_integer()
Returns the size of the hash.
INTVAL get_integer_keyed_str(STRING *key)
INTVAL get_integer_keyed_int(INTVAL key)
INTVAL get_integer_keyed(PMC *key)
Returns the integer value for the element at FLOATVAL get_number()
Returns the size of the hash.
FLOATVAL get_number_keyed_str(STRING *key)
FLOATVAL get_number_keyed_int(INTVAL key)
FLOATVAL get_number_keyed(PMC *key)
Returns the floating-point value for the element at STRING *get_string()
Returns a string representation of the hash,
showing its class name and memory address.
STRING *get_repr()
Return a representation of the hash contents.
STRING *get_string_keyed_str(STRING *key)
STRING *get_string_keyed_int(INTVAL key)
STRING *get_string_keyed(PMC *key)
Returns the string value for the element at INTVAL get_bool()
Returns true if the hash size is not zero.
INTVAL elements()
Returns the number of elements in the hash.
PMC *get_pmc_keyed_str(STRING *key)
PMC *get_pmc_keyed_int(INTVAL key)
PMC *get_iter()
Return a new iterator for the slice PMC PMC *get_pmc_keyed(PMC *key)
Returns the PMC value for the element at INTVAL is_same(const PMC *other)
Returns whether the hash is the same as void set_integer_keyed(PMC *key, INTVAL value)
void set_integer_keyed_str(STRING *key, INTVAL value)
void set_number_keyed(PMC *key, FLOATVAL value)
void set_number_keyed_str(STRING *key, FLOATVAL value)
Sets void set_string_keyed(PMC *key, STRING *value)
void set_string_keyed_str(STRING *key, STRING *value)
void set_pmc_keyed(PMC *dest_key, PMC *value)
void set_pmc_keyed_str(STRING *key, PMC *value)
Sets INTVAL is_equal(PMC *value)
The INTVAL exists_keyed_str(STRING *key)
INTVAL exists_keyed(PMC *key)
Returns whether a key INTVAL defined_keyed_str(STRING *key)
INTVAL defined_keyed(PMC *key)
Returns whether the value for void delete_keyed_str(STRING *key)
void delete_keyed(PMC *key)
Deletes the element associated with PMC *slice(PMC *key)
Return a new iterator for the slice PMC void visit(visit_info *info)
Used during archiving to visit the elements in the hash.
void freeze(visit_info *info)
Used to archive the hash.
void thaw(visit_info *info)
Used to unarchive the hash.
*key
.
ptr
as this PMC's Hash*.
*key
.
*key
.
*key
.
key
*key
.
*other
.
value
as the value for *key
.
*value
as the value for *key
.
==
operation.Check if two hashes hold the same keys and values.
*key
exists in the hash.
*key
is defined.
*key
.
key
SEE ALSO
docs/pdds/pdd08_keys.pod.