Simple/AnyWhere.pm

filter: Statementstmt 88.8% 24 / 27 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 81.5% 31 / 38 CC 4 SCAR 7.2
CC
4
Cov
84%
AUTOLOAD
3.1
_searchSubs
2.0
DESTROY
2.0
CRAP 2.0
« Simple/AnyRemote.pm ↑ Summary Simple/AnyLocal.pm »
1 package RPC::Simple::AnyWhere;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp ;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use vars qw($VERSION $AUTOLOAD @RPC_SUB %_RPC_SUBS);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # Items to export into callers namespace by default. Note: do not export
8 # names by default without a very good reason. Use EXPORT_OK instead.
9 # Do not simply export all your public functions/methods/constants.
10  
11 1 ( $VERSION ) = '$Revision: 1.6 $ ' =~ /\$Revision:\s+([^\s]+)/;
12  
13 # Preloaded methods go here.
14  
15 # We may need a mechanism to declare the functions vailable on the remote
16 # side
17  
18 sub _searchSubs
19 3 ▶ {
Subroutine _searchSubs: called CC=2 SCAR=6.9
20 3 my $self = shift ;
21 3 my $package = shift ;
22  
23 3 push @{$_RPC_SUBS{ref($self)}}, eval("\@${package}::RPC_SUB") ;
24  
25 3 foreach my $class (eval("\@${package}::ISA"))
26 {
27 2 $self->_searchSubs($class) ;
28 }
29 }
30  
31 sub AUTOLOAD
32 1 ▶ {
Subroutine AUTOLOAD: called CC=3 SCAR=11.4
33 1 my $self = shift ;
34  
35 1 my $called = $AUTOLOAD ;
36 1 $called =~ s/.*::// ;
37  
38 1 ▶ if (defined $_RPC_SUBS{ref($self)} and
Branch: 1 branch
BranchTrueFalseTotal
if (defined $RPC::Simple::AnyWhere::_RPC_SUBS{ref $self} and scalar grep(($called eq $_), @{$RPC::Simple::AnyWhere::_RPC_SUBS{ref $self};})) 1 0 1
Condition50%1/2
defined $RPC::Simple::AnyWhere::_RPC_SUBS{ref $self} and scalar grep(($called eq $_), @{$RPC::Simple::AnyWhere::_RPC_SUBS{ref $self};})
!ll
01
MC/DC0%0/1
defined $RPC::Simple::AnyWhere::_RPC_SUBS{ref $self} and scalar grep(($called eq $_), @{$RPC::Simple::AnyWhere::_RPC_SUBS{ref $self};})
defined $RPC::Simple::AnyWhere::_RPC_SUBS{ref $self}
Truth table50%1/2
A
A= defined $RPC::Simple::AnyWhere::_RPC_SUBS{ref $self}
Aresult
00
11
39 1 scalar grep ($called eq $_,@{$_RPC_SUBS{ref($self)}} ))
40 {
41 1 $self->{_twinHandle}->delegate($called,@_) ;
42 1 return $self ;
43 }
44  
45 0 croak "Undefined subroutine $AUTOLOAD called";
46 }
47  
48 sub DESTROY
49 0 ▶ {
Subroutine DESTROY: not called CC=1 SCAR=6.9
50 0 my $self = shift ;
51 0 print "class ",ref($self)," destroyed \n";
52 }
53  
54 # Autoload methods go after =cut, and are processed by the autosplit program.
55  
56 1 1;
57 __END__
« Simple/AnyRemote.pm ↑ Summary Simple/AnyLocal.pm »