line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flux::Mapper; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Flux::Mapper::VERSION = '1.03'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: interface for transforming input or output streams. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
2747
|
use Moo::Role; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
36
|
|
10
|
|
|
|
|
|
|
|
11
|
7
|
|
|
7
|
|
1953
|
use Carp; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
556
|
|
12
|
7
|
|
|
7
|
|
35
|
use Scalar::Util qw(blessed); |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
426
|
|
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
7
|
|
361
|
use Flux::Out; |
|
7
|
|
|
|
|
26
|
|
|
7
|
|
|
|
|
2411
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use overload '|' => sub { |
17
|
4
|
|
|
4
|
|
42
|
my ($left, $right, $swap) = @_; |
18
|
|
|
|
|
|
|
|
19
|
4
|
|
|
|
|
2165
|
require Flux::Mapper::MappedIn; |
20
|
4
|
|
|
|
|
1972
|
require Flux::Mapper::MappedOut; |
21
|
4
|
|
|
|
|
2281
|
require Flux::Mapper::MappedMapper; |
22
|
|
|
|
|
|
|
|
23
|
4
|
100
|
|
|
|
29
|
if ($swap) { |
24
|
2
|
|
|
|
|
5
|
($left, $right) = ($right, $left); |
25
|
|
|
|
|
|
|
} |
26
|
4
|
50
|
33
|
|
|
104
|
unless (blessed $left and $left->can('does')) { |
27
|
0
|
|
|
|
|
0
|
croak "Left side of pipe is not a flux object, but '$left'"; |
28
|
|
|
|
|
|
|
} |
29
|
4
|
50
|
33
|
|
|
62
|
unless (blessed $right and $right->can('does')) { |
30
|
0
|
|
|
|
|
0
|
croak "Right side of pipe is not a flux object, but '$right'"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
4
|
100
|
100
|
|
|
22
|
if ($left->does('Flux::Mapper') and $right->does('Flux::Mapper')) { |
34
|
|
|
|
|
|
|
# m | m |
35
|
1
|
|
|
|
|
67
|
return Flux::Mapper::MappedMapper->new(left => $left, right => $right); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
3
|
100
|
66
|
|
|
223
|
if ($left->does('Flux::Mapper') and $right->does('Flux::Out')) { |
39
|
|
|
|
|
|
|
# m | o |
40
|
1
|
|
|
|
|
34
|
return Flux::Mapper::MappedOut->new(mapper => $left, out => $right); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
2
|
50
|
33
|
|
|
40
|
if ($left->does('Flux::In') and $right->does('Flux::Mapper')) { |
44
|
|
|
|
|
|
|
# i | m |
45
|
2
|
|
|
|
|
72
|
return Flux::Mapper::MappedIn->new(in => $left, mapper => $right); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
croak "Strange arguments '$left' and '$right'"; |
49
|
|
|
|
|
|
|
|
50
|
7
|
|
|
7
|
|
1656
|
}, '""' => sub { $_[0] }; # strangely, when I overload |, I need to overload other operators too... |
|
7
|
|
|
0
|
|
1119
|
|
|
7
|
|
|
|
|
107
|
|
|
0
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
requires 'write'; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
requires 'write_chunk'; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
requires 'commit'; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |