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