line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::By::Hash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
18972
|
use 5.8.1; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
59
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
427
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub THIS() { 0 } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub constructor |
10
|
|
|
|
|
|
|
#(, ...) |
11
|
|
|
|
|
|
|
{ |
12
|
1
|
|
|
1
|
1
|
21
|
my $this = bless({}, shift(@_)); |
13
|
1
|
50
|
|
|
|
14
|
$this->_constructor(@_) if ($this->can('_constructor')); |
14
|
1
|
|
|
|
|
8
|
$this->_lock_object; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
2
|
return($this); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub sibling_constructor |
20
|
|
|
|
|
|
|
#( |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
1
|
0
|
my $class = ref(shift(@_)); |
23
|
0
|
|
|
|
|
0
|
return($class->constructor(@_)); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub P_CLASS() { 0 } |
27
|
|
|
|
|
|
|
sub prototype_constructor |
28
|
|
|
|
|
|
|
#() |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
1
|
0
|
return(bless({}, ref($_[P_CLASS]))); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub clone_constructor |
35
|
|
|
|
|
|
|
#() |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
0
|
1
|
0
|
my $cloned = {%{$_[THIS]}}; |
|
0
|
|
|
|
|
0
|
|
38
|
0
|
|
|
|
|
0
|
bless($cloned, ref($_[THIS])); |
39
|
0
|
|
|
|
|
0
|
$cloned->_lock_object; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
0
|
return($cloned); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub destructor |
45
|
|
|
|
|
|
|
#(, ...) |
46
|
|
|
|
|
|
|
{ # structure of object |
47
|
0
|
|
|
0
|
0
|
0
|
my $this = $_[THIS]; |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
|
|
0
|
$this->_destructor(@_) if ($this->can('_destructor')); |
50
|
0
|
|
|
|
|
0
|
$this->_unlock_object; |
51
|
0
|
|
|
|
|
0
|
%$this = (); |
52
|
0
|
|
|
|
|
0
|
$this->_lock_object; |
53
|
0
|
|
|
|
|
0
|
return; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _lock_object |
57
|
|
|
|
|
|
|
#( |
58
|
|
|
|
|
|
|
{ # locks the structure (set of existing keys) |
59
|
1
|
|
|
1
|
|
3
|
Internals::hv_clear_placeholders(%{$_[THIS]}); |
|
1
|
|
|
|
|
11
|
|
60
|
1
|
|
|
|
|
2
|
Internals::SvREADONLY(%{$_[THIS]}, 1); |
|
1
|
|
|
|
|
5
|
|
61
|
1
|
|
|
|
|
2
|
return; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub _unlock_object |
65
|
|
|
|
|
|
|
#( |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
|
|
Internals::SvREADONLY(%{$_[THIS]}, 0); |
|
0
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
return; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# Could be used against memory leaks |
72
|
|
|
|
|
|
|
#sub DESTROY |
73
|
|
|
|
|
|
|
##( |
74
|
|
|
|
|
|
|
#{ |
75
|
|
|
|
|
|
|
# my $this = $_[THIS]; |
76
|
|
|
|
|
|
|
# |
77
|
|
|
|
|
|
|
# if (keys(%$this) > 0) { |
78
|
|
|
|
|
|
|
# $this->destructor if ($this->can('_destructor')); |
79
|
|
|
|
|
|
|
# } |
80
|
|
|
|
|
|
|
# return; |
81
|
|
|
|
|
|
|
#} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |