line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Meta::Method::Accessor; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2205'; |
3
|
|
|
|
|
|
|
|
4
|
390
|
|
|
390
|
|
2710
|
use strict; |
|
390
|
|
|
|
|
828
|
|
|
390
|
|
|
|
|
11519
|
|
5
|
390
|
|
|
390
|
|
1951
|
use warnings; |
|
390
|
|
|
|
|
866
|
|
|
390
|
|
|
|
|
10526
|
|
6
|
|
|
|
|
|
|
|
7
|
390
|
|
|
390
|
|
1998
|
use Try::Tiny; |
|
390
|
|
|
|
|
868
|
|
|
390
|
|
|
|
|
22933
|
|
8
|
|
|
|
|
|
|
|
9
|
390
|
|
|
|
|
4295
|
use parent 'Moose::Meta::Method', |
10
|
390
|
|
|
390
|
|
2647
|
'Class::MOP::Method::Accessor'; |
|
390
|
|
|
|
|
2410
|
|
11
|
|
|
|
|
|
|
|
12
|
390
|
|
|
390
|
|
35490
|
use Moose::Util 'throw_exception'; |
|
390
|
|
|
|
|
2413
|
|
|
390
|
|
|
|
|
5647
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# multiple inheritance is terrible |
15
|
|
|
|
|
|
|
sub new { |
16
|
4247
|
|
|
4247
|
1
|
22176
|
goto &Class::MOP::Method::Accessor::new; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _new { |
20
|
3215
|
|
|
3215
|
|
12342
|
goto &Class::MOP::Method::Accessor::_new; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _error_thrower { |
24
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
25
|
0
|
0
|
0
|
|
|
0
|
return $self->associated_attribute |
26
|
|
|
|
|
|
|
if ref($self) && defined($self->associated_attribute); |
27
|
0
|
|
|
|
|
0
|
return $self->SUPER::_error_thrower; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _compile_code { |
31
|
4244
|
|
|
4244
|
|
9872
|
my $self = shift; |
32
|
4244
|
|
|
|
|
11585
|
my @args = @_; |
33
|
|
|
|
|
|
|
try { |
34
|
4244
|
|
|
4244
|
|
212086
|
$self->SUPER::_compile_code(@args); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
catch { |
37
|
1
|
|
|
1
|
|
22
|
throw_exception( CouldNotCreateWriter => attribute => $self->associated_attribute, |
38
|
|
|
|
|
|
|
error => $_, |
39
|
|
|
|
|
|
|
instance => $self |
40
|
|
|
|
|
|
|
); |
41
|
4244
|
|
|
|
|
33178
|
}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _eval_environment { |
45
|
4244
|
|
|
4244
|
|
8974
|
my $self = shift; |
46
|
4244
|
|
|
|
|
13303
|
return $self->associated_attribute->_eval_environment; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub _instance_is_inlinable { |
50
|
5356
|
|
|
5356
|
|
9757
|
my $self = shift; |
51
|
5356
|
|
|
|
|
17439
|
return $self->associated_attribute->associated_class->instance_metaclass->is_inlinable; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _generate_reader_method { |
55
|
2303
|
|
|
2303
|
|
5099
|
my $self = shift; |
56
|
2303
|
100
|
|
|
|
7514
|
$self->_instance_is_inlinable ? $self->_generate_reader_method_inline(@_) |
57
|
|
|
|
|
|
|
: $self->SUPER::_generate_reader_method(@_); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _generate_writer_method { |
61
|
12
|
|
|
12
|
|
40
|
my $self = shift; |
62
|
12
|
50
|
|
|
|
40
|
$self->_instance_is_inlinable ? $self->_generate_writer_method_inline(@_) |
63
|
|
|
|
|
|
|
: $self->SUPER::_generate_writer_method(@_); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _generate_accessor_method { |
67
|
282
|
|
|
282
|
|
721
|
my $self = shift; |
68
|
282
|
50
|
|
|
|
1002
|
$self->_instance_is_inlinable ? $self->_generate_accessor_method_inline(@_) |
69
|
|
|
|
|
|
|
: $self->SUPER::_generate_accessor_method(@_); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub _generate_predicate_method { |
73
|
161
|
|
|
161
|
|
510
|
my $self = shift; |
74
|
161
|
50
|
|
|
|
583
|
$self->_instance_is_inlinable ? $self->_generate_predicate_method_inline(@_) |
75
|
|
|
|
|
|
|
: $self->SUPER::_generate_predicate_method(@_); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub _generate_clearer_method { |
79
|
77
|
|
|
77
|
|
261
|
my $self = shift; |
80
|
77
|
50
|
|
|
|
303
|
$self->_instance_is_inlinable ? $self->_generate_clearer_method_inline(@_) |
81
|
|
|
|
|
|
|
: $self->SUPER::_generate_clearer_method(@_); |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub _writer_value_needs_copy { |
85
|
714
|
|
|
714
|
|
1818
|
shift->associated_attribute->_writer_value_needs_copy(@_); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub _inline_tc_code { |
89
|
114
|
|
|
114
|
|
331
|
shift->associated_attribute->_inline_tc_code(@_); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub _inline_check_coercion { |
93
|
97
|
|
|
97
|
|
341
|
shift->associated_attribute->_inline_check_coercion(@_); |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub _inline_check_constraint { |
97
|
97
|
|
|
97
|
|
283
|
shift->associated_attribute->_inline_check_constraint(@_); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub _inline_check_lazy { |
101
|
1116
|
|
|
1116
|
|
3468
|
shift->associated_attribute->_inline_check_lazy(@_); |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub _inline_store_value { |
105
|
232
|
|
|
232
|
|
617
|
shift->associated_attribute->_inline_instance_set(@_) . ';'; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub _inline_get_old_value_for_trigger { |
109
|
256
|
|
|
256
|
|
1156
|
shift->associated_attribute->_inline_get_old_value_for_trigger(@_); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub _inline_trigger { |
113
|
613
|
|
|
613
|
|
2345
|
shift->associated_attribute->_inline_trigger(@_); |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub _get_value { |
117
|
965
|
|
|
965
|
|
2497
|
shift->associated_attribute->_inline_instance_get(@_); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub _has_value { |
121
|
35
|
|
|
35
|
|
108
|
shift->associated_attribute->_inline_instance_has(@_); |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
1; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# ABSTRACT: A Moose Method metaclass for accessors |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
__END__ |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=pod |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=encoding UTF-8 |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 NAME |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Moose::Meta::Method::Accessor - A Moose Method metaclass for accessors |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 VERSION |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
version 2.2205 |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 DESCRIPTION |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This class is a subclass of L<Class::MOP::Method::Accessor> that |
145
|
|
|
|
|
|
|
provides additional Moose-specific functionality, all of which is |
146
|
|
|
|
|
|
|
private. |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
To understand this class, you should read the |
149
|
|
|
|
|
|
|
L<Class::MOP::Method::Accessor> documentation. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head1 BUGS |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
See L<Moose/BUGS> for details on reporting bugs. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head1 AUTHORS |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=over 4 |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=item * |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Stevan Little <stevan@cpan.org> |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=item * |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item * |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Jesse Luehrs <doy@cpan.org> |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item * |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Shawn M Moore <sartak@cpan.org> |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item * |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item * |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
Karen Etheridge <ether@cpan.org> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=item * |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Florian Ragwitz <rafl@debian.org> |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=item * |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Hans Dieter Pearcey <hdp@cpan.org> |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Chris Prather <chris@prather.org> |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=item * |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Matt S Trout <mstrout@cpan.org> |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=back |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Infinity Interactive, Inc. |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
206
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=cut |