NAME

Data::TagMap - module for working with tag maps

VERSION

version v0.01

SYNOPSIS

use Data::TagMap;

This module implements a way to map between host defined tag identifiers and tags.

All methods in this module die on error unless documented otherwise.

This module inherit from Data::Identifier::Interface::Userdata.

METHODS

new

my Data::TagMap $map = Data::TagMap->new;

Creates a new map object. No parameters are supported.

add_one

$map->add_one($hdi => $to);

This method adds an entry for the given host defined identifier ($hdi) with the value $to. $to must be of any type supported by "new" in Data::Identifier using from.

add_range

$map->add_range($from, $type, $to, length => $length);
# e.g.:
$map->add_range(100, sid => 1, length => 128);

Add a range to the map. The range is defined using a starting poing ($from), a starting identifier ($to of type $type), and a length ($length).

$type must be a Data::Identifier, or value valid for wellknown in "new" in Data::Identifier or a UUID. $type must also be supported for ranges (it must be an identifier type that is numeric).

The range must not overlap with any other mappings.

get

my $id  = $map->get($as, $hdi);
# or:
my @ids = $map->get($as, @hdi);

This method will return the entry for the given host defined identifier as an object of type $as.

Valid values for $as are those valid for the same parameter of "as" in Data::Identifier.

Note: This method is sensitive to it's context (scalar or list).

AUTHOR

Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2025 by Löwenfelsen UG (haftungsbeschränkt) <support@loewenfelsen.net>.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)