line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::POE::Role; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
136369
|
$MouseX::POE::Role::VERSION = '0.214'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Eventful roles |
6
|
2
|
|
|
2
|
|
1461
|
use MouseX::POE::Meta::Role; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
75
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
24
|
use Mouse::Exporter; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
17
|
|
9
|
2
|
|
|
2
|
|
2429
|
use Mouse::Util::MetaRole; |
|
2
|
|
|
|
|
3371
|
|
|
2
|
|
|
|
|
78
|
|
10
|
2
|
|
|
2
|
|
18
|
use Mouse::Role; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
16
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Mouse::Exporter->setup_import_methods( |
13
|
|
|
|
|
|
|
as_is => [qw(event)], |
14
|
|
|
|
|
|
|
also => 'Mouse::Role', |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub init_meta { |
18
|
2
|
|
|
2
|
0
|
55
|
my ( $class, %args ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
4
|
my $for = $args{for_class}; |
21
|
2
|
|
|
2
|
|
1943
|
eval qq{package $for; use POE; }; |
|
2
|
|
|
|
|
223864
|
|
|
2
|
|
|
|
|
27
|
|
|
2
|
|
|
|
|
152
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
397817
|
my $meta = Mouse->init_meta( %args ); |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
1926
|
Mouse::Util::MetaRole::apply_metaroles( |
26
|
|
|
|
|
|
|
for => $args{for_class}, |
27
|
|
|
|
|
|
|
role_metaroles => { |
28
|
|
|
|
|
|
|
role => ['MouseX::POE::Meta::Role','MouseX::POE::Meta::Trait'], |
29
|
|
|
|
|
|
|
}, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
109
|
Mouse::Util::MetaRole::apply_base_class_roles( |
33
|
|
|
|
|
|
|
for_class => $args{for_class}, |
34
|
|
|
|
|
|
|
roles => ['MouseX::POE::Meta::Trait::Object','MouseX::POE::Meta::Trait','MouseX::POE::Meta::Trait::Class'], |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
2
|
|
|
|
|
94537
|
return $meta; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub event { |
41
|
0
|
|
|
0
|
1
|
|
my $class = Mouse::Meta::Class->initialize( scalar caller ); |
42
|
0
|
|
|
|
|
|
$class->add_state_method( @_ ); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 NAME |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
MouseX::POE::Role - Eventful roles |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 VERSION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
version 0.214 |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
package Counter; |
61
|
|
|
|
|
|
|
use MouseX::POE::Role; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
... |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
package RealCounter; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
with qw(Counter); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 DESCRIPTION |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
This is what L is to Mouse but with L. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 METHODS |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 event $name $subref |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Create an event handler named $name. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=for Pod::Coverage init_meta |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 KEYWORDS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=for :list * L |
84
|
|
|
|
|
|
|
* L |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHORS |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=over 4 |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Chris Prather |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Ash Berlin |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Chris Williams |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Yuval (nothingmuch) Kogman |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Torsten Raudssus L |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=back |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
117
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=cut |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
__END__ |