Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
hmap_control_t Struct Reference

If we ever want to modify some of these behaviours for a new instance of hashmap, we should use this control type. More...

#include <hashmap.h>

Collaboration diagram for hmap_control_t:
[legend]

Data Fields

bool(* cmp )(const hmap_t *hmap, const hmap_key_t *a, const hmap_key_t *b)
hmap_hash_t(* hash )(const hmap_t *hmap, const hmap_key_t *k)
hmap_t(* insert )(const struct hmap_control_t *ctl, const hmap_t *hmap, hmap_key_t *k, void *v)
void *(* lookup )(const struct hmap_control_t *ctl, const hmap_t *hmap, const hmap_key_t *k, void *default_value)
hmap_key_t *(* copy_key )(const hmap_t *hmap, const hmap_key_t *k)
 Clone k into the map's map_ctx before the map retains it, so the map never holds a pointer into the inserting caller's block.

Detailed Description

If we ever want to modify some of these behaviours for a new instance of hashmap, we should use this control type.

Definition at line 109 of file hashmap.h.

Field Documentation

◆ cmp

bool(* hmap_control_t::cmp) (const hmap_t *hmap, const hmap_key_t *a, const hmap_key_t *b)

Definition at line 110 of file hashmap.h.

◆ copy_key

hmap_key_t *(* hmap_control_t::copy_key) (const hmap_t *hmap, const hmap_key_t *k)

Clone k into the map's map_ctx before the map retains it, so the map never holds a pointer into the inserting caller's block.

Every control must provide it.

Definition at line 119 of file hashmap.h.

◆ hash

hmap_hash_t(* hmap_control_t::hash) (const hmap_t *hmap, const hmap_key_t *k)

Definition at line 111 of file hashmap.h.

◆ insert

hmap_t(* hmap_control_t::insert) (const struct hmap_control_t *ctl, const hmap_t *hmap, hmap_key_t *k, void *v)

Definition at line 112 of file hashmap.h.

◆ lookup

void *(* hmap_control_t::lookup) (const struct hmap_control_t *ctl, const hmap_t *hmap, const hmap_key_t *k, void *default_value)

Definition at line 113 of file hashmap.h.


The documentation for this struct was generated from the following file: