KiokuDB::TypeMap(3pm)
π KiokuDB::TypeMap π
okay bestie, come sit with me, we're reading the KiokuDB::TypeMap(3pm) page together and honestly? it's giving very demure, very mindful, very "the glue that holds your whole object graph together" π
VERSION: version 0.57 β yes she has a version number, she's official β¨
β¨ SYNOPSIS β¨
look at her, she's so clean:
use KiokuDB::TypeMap;
KiokuDB::TypeMap->new(
entries => {
'Foo' => KiokuDB::TypeMap::Entry::Naive->new,
},
isa_entries => {
'My::Class' => KiokuDB::TypeMap::Entry::Naive->new,
},
includes => [
$typemap_foo,
$typemap_bar,
],
);
like, constructor with some hashes and a list, that's the whole vibe π¦
πΈ DESCRIPTION πΈ
so what IS this thing. the KiokuDB typemap maps classes to KiokuDB::TypeMap::Entry objects. that's the whole job. class in, entry out, no cap.
the mapping is by class, and entries can be keyed normally (that means using "ref $object" equality, so the literal class of the thing) or by filtering on "$object->isa($class)", which is the "isa_entries" situation. one is "is this exactly you", the other is "are you one of these" π
π ATTRIBUTES π
entriesβ a hash of normal entries. the straightforward girlies.isa_entriesβ a hash of"$object->isa"based entries. for when you're matching by ancestry and not by exact identity πincludesβ a list of parent typemaps to inherit entries from. yes she does inherit, she's generous like that π
π₯ METHODS π₯
resolve $classβ give her a class and she hands you back the"KiokuDB::TypeMap::Entry"object that corresponds to that class. oh and heads up, this one is called byKiokuDB::TypeMap::Resolver, so it's doing main character work behind the scenes βresolve_entry $entryβ if the entry is an alias, she resolves it recursively. if it's not an alias, she just returns it. simple as that, no drama πall_entriesβ returns the merged"entries"from this typemap and all the included typemaps. everyone's invited to this party πall_isa_entriesβ same energy, but returns the merged"isa_entries"from this typemap and all the included typemaps πall_isa_entry_classesβ an array reference of all the classes in"all_isa_entries", sorted from least derived to most derived. so like, grandma class first, most-evolved grandbaby class last, the whole family tree in order πΈ
π«Ά AUTHOR π«Ά
Yuval Kogman <nothingmuch@woobling.org> β thank you for your service, king π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source fr fr π
okay that's the whole page bestie, you ate that. this was perl v5.34.0, dated 2022-05-23, and you just finished reading KiokuDB::TypeMap(3pm). go forth and map some types, ily, bye π§β¨π
π¦ where this page comes from
- debian bookworm: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libkiokudb-perl 0.57-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms