line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package M3::ServerView::ResultSet; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
34671
|
use strict; |
|
8
|
|
|
|
|
17
|
|
|
8
|
|
|
|
|
331
|
|
4
|
8
|
|
|
8
|
|
50
|
use warnings; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
276
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
44
|
use Carp qw(croak); |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
620
|
|
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
49
|
use Scalar::Util qw(refaddr); |
|
8
|
|
|
|
|
23
|
|
|
8
|
|
|
|
|
3023
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
17
|
|
|
17
|
1
|
1238
|
my ($pkg, $records) = @_; |
12
|
|
|
|
|
|
|
|
13
|
17
|
50
|
|
|
|
55
|
$records = [] unless defined $records; |
14
|
|
|
|
|
|
|
|
15
|
17
|
100
|
|
|
|
79
|
croak "Not an array reference" unless ref $records eq "ARRAY"; |
16
|
|
|
|
|
|
|
|
17
|
16
|
|
|
|
|
63
|
my $self = bless $records, $pkg; |
18
|
16
|
|
|
|
|
46
|
$self->reset(); |
19
|
|
|
|
|
|
|
|
20
|
16
|
|
|
|
|
43
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
my %Position; |
25
|
|
|
|
|
|
|
sub reset { |
26
|
17
|
|
|
17
|
1
|
26
|
my ($self) = @_; |
27
|
17
|
|
|
|
|
77
|
$Position{refaddr $self} = 0; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub next { |
31
|
37
|
|
|
37
|
1
|
64
|
my ($self) = @_; |
32
|
37
|
100
|
|
|
|
170
|
return if $Position{refaddr $self} >= @$self; |
33
|
35
|
|
|
|
|
202
|
return $self->[$Position{refaddr $self}++]; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub all { |
38
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
39
|
0
|
|
|
|
|
0
|
return @$self; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub first { |
43
|
1
|
|
|
1
|
1
|
2
|
my ($self) = @_; |
44
|
1
|
|
|
|
|
5
|
return $self->[0]; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub count { |
48
|
16
|
|
|
16
|
1
|
1084
|
my ($self) = @_; |
49
|
16
|
|
|
|
|
103
|
return scalar @$self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
__END__ |