line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MouseX::POE; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
16
|
|
|
16
|
|
349304
|
$MouseX::POE::VERSION = '0.214'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: The Illicit Love Child of Mouse and POE |
6
|
|
|
|
|
|
|
|
7
|
16
|
|
|
11
|
|
8894
|
use Mouse (); |
|
16
|
|
|
|
|
402014
|
|
|
11
|
|
|
|
|
284
|
|
8
|
11
|
|
|
11
|
|
116
|
use Mouse::Exporter; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
65
|
|
9
|
11
|
|
|
11
|
|
11599
|
use Mouse::Util::MetaRole; |
|
11
|
|
|
|
|
9480
|
|
|
11
|
|
|
|
|
401
|
|
10
|
11
|
|
|
11
|
|
64
|
use Mouse::Util; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
54
|
|
11
|
11
|
|
|
11
|
|
6455
|
use MouseX::POE::Meta::Trait::Class; |
|
11
|
|
|
|
|
40
|
|
|
11
|
|
|
|
|
3196
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Mouse::Exporter->setup_import_methods( |
14
|
|
|
|
|
|
|
as_is => [qw(event)], |
15
|
|
|
|
|
|
|
also => 'Mouse', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub init_meta { |
19
|
16
|
|
|
16
|
0
|
2444
|
my ( $class, %args ) = @_; |
20
|
|
|
|
|
|
|
|
21
|
16
|
|
|
|
|
32
|
my $for = $args{for_class}; |
22
|
11
|
|
|
11
|
|
10006
|
eval qq{package $for; use POE; }; |
|
11
|
|
|
|
|
551073
|
|
|
11
|
|
|
|
|
76
|
|
|
16
|
|
|
|
|
1441
|
|
23
|
|
|
|
|
|
|
|
24
|
16
|
|
|
|
|
1259420
|
my $meta = Mouse->init_meta( %args ); |
25
|
|
|
|
|
|
|
|
26
|
16
|
|
|
|
|
4327
|
Mouse::Util::MetaRole::apply_metaroles( |
27
|
|
|
|
|
|
|
for => $args{for_class}, |
28
|
|
|
|
|
|
|
class_metaroles => { |
29
|
|
|
|
|
|
|
class => ['MouseX::POE::Meta::Trait::Class'], |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
16
|
|
|
|
|
189741
|
Mouse::Util::MetaRole::apply_base_class_roles( |
34
|
|
|
|
|
|
|
for_class => $args{for_class}, |
35
|
|
|
|
|
|
|
roles => ['MouseX::POE::Meta::Trait::Object','MouseX::POE::Meta::Trait','MouseX::POE::Meta::Trait::Class'], |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
16
|
|
|
|
|
82678
|
return $meta; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub event { |
42
|
11
|
|
|
11
|
1
|
2532
|
my $class = Mouse::Meta::Class->initialize( scalar caller ); |
43
|
11
|
|
|
|
|
172
|
$class->add_state_method( @_ ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=pod |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NAME |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
MouseX::POE - The Illicit Love Child of Mouse and POE |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 VERSION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
version 0.214 |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 SYNOPSIS |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
package Counter; |
62
|
|
|
|
|
|
|
use MouseX::POE; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has count => ( |
65
|
|
|
|
|
|
|
isa => 'Int', |
66
|
|
|
|
|
|
|
is => 'rw', |
67
|
|
|
|
|
|
|
lazy => 1, |
68
|
|
|
|
|
|
|
default => sub { 0 }, |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub START { |
72
|
|
|
|
|
|
|
my ($self) = @_; |
73
|
|
|
|
|
|
|
$self->yield('increment'); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
event increment => sub { |
77
|
|
|
|
|
|
|
my ($self) = @_; |
78
|
|
|
|
|
|
|
print "Count is now " . $self->count . "\n"; |
79
|
|
|
|
|
|
|
$self->count( $self->count + 1 ); |
80
|
|
|
|
|
|
|
$self->yield('increment') unless $self->count > 3; |
81
|
|
|
|
|
|
|
}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
no MouseX::POE; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Counter->new(); |
86
|
|
|
|
|
|
|
POE::Kernel->run(); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 DESCRIPTION |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
MouseX::POE is a L wrapper around a L. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 METHODS |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 event $name $subref |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Create an event handler named $name. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 get_session_id |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Get the internal POE Session ID, this is useful to hand to other POE aware |
101
|
|
|
|
|
|
|
functions. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head2 yield |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 call |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 delay |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head2 alarm |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 alarm_add |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 delay_add |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 alarm_set |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head2 alarm_adjust |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 alarm_remove |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 alarm_remove_all |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 delay_set |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 delay_adjust |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
A cheap alias for the same POE::Kernel function which will gurantee posting to the object's session. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 STARTALL |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 STOPALL |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=for Pod::Coverage init_meta |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 KEYWORDS |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 METHODS |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Default POE-related methods are provided by L |
140
|
|
|
|
|
|
|
which is applied to your base class (which is usually L) when |
141
|
|
|
|
|
|
|
you use this module. See that module for the documentation for it. Below is a list |
142
|
|
|
|
|
|
|
of methods on that class so you know what to look for: |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 SEE ALSO |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=for :list * L |
147
|
|
|
|
|
|
|
* L |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 AUTHORS |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=over 4 |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=item * |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Chris Prather |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=item * |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Ash Berlin |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Chris Williams |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item * |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
Yuval (nothingmuch) Kogman |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
Torsten Raudssus L |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=back |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
180
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=cut |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
__END__ |