The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Eve::EventMap - maps events to event handlers.

SYNOPSIS

    my $event_map = Eve::EventMap->new();

    $event_map->bind(
        event_class => 'Eve::Event::Foo',
        handler => $some_handler);

    $event_map->bind(
        event_class => 'Eve::Event::Bar',
        handler => $another_handler);

    my $event = Eve::Event::Foo->new(event_map => $event_map);

DESCRIPTION

Eve::EventMap is the facility on the one hand used to bind events to event handlers, on the other hand to extract handlers that need to be run when a certain event is triggered.

METHODS

init()

bind()

Binds an event class to an event handler.

Arguments

event_class

an event class (Eve::Event derivative)

handler

a handler instance (Eve::EventHandler::Class derivative).

Throws

Eve::Exception::Duplicate

trying to bind a handler duplicating one that has already been bound to the event.

get_handler_list()

Returns handler list for an event.

Arguments

event

an event instance we are requesting handlers for.

Returns

Unified list of handlers bound to the event and to all its ancestors. Note that if one handler is bound to an event and its ancestors it will be returned only once.

SEE ALSO

Eve::Class
Eve::Event
Eve::EventHandler
Eve::Exception

LICENSE AND COPYRIGHT

Copyright 2012 Igor Zinovyev.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

AUTHOR

Sergey Konoplev