| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Thrift::IDL::Method; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
Thrift::IDL::Method |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Inherits from L |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
|
12
|
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
|
33
|
use strict; |
|
|
6
|
|
|
|
|
14
|
|
|
|
6
|
|
|
|
|
209
|
|
|
14
|
6
|
|
|
6
|
|
39
|
use warnings; |
|
|
6
|
|
|
|
|
15
|
|
|
|
6
|
|
|
|
|
171
|
|
|
15
|
6
|
|
|
6
|
|
33
|
use base qw(Thrift::IDL::Base); |
|
|
6
|
|
|
|
|
20
|
|
|
|
6
|
|
|
|
|
549
|
|
|
16
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(name oneway returns arguments throws service)); |
|
17
|
6
|
|
|
6
|
|
6828
|
use Data::Dumper; |
|
|
6
|
|
|
|
|
57833
|
|
|
|
6
|
|
|
|
|
2596
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 name |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 oneway |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 returns |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 arguments |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 throws |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 service |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Scalar accessors |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 fields |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Alias to C |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 field_named ($name) |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 argument_named ($name) |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 field_id ($id) |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head2 argument_id ($id) |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Returns object found in named array with given key value |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# Having similarly named functions as Structs allows us to be processed similarly |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub fields { |
|
54
|
2
|
|
|
2
|
1
|
35
|
my $self = shift; |
|
55
|
2
|
|
|
|
|
16
|
$self->arguments(@_); |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub field_named { |
|
59
|
8
|
|
|
8
|
1
|
3799
|
my ($self, $name) = @_; |
|
60
|
8
|
|
|
|
|
90
|
$self->array_search($name, 'arguments', 'name'); |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
*argument_named = \&field_named; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub field_id { |
|
65
|
3
|
|
|
3
|
1
|
825
|
my ($self, $name) = @_; |
|
66
|
3
|
|
|
|
|
18
|
$self->array_search($name, 'arguments', 'id'); |
|
67
|
|
|
|
|
|
|
} |
|
68
|
|
|
|
|
|
|
*argument_id = \&field_id; |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 setup |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
A method C and C has children of type L and L. Walk through all these children and associate the comments with the fields that preceeded them (if perl style) or with the field following. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub setup { |
|
77
|
11
|
|
|
11
|
1
|
34
|
my $self = shift; |
|
78
|
11
|
|
|
|
|
54
|
foreach my $children_key (qw(arguments throws)) { |
|
79
|
22
|
|
|
|
|
308
|
$self->_setup($children_key); |
|
80
|
|
|
|
|
|
|
} |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub to_str { |
|
84
|
6
|
|
|
6
|
0
|
15
|
my ($self) = @_; |
|
85
|
|
|
|
|
|
|
|
|
86
|
6
|
|
|
|
|
73
|
return sprintf '%s (%s)', |
|
87
|
|
|
|
|
|
|
$self->name, |
|
88
|
|
|
|
|
|
|
join(', ', |
|
89
|
12
|
|
|
|
|
146
|
map { $_ .': '. $self->$_ } |
|
90
|
6
|
|
|
|
|
24
|
grep { defined $self->$_ } |
|
91
|
|
|
|
|
|
|
qw(returns oneway) |
|
92
|
|
|
|
|
|
|
); |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
1; |