| 1 | # | ||||||||||||||||||||||||||||
| 2 | # $HeadURL: https://svn.oucs.ox.ac.uk/people/oliver/pub/librpc-serialized-perl/trunk/lib/RPC/Serialized/Client.pm $ | ||||||||||||||||||||||||||||
| 3 | # $LastChangedRevision: 1323 $ | ||||||||||||||||||||||||||||
| 4 | # $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $ | ||||||||||||||||||||||||||||
| 5 | # $LastChangedBy: oliver $ | ||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||
| 7 | package RPC::Serialized::Client; | ||||||||||||||||||||||||||||
| 8 | { | ||||||||||||||||||||||||||||
| 9 | 15 | $RPC::Serialized::Client::VERSION = '1.123630'; | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | 15 | ▶ | use warnings FATAL => 'all'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 15 | ▶ | use base 'RPC::Serialized'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 15 | ▶ | use RPC::Serialized::Exceptions; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 15 | our $AUTOLOAD; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 19 | ▶ | sub call { | ||||||||||||||||||||||||||
|
Subroutine
call: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 19 | my $self = shift; | |||||||||||||||||||||||||||
| 23 | 19 | my $call = shift; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | # this is where we would hack around with the RPC protocol | ||||||||||||||||||||||||||||
| 26 | # although not the on-the-wire stuff, which is in Serialized.pm | ||||||||||||||||||||||||||||
| 27 | 19 | $self->send( { CALL => $call, ARGS => \@_ } ); | |||||||||||||||||||||||||||
| 28 | 19 | my $reply = $self->recv; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 19 | ▶ | if ( $reply->{EXCEPTION} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 6 | my $class = $reply->{EXCEPTION}->{CLASS}; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 6 | ▶ | throw_proto 'Invalid or missing CLASS' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$class and $class =~ /^RPC::Serialized::X(::.+)?$/
MC/DC0%0/2
$class and $class =~ /^RPC::Serialized::X(::.+)?$/
$class
$class =~ /^RPC::Serialized::X(::.+)?$/
Truth table33%1/3
A and B
A= $classB= $class =~ /^RPC::Serialized::X(::.+)?$/
| |||||||||||||||||||||||||||||
| 34 | unless $class and $class =~ /^RPC::Serialized::X(::.+)?$/; | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 6 | ▶ | my $message = $reply->{EXCEPTION}->{MESSAGE} || ""; | ||||||||||||||||||||||||||
|
Condition50%1/2
$reply->{'EXCEPTION'}{'MESSAGE'} || ''
MC/DC0%0/1
$reply->{'EXCEPTION'}{'MESSAGE'} || ''
$reply->{'EXCEPTION'}{'MESSAGE'}
Truth table50%1/2
A
A= $reply->{'EXCEPTION'}{'MESSAGE'}
| |||||||||||||||||||||||||||||
| 37 | 6 | $class->throw($message); | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 13 | return $reply->{RESPONSE}; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 19 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 44 | 19 | my $self = shift; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 19 | ▶ | throw_app 'Object method called on class' | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | unless ref($self); | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 19 | ( my $call = $AUTOLOAD ) =~ s/^.*:://; | |||||||||||||||||||||||||||
| 50 | 19 | $self->call( $call, @_ ); | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 15 | 1; | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||