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