line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
103457
|
use strict; |
|
3
|
|
|
|
|
120
|
|
|
3
|
|
|
|
|
133
|
|
2
|
3
|
|
|
3
|
|
20
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
236
|
|
3
|
|
|
|
|
|
|
package Class::Accessor::Class; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Class::Accessor::Class::VERSION = '0.503'; |
6
|
|
|
|
|
|
|
} |
7
|
3
|
|
|
3
|
|
6247
|
use Class::Accessor 0.16 (); |
|
3
|
|
|
|
|
9677
|
|
|
3
|
|
|
|
|
89
|
|
8
|
3
|
|
|
3
|
|
3434
|
use parent 'Class::Accessor'; |
|
3
|
|
|
|
|
1687
|
|
|
3
|
|
|
|
|
17
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: simple class variable accessors |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub mk_class_accessors { |
13
|
1
|
|
|
1
|
1
|
539
|
my ($self, @fields) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## no critic (ProhibitNoStrict) |
16
|
3
|
|
|
3
|
|
1481
|
no strict 'refs'; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
305
|
|
17
|
1
|
|
|
|
|
3
|
for my $field (@fields) { |
18
|
1
|
|
|
|
|
8
|
*{"${self}::$field"} = $self->make_class_accessor($field); |
|
1
|
|
|
|
|
8
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub mk_package_accessors { |
24
|
1
|
|
|
1
|
1
|
917
|
my ($self, @fields) = @_; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
## no critic (ProhibitNoStrict) |
27
|
3
|
|
|
3
|
|
14
|
no strict 'refs'; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
1312
|
|
28
|
1
|
|
|
|
|
4
|
for my $field (@fields) { |
29
|
1
|
|
|
|
|
8
|
*{"${self}::$field"} = $self->make_package_accessor($field); |
|
1
|
|
|
|
|
9
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
{ |
35
|
|
|
|
|
|
|
my %accessor; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub make_class_accessor { |
38
|
4
|
|
|
4
|
1
|
62
|
my ($class, $field) = @_; |
39
|
|
|
|
|
|
|
|
40
|
4
|
100
|
|
|
|
17
|
return $accessor{$class}{$field} |
41
|
|
|
|
|
|
|
if $accessor{$class}{$field}; |
42
|
|
|
|
|
|
|
|
43
|
3
|
|
|
|
|
7
|
my $field_value; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$accessor{$class}{$field} = sub { |
46
|
37
|
|
|
37
|
|
4080
|
my $class = shift; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return @_ |
49
|
37
|
100
|
|
|
|
815
|
? ($field_value = $_[0]) |
50
|
|
|
|
|
|
|
: $field_value; |
51
|
|
|
|
|
|
|
} |
52
|
3
|
|
|
|
|
20
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub make_package_accessor { |
57
|
1
|
|
|
1
|
1
|
3
|
my ($self, $field) = @_; |
58
|
1
|
|
33
|
|
|
11
|
my $class = ref $self || $self; |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
4
|
my $varname = "$class\:\:$field"; |
61
|
|
|
|
|
|
|
return sub { |
62
|
30
|
|
|
30
|
|
9250
|
my $class = shift; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
## no critic (ProhibitNoStrict) |
65
|
3
|
|
|
3
|
|
20
|
no strict 'refs'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
308
|
|
66
|
|
|
|
|
|
|
return @_ |
67
|
5
|
|
|
|
|
53
|
? (${$varname} = $_[0]) |
|
25
|
|
|
|
|
154
|
|
68
|
30
|
100
|
|
|
|
92
|
: ${$varname} |
69
|
|
|
|
|
|
|
} |
70
|
1
|
|
|
|
|
6
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
__END__ |