line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mimic::Library::MonitorScalar; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use constant { |
7
|
|
|
|
|
|
|
# Instance variables |
8
|
1
|
|
|
|
|
795
|
VALUE => 0, |
9
|
|
|
|
|
|
|
HISTORY => 1, |
10
|
1
|
|
|
1
|
|
5
|
}; |
|
1
|
|
|
|
|
2
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIESCALAR { |
13
|
2
|
|
|
2
|
|
4
|
my ( $class, $history, $val ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Initialize instance variables. |
16
|
2
|
|
|
|
|
5
|
my $self = []; |
17
|
2
|
|
|
|
|
4
|
$self->[VALUE] = ${$val}; |
|
2
|
|
|
|
|
5
|
|
18
|
2
|
|
|
|
|
5
|
$self->[HISTORY] = $history; |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
12
|
bless( $self, $class ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub FETCH { |
24
|
0
|
|
|
0
|
|
|
my ( $self ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $value = $self->[VALUE]; |
27
|
0
|
0
|
|
|
|
|
if ( ! $Test::Mimic::Recorder::Recording ) { |
28
|
0
|
|
|
|
|
|
push( @{ $self->[HISTORY] }, Test::Mimic::Library::monitor( $value ) ); |
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $value; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub STORE { |
35
|
0
|
|
|
0
|
|
|
my ( $self, $value ) = @_; |
36
|
0
|
|
|
|
|
|
$self->[VALUE] = $value; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# optional methods |
40
|
0
|
|
|
0
|
|
|
sub UNTIE { |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
|
|
sub DESTROY { |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |