| 1 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | ## MCE extension for sharing data supporting threads and processes. | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | package MCE::Shared; | ||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 40 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 40 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 40 | ▶ | use 5.010001; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 40 | ▶ | no warnings qw( threads recursion uninitialized once ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 40 | our $VERSION = '1.894'; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | ## no critic (BuiltinFunctions::ProhibitStringyEval) | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ## no critic (Subroutines::ProhibitSubroutinePrototypes) | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ## no critic (TestingAndDebugging::ProhibitNoStrict) | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 40 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 40 | $Carp::Internal{ (__PACKAGE__) }++; | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 40 | ▶ | no overloading; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 40 | ▶ | use MCE::Mutex (); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 40 | ▶ | use MCE::Shared::Server (); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 40 | ▶ | use Scalar::Util qw( blessed ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 40 | our @CARP_NOT = qw( | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | MCE::Shared::Array MCE::Shared::Hash MCE::Shared::Queue | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | MCE::Shared::Cache MCE::Shared::Minidb MCE::Shared::Scalar | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | MCE::Shared::Condvar MCE::Shared::Object MCE::Shared::Sequence | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | MCE::Shared::Handle MCE::Shared::Ordhash MCE::Shared::Server | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 31 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 40 | ▶ | no strict 'refs'; no warnings 'redefine'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 31 | *{ caller().'::mce_open' } = \&open; | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 31 | return; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 40 | my $_share_deeply = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||
| 48 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ## Share function. | ||||||||||||||||||||||||||||||||||||||||||||||
| 51 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 52 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 151 | ▶ | sub share { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
share: called CC=34 SCAR=54.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 151 | ▶ | shift if (defined $_[0] && $_[0] eq 'MCE::Shared'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0] and $_[0] eq "MCE::Shared"
MC/DC50%1/2
defined $_[0] and $_[0] eq "MCE::Shared"
defined $_[0]
$_[0] eq "MCE::Shared"
Truth table66%2/3
A and B
A= defined $_[0]B= $_[0] eq "MCE::Shared"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | # construction via module option | ||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 151 | ▶ | if ( ref $_[0] eq 'HASH' && $_[0]->{module} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
ref $_[0] eq "HASH" and $_[0]{"module"}
MC/DC100%2/2
ref $_[0] eq "HASH" and $_[0]{"module"}
ref $_[0] eq "HASH"
$_[0]{"module"}
Truth table100%3/3
A and B
A= ref $_[0] eq "HASH"B= $_[0]{"module"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 117 | my $_params = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 60 | 117 | my $_class = $_params->{module}; | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 117 | ▶ | return MCE::Shared->condvar(@_) if ( $_class eq 'MCE::Shared::Condvar' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 117 | ▶ | return MCE::Shared->handle(@_) if ( $_class eq 'MCE::Shared::Handle' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 117 | ▶ | return MCE::Shared->queue(@_) if ( $_class eq 'MCE::Shared::Queue' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 117 | $_params->{class} = ':construct_module:'; | |||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | my $_obj = MCE::Shared::Server::_new( | ||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 117 | ▶ | $_params, [ @_, delete $_params->{new} || 'new' ] | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
delete $_params->{'new'} || 'new'
MC/DC0%0/1
delete $_params->{'new'} || 'new'
delete $_params->{'new'}
Truth table50%1/2
A
A= delete $_params->{'new'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | $_obj->[6] = MCE::Mutex->new( impl => 'Channel' ) unless ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 73 | caller->isa('MCE::Hobo::_hash') || exists( $_params->{_DEEPLY_} ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 117 | ▶ | ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
(caller)->isa("MCE::Hobo::_hash") or exists $_params->{"_DEEPLY_"}
MC/DC100%2/2
(caller)->isa("MCE::Hobo::_hash") or exists $_params->{"_DEEPLY_"}
(caller)->isa("MCE::Hobo::_hash")
exists $_params->{"_DEEPLY_"}
Truth table100%3/3
A or B
A= (caller)->isa("MCE::Hobo::_hash")B= exists $_params->{"_DEEPLY_"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 117 | return $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 34 | ▶ | my $_params = ref $_[0] eq 'HASH' && ref $_[1] ? shift : {}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $_[0] eq "HASH" and ref $_[1]
MC/DC50%1/2
ref $_[0] eq "HASH" and ref $_[1]
ref $_[0] eq "HASH"
ref $_[1]
Truth table66%2/3
A and B
A= ref $_[0] eq "HASH"B= ref $_[1]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 34 | my $_class = blessed($_[0]); | |||||||||||||||||||||||||||||||||||||||||||||
| 81 | 34 | my $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||
| 83 | # class construction failed: e.g. share( class->new(...) ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 34 | ▶ | return '' if @_ && !$_[0] && $!; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
@_ and not $_[0] and $!
@_ and not $_[0]
MC/DC0%0/3
@_ and not $_[0] and $!
@_
not $_[0]
$!
Truth table25%1/4
A and not(B) and C
A= @_B= not $_[0]C= $!
| |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 34 | ▶ | $_share_deeply = 1 if $_params->{_DEEPLY_}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | # blessed object, \@array, \%hash, or \$scalar | ||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 34 | ▶ | if ( $_class ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 32 | ▶ | _incr_count($_[0]), return $_[0] if $_[0]->can('SHARED_ID'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 32 | $_params->{'class'} = $_class; | |||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 32 | $_obj = MCE::Shared::Server::_new($_params, $_[0]); | |||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||
| 95 | $_obj->[6] = MCE::Mutex->new( impl => 'Channel' ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 32 | ▶ | unless ( exists $_params->{_DEEPLY_} ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 98 | elsif ( ref $_[0] eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | if ( tied(@{ $_[0] }) && tied(@{ $_[0] })->can('SHARED_ID') ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
tied @{$_[0];} and tied(@{$_[0];})->can("SHARED_ID")
MC/DC0%0/2
tied @{$_[0];} and tied(@{$_[0];})->can("SHARED_ID")
tied @{$_[0];}
tied(@{$_[0];})->can("SHARED_ID")
Truth table33%1/3
A and B
A= tied @{$_[0];}B= tied(@{$_[0];})->can("SHARED_ID")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | _incr_count(tied(@{ $_[0] })), return tied(@{ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | $_obj = MCE::Shared->array($_params, @{ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 103 | 2 | @{ $_[0] } = (); tie @{ $_[0] }, 'MCE::Shared::Object', $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 105 | elsif ( ref $_[0] eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if ( tied(%{ $_[0] }) && tied(%{ $_[0] })->can('SHARED_ID') ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
tied %{$_[0];} and tied(%{$_[0];})->can("SHARED_ID")
MC/DC0%0/2
tied %{$_[0];} and tied(%{$_[0];})->can("SHARED_ID")
tied %{$_[0];}
tied(%{$_[0];})->can("SHARED_ID")
Truth table0%0/3
A and B
A= tied %{$_[0];}B= tied(%{$_[0];})->can("SHARED_ID")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | _incr_count(tied(%{ $_[0] })), return tied(%{ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | $_obj = MCE::Shared->hash($_params, %{ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | %{ $_[0] } = (); tie %{ $_[0] }, 'MCE::Shared::Object', $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | elsif ( ref $_[0] eq 'SCALAR' && !ref ${ $_[0] } ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $_[0] eq "SCALAR" and not ref ${$_[0];}
MC/DC0%0/2
ref $_[0] eq "SCALAR" and not ref ${$_[0];}
ref $_[0] eq "SCALAR"
not ref ${$_[0];}
Truth table0%0/3
A and not(B)
A= ref $_[0] eq "SCALAR"B= not ref ${$_[0];}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if ( tied(${ $_[0] }) && tied(${ $_[0] })->can('SHARED_ID') ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
tied ${$_[0];} and tied(${$_[0];})->can("SHARED_ID")
MC/DC0%0/2
tied ${$_[0];} and tied(${$_[0];})->can("SHARED_ID")
tied ${$_[0];}
tied(${$_[0];})->can("SHARED_ID")
Truth table0%0/3
A and B
A= tied ${$_[0];}B= tied(${$_[0];})->can("SHARED_ID")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | _incr_count(tied(${ $_[0] })), return tied(${ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | $_obj = MCE::Shared->scalar($_params, ${ $_[0] }); | |||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | undef ${ $_[0] }; tie ${ $_[0] }, 'MCE::Shared::Object', $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | # synopsis | ||||||||||||||||||||||||||||||||||||||||||||||
| 121 | elsif ( ref $_[0] eq 'REF' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | _croak('A "REF" type is not supported'); | |||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 124 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | if ( ref $_[0] eq 'GLOB' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | _incr_count(tied(*{ $_[0] })), return $_[0] if ( | |||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | tied(*{ $_[0] }) && tied(*{ $_[0] })->can('SHARED_ID') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
tied *{$_[0];} and tied(*{$_[0];})->can("SHARED_ID")
MC/DC0%0/2
tied *{$_[0];} and tied(*{$_[0];})->can("SHARED_ID")
tied *{$_[0];}
tied(*{$_[0];})->can("SHARED_ID")
Truth table0%0/3
A and B
A= tied *{$_[0];}B= tied(*{$_[0];})->can("SHARED_ID")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 128 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | _croak('Synopsis: blessed object, \@array, \%hash, or \$scalar'); | |||||||||||||||||||||||||||||||||||||||||||||
| 131 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 34 | return $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||
| 136 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 137 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 138 | ## Public functions. | ||||||||||||||||||||||||||||||||||||||||||||||
| 139 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 140 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 40 | our $AUTOLOAD; # MCE::Shared::<method_name> | |||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 217 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=30 SCAR=37.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 217 | my $_fcn = $AUTOLOAD; substr($_fcn, 0, rindex($_fcn,':') + 1, ''); | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 217 | ▶ | shift if ( defined $_[0] && $_[0] eq 'MCE::Shared' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0] and $_[0] eq "MCE::Shared"
MC/DC50%1/2
defined $_[0] and $_[0] eq "MCE::Shared"
defined $_[0]
$_[0] eq "MCE::Shared"
Truth table66%2/3
A and B
A= defined $_[0]B= $_[0] eq "MCE::Shared"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 217 | ▶ | return MCE::Shared::Object::_init(@_) if $_fcn eq 'init'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 192 | ▶ | return MCE::Shared::Server::_start() if $_fcn eq 'start'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 135 | ▶ | return MCE::Shared::Server::_stop() if $_fcn eq 'stop'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 135 | ▶ | return MCE::Shared::Server::_pid() if $_fcn eq 'pid'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 135 | ▶ | if ( $_fcn eq 'array' || $_fcn eq 'hash' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition100%3/3
$_fcn eq "array" or $_fcn eq "hash"
MC/DC100%2/2
$_fcn eq "array" or $_fcn eq "hash"
$_fcn eq "array"
$_fcn eq "hash"
Truth table100%3/3
A or B
A= $_fcn eq "array"B= $_fcn eq "hash"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 16 | _use( 'MCE::Shared::'.ucfirst($_fcn) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 156 | 16 | ▶ | my $_params = ref $_[0] eq 'HASH' ? shift : {}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 16 | ▶ | $_params->{module} = ( $_fcn eq 'array' ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | ? 'MCE::Shared::Array' : 'MCE::Shared::Hash'; | ||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 16 | my $_obj = &share($_params); | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | 16 | delete $_params->{module}; | |||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 16 | ▶ | if ( scalar @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 16 | ▶ | if ( $_share_deeply ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 9 | $_params->{_DEEPLY_} = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | 9 | ▶ | if ( $_fcn eq 'array' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 6 | ▶ | for ( my $i = 0; $i <= $#_; $i += 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 16 | ▶ | &_share($_params, $_obj, $_[$i]) if ref($_[$i]); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 3 | ▶ | for ( my $i = 1; $i <= $#_; $i += 2 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 9 | ▶ | &_share($_params, $_obj, $_[$i]) if ref($_[$i]); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 16 | $_obj->assign(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 16 | $_share_deeply = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 16 | return $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 184 | elsif ( $_fcn eq 'handle' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 1 | ▶ | require MCE::Shared::Handle unless $INC{'MCE/Shared/Handle.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 1 | my $_obj = &share( MCE::Shared::Handle->new([]) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 188 | 40 | ▶ | my $_fh = \do { no warnings 'once'; local *FH }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1 | tie *{ $_fh }, 'MCE::Shared::Object', $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 191 | 1 | ▶ | if ( @_ ) { $_obj->OPEN(@_) or return ''; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 1 | return $_fh; | |||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 195 | ▶ | elsif ( $_fcn eq 'pdl' || $_fcn =~ /^pdl_(s?byte|u?short|u?long|indx|u?longlong|float|l?double|sequence|zeroe?s|ones|g?random)$/ ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$_fcn eq "pdl" or $_fcn =~ /^pdl_(s?byte|u?short|u?long|indx|u?longlong|float|l?double|sequence|zeroe?s|ones|g?random)$/
MC/DC0%0/2
$_fcn eq "pdl" or $_fcn =~ /^pdl_(s?byte|u?short|u?long|indx|u?longlong|float|l?double|sequence|zeroe?s|ones|g?random)$/
$_fcn eq "pdl"
$_fcn =~ /^pdl_(s?byte|u?short|u?long|indx|u?longlong|float|l?double|sequence|zeroe?s|ones|g?random)$/
Truth table33%1/3
A or B
A= $_fcn eq "pdl"B= $_fcn =~ /^pdl_(s?byte|u?short|u?long|indx|u?longlong|float|l?double|sequence|zeroe?s|ones|g?random)$/
| |||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | $_fcn = $1 if ( $_fcn ne 'pdl' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | push @_, $_fcn; _use('PDL') or _croak($@); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | my $_obj = MCE::Shared::Server::_new( | |||||||||||||||||||||||||||||||||||||||||||||
| 201 | { 'class' => ':construct_pdl:' }, [ @_ ] | ||||||||||||||||||||||||||||||||||||||||||||||
| 202 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $_obj->[6] = MCE::Mutex->new( impl => 'Channel' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | return $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||||||
| 209 | # cache, condvar, minidb, ordhash, queue, scalar, sequence, et cetera | ||||||||||||||||||||||||||||||||||||||||||||||
| 210 | 118 | ▶ | $_fcn = 'sequence' if $_fcn eq 'num_sequence'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 118 | my $_pkg = ucfirst( lc $_fcn ); local $@; | |||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 118 | ▶ | if ( $INC{"MCE/Shared/$_pkg.pm"} || eval "use MCE::Shared::$_pkg (); 1" ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Branch: 1 branch
Condition66%2/3
$INC{"MCE/Shared/$_pkg.pm"} or eval "use MCE::Shared::$_pkg (); 1"
MC/DC0%0/2
$INC{"MCE/Shared/$_pkg.pm"} or eval "use MCE::Shared::$_pkg (); 1"
$INC{"MCE/Shared/$_pkg.pm"}
eval "use MCE::Shared::$_pkg (); 1"
Truth table66%2/3
A or B
A= $INC{"MCE/Shared/$_pkg.pm"}B= eval "use MCE::Shared::$_pkg (); 1"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 118 | $_pkg = "MCE::Shared::$_pkg"; | |||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 118 | ▶ | return &share({}, $_pkg->new(@_)) if ( $_fcn =~ /^(?:condvar|queue)$/ ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 89 | return &share({ module => $_pkg }, @_); | |||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | _croak("Can't locate object method \"$_fcn\" via package \"MCE::Shared\""); | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 8 | ▶ | sub open (@) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
open: called CC=14 SCAR=29.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 8 | ▶ | shift if ( defined $_[0] && $_[0] eq 'MCE::Shared' ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0] and $_[0] eq "MCE::Shared"
MC/DC0%0/2
defined $_[0] and $_[0] eq "MCE::Shared"
defined $_[0]
$_[0] eq "MCE::Shared"
Truth table66%2/3
A and B
A= defined $_[0]B= $_[0] eq "MCE::Shared"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 8 | ▶ | require MCE::Shared::Handle unless $INC{'MCE/Shared/Handle.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 8 | my $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 228 | 8 | ▶ | if ( ref $_[0] eq 'GLOB' && tied *{ $_[0] } && | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition66%4/6
ref $_[0] eq "GLOB" and tied *{$_[0];} and ref tied *{$_[0];} eq "MCE::Shared::Object"
ref $_[0] eq "GLOB" and tied *{$_[0];}
MC/DC33%1/3
ref $_[0] eq "GLOB" and tied *{$_[0];} and ref tied *{$_[0];} eq "MCE::Shared::Object"
ref $_[0] eq "GLOB"
tied *{$_[0];}
ref tied *{$_[0];} eq "MCE::Shared::Object"
Truth table50%2/4
A and B and C
A= ref $_[0] eq "GLOB"B= tied *{$_[0];}C= ref tied *{$_[0];} eq "MCE::Shared::Object"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 6 | ref tied(*{ $_[0] }) eq 'MCE::Shared::Object' ) { | |||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 6 | $_obj = tied *{ $_[0] }; | |||||||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 233 | elsif ( @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | if ( ref $_[0] eq 'GLOB' && tied *{ $_[0] } ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $_[0] eq "GLOB" and tied *{$_[0];}
MC/DC0%0/2
ref $_[0] eq "GLOB" and tied *{$_[0];}
ref $_[0] eq "GLOB"
tied *{$_[0];}
Truth table33%1/3
A and B
A= ref $_[0] eq "GLOB"B= tied *{$_[0];}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | close $_[0] if defined ( fileno $_[0] ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 2 | $_obj = &share( MCE::Shared::Handle->new([]) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 238 | 40 | ▶ | $_[0] = \do { no warnings 'once'; local *FH }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 2 | tie *{ $_[0] }, 'MCE::Shared::Object', $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 241 | |||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 8 | ▶ | shift; _croak("Not enough arguments for open") unless @_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 8 | ▶ | if ( !defined wantarray ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 1 | ▶ | $_obj->OPEN(@_) or _croak("open error: $!"); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 7 | $_obj->OPEN(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||
| 251 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 252 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 253 | ## TIE support. | ||||||||||||||||||||||||||||||||||||||||||||||
| 254 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 255 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 4 | ▶ | sub TIEARRAY { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIEARRAY: called CC=3 SCAR=12.5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 4 | shift; $_share_deeply = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 4 | ▶ | ( ref($_[0]) eq 'HASH' && exists $_[0]->{'module'} ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $_[0] eq "HASH" and exists $_[0]{"module"}
MC/DC0%0/2
ref $_[0] eq "HASH" and exists $_[0]{"module"}
ref $_[0] eq "HASH"
exists $_[0]{"module"}
Truth table33%1/3
A and B
A= ref $_[0] eq "HASH"B= exists $_[0]{"module"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 261 | ? _tie('TIEARRAY', @_) : MCE::Shared->array(@_); | ||||||||||||||||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 263 | |||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | ▶ | sub TIEHANDLE { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIEHANDLE: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | shift; require MCE::Shared::Handle unless $INC{'MCE/Shared/Handle.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||||||
| 267 | # Tie *FH, 'MCE::Shared', { module => 'MCE::Shared::Handle' }, '>>', \*STDOUT | ||||||||||||||||||||||||||||||||||||||||||||||
| 268 | # doesn't work on the Windows platform. We'd let OPEN handle the ref instead. | ||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | shift if ref($_[0]) eq 'HASH' && $_[0]->{'module'} eq 'MCE::Shared::Handle'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $_[0] eq "HASH" and $_[0]{"module"} eq "MCE::Shared::Handle"
MC/DC0%0/2
ref $_[0] eq "HASH" and $_[0]{"module"} eq "MCE::Shared::Handle"
ref $_[0] eq "HASH"
$_[0]{"module"} eq "MCE::Shared::Handle"
Truth table0%0/3
A and B
A= ref $_[0] eq "HASH"B= $_[0]{"module"} eq "MCE::Shared::Handle"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | if ( ref($_[0]) eq 'HASH' && exists $_[0]->{'module'} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $_[0] eq "HASH" and exists $_[0]{"module"}
MC/DC0%0/2
ref $_[0] eq "HASH" and exists $_[0]{"module"}
ref $_[0] eq "HASH"
exists $_[0]{"module"}
Truth table0%0/3
A and B
A= ref $_[0] eq "HASH"B= exists $_[0]{"module"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | ▶ | if ( @_ == 3 && ref $_[2] && defined( my $_fd = fileno($_[2]) ) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
@_ == 3 and ref $_[2] and defined(my $_fd = fileno $_[2])
@_ == 3 and ref $_[2]
MC/DC0%0/3
@_ == 3 and ref $_[2] and defined(my $_fd = fileno $_[2])
@_ == 3
ref $_[2]
defined(my $_fd = fileno $_[2])
Truth table0%0/4
A and B and C
A= @_ == 3B= ref $_[2]C= defined(my $_fd = fileno $_[2])
| |||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | _tie('TIEHANDLE', $_[0], $_[1]."&=$_fd"); | |||||||||||||||||||||||||||||||||||||||||||||
| 275 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | _tie('TIEHANDLE', @_); | |||||||||||||||||||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 279 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | my $_obj = &share( MCE::Shared::Handle->new([]) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | if ( @_ ) { $_obj->OPEN(@_) or return ''; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 9 | ▶ | sub TIEHASH { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIEHASH: called CC=16 SCAR=43.5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 9 | shift; $_share_deeply = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||
| 290 | return _tie('TIEHASH', @_) if ( | ||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 9 | ▶ | ref($_[0]) eq 'HASH' && exists $_[0]->{'module'} | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $_[0] eq "HASH" and exists $_[0]{"module"}
MC/DC50%1/2
ref $_[0] eq "HASH" and exists $_[0]{"module"}
ref $_[0] eq "HASH"
exists $_[0]{"module"}
Truth table66%2/3
A and B
A= ref $_[0] eq "HASH"B= exists $_[0]{"module"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 292 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 3 | my ($_cache, $_ordered); | |||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 3 | ▶ | if ( ref $_[0] eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | if ( $_[0]->{'ordered'} || $_[0]->{'ordhash'} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$_[0]{"ordered"} or $_[0]{"ordhash"}
MC/DC0%0/2
$_[0]{"ordered"} or $_[0]{"ordhash"}
$_[0]{"ordered"}
$_[0]{"ordhash"}
Truth table0%0/3
A or B
A= $_[0]{"ordered"}B= $_[0]{"ordhash"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | $_ordered = 1; shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 299 | ▶ | } elsif ( exists $_[0]->{'max_age'} || exists $_[0]->{'max_keys'} ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
exists $_[0]{"max_age"} or exists $_[0]{"max_keys"}
MC/DC0%0/2
exists $_[0]{"max_age"} or exists $_[0]{"max_keys"}
exists $_[0]{"max_age"}
exists $_[0]{"max_keys"}
Truth table0%0/3
A or B
A= exists $_[0]{"max_age"}B= exists $_[0]{"max_keys"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $_cache = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 303 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 3 | ▶ | if ( @_ < 3 && ( $_[0] eq 'ordered' || $_[0] eq 'ordhash' ) ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition16%1/6
@_ < 3 and $_[0] eq "ordered" || $_[0] eq "ordhash"
$_[0] eq "ordered" or $_[0] eq "ordhash"
MC/DC0%0/3
@_ < 3 and $_[0] eq "ordered" || $_[0] eq "ordhash"
@_ < 3
$_[0] eq "ordered"
$_[0] eq "ordhash"
Truth table25%1/4
A and B or C
A= @_ < 3B= $_[0] eq "ordered"C= $_[0] eq "ordhash"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | $_ordered = $_[1]; splice(@_, 0, 2); | |||||||||||||||||||||||||||||||||||||||||||||
| 306 | ▶ | } elsif ( @_ < 5 && ( $_[0] eq 'max_age' || $_[0] eq 'max_keys' ) ) { | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition16%1/6
@_ < 5 and $_[0] eq "max_age" || $_[0] eq "max_keys"
$_[0] eq "max_age" or $_[0] eq "max_keys"
MC/DC0%0/3
@_ < 5 and $_[0] eq "max_age" || $_[0] eq "max_keys"
@_ < 5
$_[0] eq "max_age"
$_[0] eq "max_keys"
Truth table25%1/4
A and B or C
A= @_ < 5B= $_[0] eq "max_age"C= $_[0] eq "max_keys"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | $_cache = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 309 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 3 | ▶ | return MCE::Shared->cache(@_) if $_cache; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 3 | ▶ | return MCE::Shared->ordhash(@_) if $_ordered; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 3 | return MCE::Shared->hash(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||||||
| 316 | 73 | ▶ | sub TIESCALAR { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIESCALAR: called CC=3 SCAR=13.1
| |||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 73 | shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 73 | ▶ | ( ref($_[0]) eq 'HASH' && exists $_[0]->{'module'} ) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $_[0] eq "HASH" and exists $_[0]{"module"}
MC/DC0%0/2
ref $_[0] eq "HASH" and exists $_[0]{"module"}
ref $_[0] eq "HASH"
exists $_[0]{"module"}
Truth table33%1/3
A and B
A= ref $_[0] eq "HASH"B= exists $_[0]{"module"}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 320 | ? _tie('TIESCALAR', @_) : MCE::Shared->scalar(@_); | ||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 322 | |||||||||||||||||||||||||||||||||||||||||||||||
| 323 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 324 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 325 | ## Private functions. | ||||||||||||||||||||||||||||||||||||||||||||||
| 326 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 327 | ############################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | ▶ | sub _croak { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_croak: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | if ( $INC{'MCE.pm'} ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | goto &MCE::_croak; | |||||||||||||||||||||||||||||||||||||||||||||
| 332 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | ▶ | require MCE::Shared::Base unless $INC{'MCE/Shared/Base.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | goto &MCE::Shared::Base::_croak; | |||||||||||||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 336 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | sub _incr_count { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_incr_count: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 339 | # increments counter for safety during destroy | ||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | MCE::Shared::Server::_incr_count($_[0]->SHARED_ID); | |||||||||||||||||||||||||||||||||||||||||||||
| 341 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | sub _share { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_share: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 0 | $_[2] = &share($_[0], $_[2]); | |||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | MCE::Shared::Object::_req2( | |||||||||||||||||||||||||||||||||||||||||||||
| 347 | 'M~DEE', $_[1]->SHARED_ID()."\n", $_[2]->SHARED_ID()."\n" | ||||||||||||||||||||||||||||||||||||||||||||||
| 348 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 350 | |||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 6 | ▶ | sub _tie { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_tie: called CC=13 SCAR=41.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 6 | my ( $_fcn, $_params ) = ( shift, shift ); | |||||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 6 | ▶ | _use( my $_module = $_params->{'module'} ) or _croak("$@\n"); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||||||
| 356 | 6 | ▶ | _croak("Can't locate object method \"$_fcn\" via package \"$_module\"") | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 357 | unless eval qq{ $_module->can('$_fcn') }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 6 | $_params->{class} = ':construct_module:'; | |||||||||||||||||||||||||||||||||||||||||||||
| 360 | 6 | $_params->{tied } = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 6 | my $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 6 | ▶ | if ( $_params->{'module'}->isa('MCE::Shared::Array') ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 0 | $_obj = MCE::Shared::Server::_new($_params, [ (), $_fcn ]); | |||||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | ▶ | if ( @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 367 | 0 | $_params->{_DEEPLY_} = 1; delete $_params->{module}; | |||||||||||||||||||||||||||||||||||||||||||||
| 368 | 0 | ▶ | for ( my $i = 0; $i <= $#_; $i += 1 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | ▶ | &_share($_params, $_obj, $_[$i]) if ref($_[$i]); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | $_obj->assign(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 372 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 374 | elsif ( $_params->{'module'}->isa('MCE::Shared::Hash') ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | $_obj = MCE::Shared::Server::_new($_params, [ (), $_fcn ]); | |||||||||||||||||||||||||||||||||||||||||||||
| 376 | 0 | ▶ | if ( @_ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 0 | $_params->{_DEEPLY_} = 1; delete $_params->{module}; | |||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | ▶ | for ( my $i = 1; $i <= $#_; $i += 2 ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | &_share($_params, $_obj, $_[$i]) if ref($_[$i]); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | $_obj->assign(@_); | |||||||||||||||||||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 384 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 6 | $_obj = MCE::Shared::Server::_new($_params, [ @_, $_fcn ]); | |||||||||||||||||||||||||||||||||||||||||||||
| 386 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 6 | ▶ | if ( $_obj && $_obj->[2] ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$_obj and $_obj->[2]
MC/DC0%0/2
$_obj and $_obj->[2]
$_obj
$_obj->[2]
Truth table33%1/3
A and B
A= $_objB= $_obj->[2]
| |||||||||||||||||||||||||||||||||||||||||||||||
| 389 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 390 | # Set encoder/decoder automatically for supported DB modules. | ||||||||||||||||||||||||||||||||||||||||||||||
| 391 | # - AnyDBM_File, DB_File, GDBM_File, NDBM_File, ODBM_File, SDBM_File, | ||||||||||||||||||||||||||||||||||||||||||||||
| 392 | # - CDB_File, SQLite_File, Tie::Array::DBD, Tie::Hash::DBD, | ||||||||||||||||||||||||||||||||||||||||||||||
| 393 | # - BerkeleyDB::*, KyotoCabinet::DB, TokyoCabinet::* | ||||||||||||||||||||||||||||||||||||||||||||||
| 394 | ## | ||||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | $_obj->[2] = MCE::Shared::Server::_get_freeze(), | |||||||||||||||||||||||||||||||||||||||||||||
| 396 | $_obj->[3] = MCE::Shared::Server::_get_thaw(); | ||||||||||||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 398 | |||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 6 | $_obj->[6] = MCE::Mutex->new( impl => 'Channel' ); | |||||||||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||||||||||
| 401 | 6 | $_share_deeply = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 6 | return $_obj; | |||||||||||||||||||||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 22 | ▶ | sub _use { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_use: called CC=17 SCAR=43.2
| |||||||||||||||||||||||||||||||||||||||||||||||
| 407 | 22 | my $_class = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 22 | ▶ | return 1 if $_class eq 'main'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||||||||||||||||
| 411 | 22 | ▶ | if ( $_class =~ /(.*)::_/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||||||||||||||||||
| 412 | # e.g. MCE::Hobo::_hash | ||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | ▶ | eval "require $1" unless $INC{ join('/',split(/::/,$1)).'.pm' }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 415 | elsif ( $_class =~ /^(BerkeleyDB)::(?:Btree|Hash|Queue|Recno)$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 416 | 0 | ▶ | eval "require $1" unless $INC{"$1.pm"}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 417 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 418 | elsif ( $_class =~ /^(TokyoCabinet|KyotoCabinet)::[ABH]?DB$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | eval "require $1" unless $INC{"$1.pm"}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 420 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 421 | elsif ( $_class =~ /^Tie::(?:Std|Extra)Hash$/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 422 | 0 | ▶ | eval "require Tie::Hash" unless $INC{'Tie/Hash.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 424 | elsif ( $_class eq 'Tie::StdArray' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 0 | ▶ | eval "require Tie::Array" unless $INC{'Tie/Array.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 427 | elsif ( $_class eq 'Tie::StdScalar' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 0 | ▶ | eval "require Tie::Scalar" unless $INC{'Tie/Scalar.pm'}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 22 | ▶ | return 1 if eval q{ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 432 | $_class->can('new') || | ||||||||||||||||||||||||||||||||||||||||||||||
| 433 | $_class->can('TIEARRAY') || $_class->can('TIEHANDLE') || | ||||||||||||||||||||||||||||||||||||||||||||||
| 434 | $_class->can('TIEHASH') || $_class->can('TIESCALAR') | ||||||||||||||||||||||||||||||||||||||||||||||
| 435 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 436 | |||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 1 | ▶ | if ( !exists $INC{ join('/',split(/::/,$_class)).'.pm' } ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 438 | # remove tainted'ness from $_class | ||||||||||||||||||||||||||||||||||||||||||||||
| 439 | 1 | ($_class) = $_class =~ /(.*)/; | |||||||||||||||||||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 1 | ▶ | eval "use $_class (); 1" or return ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 442 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 443 | |||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 1 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 445 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 40 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||||||||||||||||||||
| 449 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||