line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Class::DBI::Lite::Iterator; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
75
|
|
5
|
3
|
|
|
3
|
|
9
|
use warnings 'all'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
443
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#============================================================================== |
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
15
|
|
|
15
|
0
|
76
|
my ($class, $data) = @_; |
11
|
|
|
|
|
|
|
|
12
|
15
|
|
|
|
|
75
|
return bless { |
13
|
|
|
|
|
|
|
data => $data, |
14
|
|
|
|
|
|
|
count => scalar(@$data), |
15
|
|
|
|
|
|
|
idx => 0 |
16
|
|
|
|
|
|
|
}, $class; |
17
|
|
|
|
|
|
|
}# end new() |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#============================================================================== |
21
|
|
|
|
|
|
|
sub first |
22
|
|
|
|
|
|
|
{ |
23
|
13
|
|
|
13
|
0
|
44
|
$_[0]->{data}->[0]; |
24
|
|
|
|
|
|
|
}# end first() |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
#============================================================================== |
28
|
|
|
|
|
|
|
sub next |
29
|
|
|
|
|
|
|
{ |
30
|
19
|
|
|
19
|
1
|
3892
|
my $s = shift; |
31
|
19
|
100
|
|
|
|
47
|
return unless $s->{idx} < $s->{count}; |
32
|
14
|
|
|
|
|
25
|
$s->{data}->[ $s->{idx}++ ]; |
33
|
|
|
|
|
|
|
}# end next() |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#============================================================================== |
37
|
|
|
|
|
|
|
sub count |
38
|
|
|
|
|
|
|
{ |
39
|
9
|
|
|
9
|
1
|
1714
|
$_[0]->{count}; |
40
|
|
|
|
|
|
|
}# end count() |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
#============================================================================== |
44
|
|
|
|
|
|
|
sub reset |
45
|
|
|
|
|
|
|
{ |
46
|
0
|
|
|
0
|
1
|
|
$_[0]->{idx} = 0; |
47
|
|
|
|
|
|
|
}# end reset() |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1;# return true: |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |