line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mimic::Library::MonitorTiedScalar; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
41
|
|
4
|
1
|
|
|
1
|
|
23
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
127
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use constant { |
7
|
|
|
|
|
|
|
# Instance variables |
8
|
1
|
|
|
|
|
361
|
BACKING_VAR => 0, |
9
|
|
|
|
|
|
|
HISTORY => 1, |
10
|
1
|
|
|
1
|
|
5
|
}; |
|
1
|
|
|
|
|
2
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub TIESCALAR { |
13
|
0
|
|
|
0
|
|
|
my ( $class, $history, $backing_var ) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Initialize instance variables. |
16
|
0
|
|
|
|
|
|
my $self = []; |
17
|
0
|
|
|
|
|
|
$self->[BACKING_VAR] = $backing_var; |
18
|
0
|
|
|
|
|
|
$self->[HISTORY] = $history; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
bless( $self, $class ); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub FETCH { |
24
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
my $value = $self->[BACKING_VAR]->FETCH(); |
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->[BACKING_VAR]->STORE($value); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# optional methods |
40
|
|
|
|
|
|
|
sub UNTIE { |
41
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
42
|
0
|
|
|
|
|
|
$self->[BACKING_VAR]->UNTIE(); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub DESTROY { |
46
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
47
|
0
|
|
|
|
|
|
$self->[BACKING_VAR]->DESTROY(); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |