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