[RFE] Expose mechanism for creating maps of `GIBaseInfo`
It would be nice if it were possible to use GIBaseInfo
instances as keys in some sort of map data structure, but this would require extra method(s) for ordering or hashing instances (in the same manner as g_base_info_equal
).
Two solutions come to mind:
- Expose a method like
g_base_info_hash
with a signature suitable for use withGHashTable
. - Expose a method like
g_base_info_get_id
that just returnsrinfo->typelib->data + rinfo->offset
as anunsigned long
or something similar. The ordering of these values induces a (arbitrary) total ordering of type lib items, and are thus usable in more types of maps (like binary trees) and can be hashed like any other integer for hash maps. This solution seems preferable given its enhanced generality, but arbitrary opaque identifiers are a bit awkward from an API standpoint.