line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Role::Application; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2203'; |
3
|
|
|
|
|
|
|
|
4
|
388
|
|
|
388
|
|
92291
|
use strict; |
|
388
|
|
|
|
|
976
|
|
|
388
|
|
|
|
|
11412
|
|
5
|
388
|
|
|
388
|
|
1912
|
use warnings; |
|
388
|
|
|
|
|
778
|
|
|
388
|
|
|
|
|
8848
|
|
6
|
388
|
|
|
388
|
|
2127
|
use metaclass; |
|
388
|
|
|
|
|
757
|
|
|
388
|
|
|
|
|
2029
|
|
7
|
388
|
|
|
388
|
|
2734
|
use overload (); |
|
388
|
|
|
|
|
1005
|
|
|
388
|
|
|
|
|
12486
|
|
8
|
|
|
|
|
|
|
|
9
|
388
|
|
|
388
|
|
2352
|
use List::Util 1.33 qw( all ); |
|
388
|
|
|
|
|
9400
|
|
|
388
|
|
|
|
|
25448
|
|
10
|
|
|
|
|
|
|
|
11
|
388
|
|
|
388
|
|
3175
|
use Moose::Util 'throw_exception'; |
|
388
|
|
|
|
|
962
|
|
|
388
|
|
|
|
|
2711
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
__PACKAGE__->meta->add_attribute('method_exclusions' => ( |
14
|
|
|
|
|
|
|
init_arg => '-excludes', |
15
|
|
|
|
|
|
|
reader => 'get_method_exclusions', |
16
|
|
|
|
|
|
|
default => sub { [] }, |
17
|
|
|
|
|
|
|
Class::MOP::_definition_context(), |
18
|
|
|
|
|
|
|
)); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->meta->add_attribute('method_aliases' => ( |
21
|
|
|
|
|
|
|
init_arg => '-alias', |
22
|
|
|
|
|
|
|
reader => 'get_method_aliases', |
23
|
|
|
|
|
|
|
default => sub { {} }, |
24
|
|
|
|
|
|
|
Class::MOP::_definition_context(), |
25
|
|
|
|
|
|
|
)); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
1912
|
|
|
1912
|
1
|
7717
|
my ($class, %params) = @_; |
29
|
1912
|
|
|
|
|
55447
|
$class->_new(\%params); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub is_method_excluded { |
33
|
14509
|
|
|
14509
|
1
|
25817
|
my ($self, $method_name) = @_; |
34
|
14509
|
|
|
|
|
24348
|
foreach (@{$self->get_method_exclusions}) { |
|
14509
|
|
|
|
|
458059
|
|
35
|
30
|
100
|
|
|
|
119
|
return 1 if $_ eq $method_name; |
36
|
|
|
|
|
|
|
} |
37
|
14490
|
|
|
|
|
37192
|
return 0; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub is_method_aliased { |
41
|
14494
|
|
|
14494
|
1
|
25655
|
my ($self, $method_name) = @_; |
42
|
14494
|
100
|
|
|
|
504520
|
exists $self->get_method_aliases->{$method_name} ? 1 : 0 |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub is_aliased_method { |
46
|
682
|
|
|
682
|
1
|
1468
|
my ($self, $method_name) = @_; |
47
|
682
|
|
|
|
|
1169
|
my %aliased_names = reverse %{$self->get_method_aliases}; |
|
682
|
|
|
|
|
21574
|
|
48
|
682
|
100
|
|
|
|
2887
|
exists $aliased_names{$method_name} ? 1 : 0; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub apply { |
52
|
1886
|
|
|
1886
|
1
|
3403
|
my $self = shift; |
53
|
|
|
|
|
|
|
|
54
|
1886
|
|
|
|
|
7613
|
$self->check_role_exclusions(@_); |
55
|
1876
|
|
|
|
|
7931
|
$self->check_required_methods(@_); |
56
|
1848
|
|
|
|
|
7354
|
$self->check_required_attributes(@_); |
57
|
|
|
|
|
|
|
|
58
|
1848
|
|
|
|
|
7624
|
$self->apply_overloading(@_); |
59
|
1842
|
|
|
|
|
89412
|
$self->apply_attributes(@_); |
60
|
1835
|
|
|
|
|
7073
|
$self->apply_methods(@_); |
61
|
|
|
|
|
|
|
|
62
|
1831
|
|
|
|
|
7493
|
$self->apply_override_method_modifiers(@_); |
63
|
|
|
|
|
|
|
|
64
|
1819
|
|
|
|
|
8360
|
$self->apply_before_method_modifiers(@_); |
65
|
1819
|
|
|
|
|
7250
|
$self->apply_around_method_modifiers(@_); |
66
|
1819
|
|
|
|
|
6914
|
$self->apply_after_method_modifiers(@_); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
1
|
|
|
1
|
1
|
254
|
sub check_role_exclusions { throw_exception( "CannotCallAnAbstractMethod" ); } |
70
|
1
|
|
|
1
|
1
|
74
|
sub check_required_methods { throw_exception( "CannotCallAnAbstractMethod" ); } |
71
|
1
|
|
|
1
|
1
|
60
|
sub check_required_attributes { throw_exception( "CannotCallAnAbstractMethod" ); } |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
1
|
1
|
60
|
sub apply_attributes { throw_exception( "CannotCallAnAbstractMethod" ); } |
74
|
1
|
|
|
1
|
1
|
58
|
sub apply_methods { throw_exception( "CannotCallAnAbstractMethod" ); } |
75
|
1
|
|
|
1
|
1
|
59
|
sub apply_override_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); } |
76
|
1
|
|
|
1
|
1
|
60
|
sub apply_method_modifiers { throw_exception( "CannotCallAnAbstractMethod" ); } |
77
|
|
|
|
|
|
|
|
78
|
1819
|
|
|
1819
|
1
|
6338
|
sub apply_before_method_modifiers { (shift)->apply_method_modifiers('before' => @_) } |
79
|
1819
|
|
|
1819
|
1
|
5084
|
sub apply_around_method_modifiers { (shift)->apply_method_modifiers('around' => @_) } |
80
|
1819
|
|
|
1819
|
1
|
5755
|
sub apply_after_method_modifiers { (shift)->apply_method_modifiers('after' => @_) } |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub apply_overloading { |
83
|
1599
|
|
|
1599
|
1
|
3805
|
my ( $self, $role, $other ) = @_; |
84
|
|
|
|
|
|
|
|
85
|
1599
|
100
|
|
|
|
7597
|
return unless $role->is_overloaded; |
86
|
|
|
|
|
|
|
|
87
|
16
|
100
|
|
|
|
636
|
unless ( $other->is_overloaded ) { |
88
|
15
|
|
|
|
|
898
|
$other->set_overload_fallback_value( |
89
|
|
|
|
|
|
|
$role->get_overload_fallback_value ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
16
|
|
|
|
|
493
|
for my $overload ( $role->get_all_overloaded_operators ) { |
93
|
17
|
100
|
|
|
|
208
|
next if $other->has_overloaded_operator( $overload->operator ); |
94
|
16
|
|
|
|
|
1168
|
$other->add_overloaded_operator( |
95
|
|
|
|
|
|
|
$overload->operator => $overload->clone ); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# ABSTRACT: A base class for role application |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
__END__ |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=pod |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=encoding UTF-8 |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 NAME |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Moose::Meta::Role::Application - A base class for role application |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 VERSION |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
version 2.2203 |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 DESCRIPTION |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
This is the abstract base class for role applications. |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
The API for this class and its subclasses still needs some |
122
|
|
|
|
|
|
|
consideration, and is intentionally not yet documented. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head2 METHODS |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=over 4 |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item B<new> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item B<meta> |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item B<get_method_exclusions> |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item B<is_method_excluded> |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item B<get_method_aliases> |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item B<is_aliased_method> |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=item B<is_method_aliased> |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=item B<apply> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=item B<check_role_exclusions> |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=item B<check_required_methods> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=item B<check_required_attributes> |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=item B<apply_attributes> |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item B<apply_methods> |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item B<apply_overloading> |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item B<apply_method_modifiers> |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item B<apply_before_method_modifiers> |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item B<apply_after_method_modifiers> |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=item B<apply_around_method_modifiers> |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item B<apply_override_method_modifiers> |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=back |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head1 BUGS |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
See L<Moose/BUGS> for details on reporting bugs. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head1 AUTHORS |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=over 4 |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item * |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Jesse Luehrs <doy@cpan.org> |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=item * |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Shawn M Moore <sartak@cpan.org> |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=item * |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=item * |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=item * |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=item * |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Hans Dieter Pearcey <hdp@cpan.org> |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item * |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
Chris Prather <chris@prather.org> |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=item * |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
Matt S Trout <mstrout@cpan.org> |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=back |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Infinity Interactive, Inc. |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
223
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=cut |