line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Property::RO::Lazy;
|
2
|
1
|
|
|
1
|
|
6
|
use strict; use warnings FATAL => 'all';
|
|
1
|
|
|
1
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
3
|
1
|
|
|
1
|
|
7
|
use parent 'Class::Property::RO';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub TIESCALAR
|
6
|
|
|
|
|
|
|
{
|
7
|
3
|
|
|
3
|
|
9
|
my( $class, $object, $field, $init, $flag_ref ) = @_;
|
8
|
3
|
|
|
|
|
23
|
return bless \{
|
9
|
|
|
|
|
|
|
'object' => $object
|
10
|
|
|
|
|
|
|
, 'field' => $field
|
11
|
|
|
|
|
|
|
, 'init' => $init
|
12
|
|
|
|
|
|
|
, 'flag_ref' => $flag_ref
|
13
|
|
|
|
|
|
|
}, $class;
|
14
|
|
|
|
|
|
|
}
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub FETCH
|
17
|
|
|
|
|
|
|
{
|
18
|
2
|
|
|
2
|
|
25
|
my( $self ) = @_;
|
19
|
|
|
|
|
|
|
|
20
|
2
|
100
|
|
|
|
3
|
if( not ${${$self}->{'flag_ref'}} )
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
13
|
|
21
|
|
|
|
|
|
|
{
|
22
|
1
|
|
|
|
|
3
|
${$self}->{'object'}->{${$self}->{'field'}} = ${$self}->{'init'}->(${$self}->{'object'});
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
3
|
|
23
|
1
|
|
|
|
|
1
|
${${$self}->{'flag_ref'}}++;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
24
|
|
|
|
|
|
|
}
|
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
3
|
return ${$self}->{'object'}->{${$self}->{'field'}};
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
5
|
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |