line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::WAMP::Base::Message; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
321
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
17
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
291
|
use Net::WAMP::Messages (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use constant NUMERIC => (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
37
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
3
|
use constant HAS_AUXILIARY => 0; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
437
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
8
|
|
|
8
|
0
|
9029
|
my ($class, @args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
8
|
|
|
|
|
29
|
my @parts = $class->PARTS(); |
16
|
|
|
|
|
|
|
|
17
|
8
|
|
|
|
|
15
|
my $self = { map { ( "_$parts[$_]" => $args[$_] ) } 0 .. $#args }; |
|
22
|
|
|
|
|
46
|
|
18
|
|
|
|
|
|
|
|
19
|
8
|
100
|
50
|
|
|
45
|
$self->{'_Auxiliary'} ||= {} if $class->HAS_AUXILIARY(); |
20
|
|
|
|
|
|
|
|
21
|
8
|
|
|
|
|
25
|
return bless $self, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub get { |
25
|
13
|
|
|
13
|
0
|
10193
|
my ($self, $key) = @_; |
26
|
|
|
|
|
|
|
|
27
|
13
|
100
|
33
|
|
|
26
|
if (grep { $_ eq $key } $self->PARTS()) { |
|
50
|
50
|
|
|
|
72
|
|
28
|
12
|
|
|
|
|
50
|
return $self->{"_$key"}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
elsif ( $key eq 'Options' or $key eq 'Details' ) { |
31
|
1
|
|
|
|
|
3
|
return $self->{'_Auxiliary'}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
0
|
my $name = $self->get_type(); |
35
|
0
|
|
|
|
|
0
|
die "Unrecognized attribute of “$name” message: “$key”"; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub get_type { |
39
|
10
|
|
|
10
|
0
|
11
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
10
|
50
|
|
|
|
46
|
ref($self) =~ m<.+::(.+)> or die "module name ($self)??"; |
42
|
|
|
|
|
|
|
|
43
|
10
|
|
|
|
|
46
|
return $1; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#Leaving this undocumented since there’s no good reason to want to |
47
|
|
|
|
|
|
|
#use it from an application. (Right?) |
48
|
|
|
|
|
|
|
sub to_unblessed { |
49
|
4
|
|
|
4
|
0
|
4
|
my ($self) = @_; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
#So that our serializer will send these correctly. |
52
|
|
|
|
|
|
|
#Other languages actually care about the difference...:-/ |
53
|
4
|
|
|
|
|
21
|
for my $num_label ( $self->NUMERIC() ) { |
54
|
3
|
|
|
|
|
12
|
$self->{"_$num_label"} += 0; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my @msg = ( |
58
|
|
|
|
|
|
|
Net::WAMP::Messages::get_type_number( $self->get_type() ), |
59
|
4
|
50
|
|
|
|
13
|
( map { exists($self->{"_$_"}) ? $self->{"_$_"} : () } $self->PARTS() ), |
|
11
|
|
|
|
|
34
|
|
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
|
62
|
4
|
|
|
|
|
18
|
return \@msg; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |