line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flux::Simple::ArrayIn; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Flux::Simple::ArrayIn::VERSION = '1.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: input stream representation of an array |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
|
4208
|
use Moo; |
|
6
|
|
|
|
|
82571
|
|
|
6
|
|
|
|
|
34
|
|
10
|
|
|
|
|
|
|
with 'Flux::In'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has '_data' => ( |
13
|
|
|
|
|
|
|
is => 'ro', |
14
|
|
|
|
|
|
|
required => 1, |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub BUILDARGS { |
18
|
2
|
|
|
2
|
0
|
2173
|
my $class = shift; |
19
|
2
|
|
|
|
|
6
|
my ($data) = @_; |
20
|
2
|
|
|
|
|
45
|
return { _data => $data }; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub read { |
24
|
28
|
|
|
28
|
0
|
1340
|
my $self = shift; |
25
|
28
|
|
|
|
|
32
|
return shift @{ $self->_data }; |
|
28
|
|
|
|
|
90
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub read_chunk { |
29
|
2
|
|
|
2
|
0
|
6
|
my $self = shift; |
30
|
2
|
|
|
|
|
3
|
my ($number) = @_; |
31
|
|
|
|
|
|
|
|
32
|
2
|
100
|
|
|
|
3
|
return unless @{ $self->_data }; |
|
2
|
|
|
|
|
15
|
|
33
|
1
|
|
|
|
|
3
|
return [ splice @{ $self->_data }, 0, $number ]; |
|
1
|
|
|
|
|
94
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
0
|
6
|
sub commit {} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |