line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Node.pm,v 1.9 2007/07/13 00:00:15 ask Exp $ |
2
|
|
|
|
|
|
|
# $Source: /opt/CVS/Getopt-LL/lib/Getopt/LL/DLList/Node.pm,v $ |
3
|
|
|
|
|
|
|
# $Author: ask $ |
4
|
|
|
|
|
|
|
# $HeadURL$ |
5
|
|
|
|
|
|
|
# $Revision: 1.9 $ |
6
|
|
|
|
|
|
|
# $Date: 2007/07/13 00:00:15 $ |
7
|
|
|
|
|
|
|
package Getopt::LL::DLList::Node; |
8
|
21
|
|
|
21
|
|
35985
|
use strict; |
|
21
|
|
|
|
|
41
|
|
|
21
|
|
|
|
|
880
|
|
9
|
21
|
|
|
21
|
|
98
|
use warnings; |
|
21
|
|
|
|
|
36
|
|
|
21
|
|
|
|
|
496
|
|
10
|
21
|
|
|
21
|
|
96
|
use Carp; |
|
21
|
|
|
|
|
162
|
|
|
21
|
|
|
|
|
1453
|
|
11
|
21
|
|
|
21
|
|
116
|
use Scalar::Util qw( weaken ); |
|
21
|
|
|
|
|
36
|
|
|
21
|
|
|
|
|
2503
|
|
12
|
21
|
|
|
21
|
|
19189
|
use version; our $VERSION = qv('1.0.0'); |
|
21
|
|
|
|
|
56486
|
|
|
21
|
|
|
|
|
132
|
|
13
|
21
|
|
|
21
|
|
2178
|
use 5.006_001; |
|
21
|
|
|
|
|
326
|
|
|
21
|
|
|
|
|
954
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
|
16
|
21
|
|
|
21
|
|
117
|
use vars qw($ALLOCATED_TOTAL); |
|
21
|
|
|
|
|
156
|
|
|
21
|
|
|
|
|
1190
|
|
17
|
|
|
|
|
|
|
$ALLOCATED_TOTAL = 0; |
18
|
|
|
|
|
|
|
|
19
|
21
|
|
|
21
|
|
25618
|
use Class::Dot qw( property isa_Object isa_Data ); |
|
21
|
|
|
|
|
117100
|
|
|
21
|
|
|
|
|
226
|
|
20
|
|
|
|
|
|
|
property prev => isa_Object(); |
21
|
|
|
|
|
|
|
property next => isa_Object(); |
22
|
|
|
|
|
|
|
property data => isa_Data; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub new { |
25
|
242
|
|
|
242
|
1
|
1144
|
my ($class, $opt_data) = @_; |
26
|
|
|
|
|
|
|
|
27
|
242
|
|
|
|
|
265
|
$ALLOCATED_TOTAL++; |
28
|
|
|
|
|
|
|
|
29
|
242
|
|
|
|
|
627
|
my $self = bless {}, $class; |
30
|
|
|
|
|
|
|
|
31
|
242
|
100
|
|
|
|
495
|
if ($opt_data) { |
32
|
5
|
|
|
|
|
16
|
$self->set_data($opt_data); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
242
|
|
|
|
|
522
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub free { |
39
|
101
|
|
|
101
|
1
|
159
|
my ($self) = @_; |
40
|
101
|
|
|
|
|
274
|
my $next = $self->next; |
41
|
101
|
|
|
|
|
914
|
my $prev = $self->prev; |
42
|
101
|
|
|
|
|
875
|
weaken $next; |
43
|
101
|
|
|
|
|
219
|
weaken $prev; |
44
|
101
|
|
|
|
|
216
|
undef $self->{next}; |
45
|
101
|
|
|
|
|
157
|
undef $self->{prev}; |
46
|
101
|
|
|
|
|
167
|
undef $self->{data}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# Class::Dot 1.0 weirdness. |
49
|
101
|
|
|
|
|
3593
|
undef $self->{__x__next__x__}; |
50
|
101
|
|
|
|
|
166
|
undef $self->{__x__prev__x__}; |
51
|
101
|
|
|
|
|
182
|
undef $self->{__x__data__x__}; |
52
|
101
|
|
|
|
|
223
|
return; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub DEMOLISH { |
56
|
91
|
|
|
91
|
1
|
33608
|
$ALLOCATED_TOTAL--; |
57
|
91
|
|
|
|
|
185
|
return; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub END { |
61
|
21
|
|
|
21
|
|
38274
|
my ($self) = @_; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#if ($ALLOCATED_TOTAL) { |
64
|
|
|
|
|
|
|
# carp "DLList::Node Warning: There were $ALLOCATED_TOTAL nodes " |
65
|
|
|
|
|
|
|
# .'not properly freed during destruction.'; |
66
|
|
|
|
|
|
|
#} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |