line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Phylo::Util::IDPool; |
2
|
57
|
|
|
57
|
|
343
|
use strict; |
|
57
|
|
|
|
|
105
|
|
|
57
|
|
|
|
|
1397
|
|
3
|
57
|
|
|
57
|
|
275
|
use warnings; |
|
57
|
|
|
|
|
102
|
|
|
57
|
|
|
|
|
6332
|
|
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
my @reclaim; |
6
|
|
|
|
|
|
|
my $obj_counter = 1; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub _initialize { |
9
|
13384
|
|
|
13384
|
|
18451
|
my $obj_ID = 0; |
10
|
13384
|
50
|
|
|
|
26396
|
if (@reclaim) { |
11
|
0
|
|
|
|
|
0
|
$obj_ID = shift(@reclaim); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
else { |
14
|
13384
|
|
|
|
|
17499
|
$obj_ID = $obj_counter; |
15
|
13384
|
|
|
|
|
16416
|
$obj_counter++; |
16
|
|
|
|
|
|
|
} |
17
|
13384
|
|
|
|
|
26047
|
return \$obj_ID; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _reclaim { |
21
|
13384
|
|
|
13384
|
|
73966
|
my ( $class, $obj ) = @_; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# push @reclaim, $obj->get_id; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _reset { |
27
|
0
|
|
|
0
|
|
|
$obj_counter = 1; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Bio::Phylo::Util::IDPool - Utility class for generating object IDs. No serviceable parts inside. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This package defines utility functions for generating and reclaiming object |
40
|
|
|
|
|
|
|
IDs. These functions are called by object constructors and destructors, |
41
|
|
|
|
|
|
|
respectively. There is no direct usage. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SEE ALSO |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
There is a mailing list at L<https://groups.google.com/forum/#!forum/bio-phylo> |
46
|
|
|
|
|
|
|
for any user or developer questions and discussions. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item L<Bio::Phylo::Manual> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Also see the manual: L<Bio::Phylo::Manual> and L<http://rutgervos.blogspot.com>. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 CITATION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
If you use Bio::Phylo in published research, please cite it: |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
B<Rutger A Vos>, B<Jason Caravas>, B<Klaas Hartmann>, B<Mark A Jensen> |
61
|
|
|
|
|
|
|
and B<Chase Miller>, 2011. Bio::Phylo - phyloinformatic analysis using Perl. |
62
|
|
|
|
|
|
|
I<BMC Bioinformatics> B<12>:63. |
63
|
|
|
|
|
|
|
L<http://dx.doi.org/10.1186/1471-2105-12-63> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |