line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Accessor::Fast; |
2
|
4
|
|
|
4
|
|
3096
|
use base 'Class::Accessor'; |
|
4
|
|
|
|
|
505
|
|
|
4
|
|
|
|
|
818
|
|
3
|
4
|
|
|
4
|
|
18
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
1211
|
|
4
|
|
|
|
|
|
|
$Class::Accessor::Fast::VERSION = '0.34'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub make_accessor { |
7
|
6
|
|
|
6
|
1
|
9
|
my($class, $field) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
return sub { |
10
|
12
|
100
|
|
12
|
|
1232
|
return $_[0]->{$field} if scalar(@_) == 1; |
11
|
4
|
100
|
|
|
|
25
|
return $_[0]->{$field} = scalar(@_) == 2 ? $_[1] : [@_[1..$#_]]; |
12
|
6
|
|
|
|
|
27
|
}; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub make_ro_accessor { |
17
|
7
|
|
|
7
|
1
|
10
|
my($class, $field) = @_; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
return sub { |
20
|
7
|
100
|
|
7
|
|
53
|
return $_[0]->{$field} if @_ == 1; |
21
|
2
|
|
|
|
|
4
|
my $caller = caller; |
22
|
2
|
|
|
|
|
17
|
$_[0]->_croak("'$caller' cannot alter the value of '$field' on objects of class '$class'"); |
23
|
7
|
|
|
|
|
36
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub make_wo_accessor { |
28
|
7
|
|
|
7
|
1
|
9
|
my($class, $field) = @_; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
return sub { |
31
|
6
|
100
|
|
6
|
|
1249
|
if (@_ == 1) { |
32
|
2
|
|
|
|
|
5
|
my $caller = caller; |
33
|
2
|
|
|
|
|
11
|
$_[0]->_croak("'$caller' cannot access the value of '$field' on objects of class '$class'"); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else { |
36
|
4
|
100
|
|
|
|
18
|
return $_[0]->{$field} = $_[1] if @_ == 2; |
37
|
1
|
|
|
|
|
6
|
return (shift)->{$field} = \@_; |
38
|
|
|
|
|
|
|
} |
39
|
7
|
|
|
|
|
29
|
}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |