line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
############################################################################### |
2
|
|
|
|
|
|
|
## ---------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
## Common API for MCE::Shared::{ Array, Cache, Hash, Minidb, Ordhash }. |
4
|
|
|
|
|
|
|
## |
5
|
|
|
|
|
|
|
############################################################################### |
6
|
|
|
|
|
|
|
|
7
|
15
|
|
|
15
|
|
127
|
use strict; |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
458
|
|
8
|
15
|
|
|
15
|
|
65
|
use warnings; |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
338
|
|
9
|
|
|
|
|
|
|
|
10
|
15
|
|
|
15
|
|
236
|
use 5.010001; |
|
15
|
|
|
|
|
73
|
|
11
|
|
|
|
|
|
|
|
12
|
15
|
|
|
15
|
|
84
|
no warnings qw( threads recursion uninitialized numeric ); |
|
15
|
|
|
|
|
76
|
|
|
15
|
|
|
|
|
4988
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package MCE::Shared::Common; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = '1.886'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# pipeline ( [ func1, @args ], [ func2, @args ], ... ) |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub pipeline { |
21
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
22
|
0
|
0
|
|
|
|
|
my $tmp; $tmp = pop if ( defined wantarray ); |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
while ( @_ ) { |
25
|
0
|
0
|
|
|
|
|
my $cmd = shift; next unless ( ref $cmd eq 'ARRAY' ); |
|
0
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
if ( my $code = $self->can(shift @{ $cmd }) ) { |
|
0
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$code->($self, @{ $cmd }); |
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
|
if ( defined $tmp ) { |
32
|
0
|
|
|
|
|
|
my $code; |
33
|
|
|
|
|
|
|
return ( ref $tmp eq 'ARRAY' && ( $code = $self->can(shift @{ $tmp }) ) ) |
34
|
0
|
0
|
0
|
|
|
|
? $code->($self, @{ $tmp }) |
|
0
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
: undef; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# pipeline_ex ( [ func1, @args ], [ func2, @args ], ... ) |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub pipeline_ex { |
44
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
45
|
0
|
|
|
|
|
|
my $code; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
map { |
48
|
0
|
|
|
|
|
|
( ref $_ eq 'ARRAY' && ( $code = $self->can(shift @{ $_ }) ) ) |
49
|
0
|
0
|
0
|
|
|
|
? $code->($self, @{ $_ }) |
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
: undef; |
51
|
|
|
|
|
|
|
} @_; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |