line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VS::RuleEngine::Data; |
2
|
|
|
|
|
|
|
|
3
|
32
|
|
|
32
|
|
1675
|
use strict; |
|
32
|
|
|
|
|
63
|
|
|
32
|
|
|
|
|
2398
|
|
4
|
32
|
|
|
32
|
|
163
|
use warnings; |
|
32
|
|
|
|
|
57
|
|
|
32
|
|
|
|
|
1000
|
|
5
|
|
|
|
|
|
|
|
6
|
32
|
|
|
32
|
|
161
|
use Carp qw(croak); |
|
32
|
|
|
|
|
59
|
|
|
32
|
|
|
|
|
2083
|
|
7
|
32
|
|
|
32
|
|
185
|
use Scalar::Util qw(refaddr); |
|
32
|
|
|
|
|
56
|
|
|
32
|
|
|
|
|
18146
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %Locked; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub lock { |
12
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
13
|
0
|
|
|
|
|
0
|
$Locked{refaddr $self} = 1; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub unlock { |
17
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
18
|
0
|
|
|
|
|
0
|
delete $Locked{refaddr $self}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
462
|
|
|
462
|
1
|
678
|
my $pkg = shift; |
23
|
462
|
|
|
|
|
1112
|
my $self = bless { @_ }, $pkg; |
24
|
462
|
|
|
|
|
1983
|
return $self; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub set { |
28
|
315
|
|
|
315
|
1
|
772
|
my ($self, $key, $value) = @_; |
29
|
315
|
50
|
|
|
|
1141
|
croak "Can't modify locked object" if $Locked{refaddr $self}; |
30
|
315
|
|
|
|
|
6208
|
$self->{$key} = $value; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
*put = \&set; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub delete { |
36
|
0
|
|
|
0
|
1
|
0
|
my ($self, $key) = @_; |
37
|
0
|
0
|
|
|
|
0
|
croak "Can't modify locked object" if $Locked{refaddr $self}; |
38
|
0
|
|
|
|
|
0
|
CORE::delete $self->{$key}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub clear { |
42
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
43
|
0
|
0
|
|
|
|
0
|
croak "Can't modify locked object" if $Locked{refaddr $self}; |
44
|
0
|
|
|
|
|
0
|
delete $self->{$_} for keys %{$self}; |
|
0
|
|
|
|
|
0
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub get { |
48
|
321
|
|
|
321
|
1
|
1425
|
my ($self, $key) = @_; |
49
|
321
|
|
|
|
|
1125
|
return $self->{$key}; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub keys { |
53
|
107
|
|
|
107
|
1
|
1213
|
my $self = shift; |
54
|
107
|
|
|
|
|
467
|
return CORE::keys %$self; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub values { |
58
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
59
|
0
|
|
|
|
|
0
|
return CORE::values %$self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub exists { |
63
|
740
|
|
|
740
|
1
|
4300
|
my ($self, $key) = @_; |
64
|
740
|
|
|
|
|
3587
|
return CORE::exists $self->{$key}; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub DESTROY { |
68
|
462
|
|
|
462
|
|
18366
|
my $self = shift; |
69
|
462
|
|
|
|
|
6512
|
delete $Locked{refaddr $self}; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |