---
name: "KiokuDB::TypeMap"
section: "3pm"
platform: "linux"
package: "libkiokudb-perl"
version: "0.57-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/KiokuDB::TypeMap"
---

# KiokuDB::TypeMap(3pm)

Class to collapsing/expanding logic.

## NAME

KiokuDB::TypeMap - Class to collapsing/expanding logic.

## VERSION

version 0.57

## SYNOPSIS

```
    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,
        ],
    );
```

## DESCRIPTION

The KiokuDB typemap maps classes to KiokuDB::TypeMap::Entry objects.

The mapping is by class, and entries can be keyed normally (using `"ref $object"` equality) or by filtering on `"$object->isa($class)"` (`"isa_entries"`).

## ATTRIBUTES

- entries

  A hash of normal entries.

- isa\_entries

  A hash of `"$object->isa"` based entries.

- includes

  A list of parent typemaps to inherit entries from.

## METHODS

- resolve $class

  Given a class returns the `"KiokuDB::TypeMap::Entry"` object corresponding to that class.

  Called by KiokuDB::TypeMap::Resolver

- resolve\_entry $entry

  If the entry is an alias, it will be resolved recursively, and simply returned otherwise.

- all\_entries

  Returns the merged `"entries"` from this typemap and all the included typemaps.

- all\_isa\_entries

  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.

## AUTHOR

Yuval Kogman \<nothingmuch@woobling.org\>

## 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.
