line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# You may distribute under the terms of either the GNU General Public License |
2
|
|
|
|
|
|
|
# or the Artistic License (the same terms as Perl itself) |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (C) Paul Evans, 2011-2022 -- leonerd@leonerd.org.uk |
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
212
|
use v5.26; |
|
15
|
|
|
|
|
56
|
|
7
|
15
|
|
|
15
|
|
100
|
use Object::Pad 0.70 ':experimental(adjust_params)'; |
|
15
|
|
|
|
|
190
|
|
|
15
|
|
|
|
|
80
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Tangence::Meta::Method 0.30; |
10
|
|
|
|
|
|
|
class Tangence::Meta::Method :strict(params); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
C - structure representing one C method |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This data structure object stores information about one L class |
19
|
|
|
|
|
|
|
method. Once constructed, such objects are immutable. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$method = Tangence::Meta::Method->new( %args ) |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Returns a new instance initialised by the given arguments. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=over 8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=item class => Tangence::Meta::Class |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Reference to the containing class |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item name => STRING |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Name of the method |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=item arguments => ARRAY |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Optional ARRAY reference containing arguments as |
46
|
|
|
|
|
|
|
L references. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item ret => STRING |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Optional string giving the return value type as a L |
51
|
|
|
|
|
|
|
reference |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=back |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
1
|
1
|
833
|
field $class :param :weak :reader; |
|
1
|
|
|
|
|
5
|
|
58
|
4
|
|
|
4
|
1
|
1371
|
field $name :param :reader; |
|
4
|
|
|
|
|
24
|
|
59
|
|
|
|
|
|
|
field @arguments; |
60
|
62
|
|
|
62
|
1
|
135
|
field $ret :param :reader; |
|
62
|
|
|
|
|
289
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
ADJUST :params ( |
63
|
|
|
|
|
|
|
:$arguments = undef, |
64
|
|
|
|
|
|
|
) { |
65
|
|
|
|
|
|
|
@arguments = $arguments->@* if $arguments; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 ACCESSORS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head2 class |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
$class = $method->class |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Returns the class the method is a member of |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 name |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
$name = $method->name |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Returns the name of the class |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 arguments |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
@arguments = $method->arguments |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Return the arguments in a list of L references. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=cut |
95
|
|
|
|
|
|
|
|
96
|
29
|
|
|
29
|
1
|
82
|
method arguments { @arguments } |
|
29
|
|
|
|
|
101
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 argtype |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
@argtypes = $method->argtypes |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Return the argument types in a list of L references. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
method argtypes |
107
|
11
|
|
|
11
|
0
|
34
|
{ |
108
|
11
|
|
|
|
|
27
|
return map { $_->type } @arguments; |
|
17
|
|
|
|
|
51
|
|
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 ret |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
$ret = $method->ret |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Returns the return type as a L reference or C if |
116
|
|
|
|
|
|
|
the method does not return a value. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 AUTHOR |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Paul Evans |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=cut |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
0x55AA; |