line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Data::Localize; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
69197
|
use strict qw(vars subs); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
112
|
|
4
|
3
|
|
|
3
|
|
16
|
use vars qw($VERSION); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
173
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.0401'; |
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
2467
|
use ReleaseAction (); |
|
3
|
|
|
|
|
888
|
|
|
3
|
|
|
|
|
819
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub mk_classdata { |
10
|
15
|
|
|
15
|
1
|
97
|
my ($declaredclass, $attribute, $data) = @_; |
11
|
|
|
|
|
|
|
|
12
|
15
|
100
|
|
|
|
41
|
if( ref $declaredclass ) { |
13
|
1
|
|
|
|
|
11
|
require Carp; |
14
|
1
|
|
|
|
|
162
|
Carp::croak("mk_classdata() is a class method, not an object method"); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $accessor = sub { |
18
|
53
|
|
66
|
53
|
|
3081
|
my $wantclass = ref($_[0]) || $_[0]; |
19
|
|
|
|
|
|
|
|
20
|
53
|
100
|
|
|
|
115
|
if(@_==3) { |
21
|
10
|
|
|
|
|
19
|
my $current = $data; |
22
|
10
|
|
|
8
|
|
68
|
$_[2] = ReleaseAction->new( sub { $data = $current } ); |
|
8
|
|
|
|
|
4815
|
|
23
|
|
|
|
|
|
|
|
24
|
10
|
50
|
|
|
|
78
|
if($wantclass ne $declaredclass){ |
25
|
0
|
|
|
|
|
0
|
return mk_classdata($wantclass,$attribute,$data)->(@_); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
else { |
29
|
43
|
100
|
100
|
|
|
243
|
return mk_classdata($wantclass,$attribute)->(@_) |
30
|
|
|
|
|
|
|
if @_>1 && $wantclass ne $declaredclass; |
31
|
|
|
|
|
|
|
} |
32
|
47
|
100
|
|
|
|
117
|
$data = $_[1] if @_>1; |
33
|
47
|
|
|
|
|
173
|
return $data; |
34
|
14
|
|
|
|
|
69
|
}; |
35
|
|
|
|
|
|
|
|
36
|
14
|
|
|
|
|
30
|
my $alias = "_${attribute}_accessor"; |
37
|
14
|
|
|
|
|
17
|
*{$declaredclass.'::'.$attribute} = $accessor; |
|
14
|
|
|
|
|
86
|
|
38
|
14
|
|
|
|
|
17
|
*{$declaredclass.'::'.$alias} = $accessor; |
|
14
|
|
|
|
|
113
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |