| 1 | package SPVM::Native::Arg; | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | 1; | ||
| 6 | |||
| 7 | =head1 Name | ||
| 8 | |||
| 9 | SPVM::Native::Arg - Information of Arguments | ||
| 10 | |||
| 11 | =head1 Description | ||
| 12 | |||
| 13 | The Native::Arg class of L<SPVM> has methods to manipulate information of arguments. | ||
| 14 | |||
| 15 | =head1 Usage | ||
| 16 | |||
| 17 | my $runtime = Native->get_current_runtime; | ||
| 18 | |||
| 19 | my $basic_type = $runtime->get_basic_type_by_name("Point"); | ||
| 20 | |||
| 21 | my $method = $basic_type->get_method_by_name("new"); | ||
| 22 | |||
| 23 | my $arg = $method->get_arg_by_index(0); | ||
| 24 | |||
| 25 | my $arg_index = $arg->get_index; | ||
| 26 | |||
| 27 | =head1 Instance Methods | ||
| 28 | |||
| 29 | =head2 get_index | ||
| 30 | |||
| 31 | C<method get_index : int ();> | ||
| 32 | |||
| 33 | Returns the index of this argument. | ||
| 34 | |||
| 35 | =head2 get_basic_type | ||
| 36 | |||
| 37 | C<method get_basic_type : L<Native::BasicType|SPVM::Native::BasicType> ();> | ||
| 38 | |||
| 39 | Return the L<basic type|SPVM::Native::BasicType> of this argument. | ||
| 40 | |||
| 41 | =head2 get_type_dimension | ||
| 42 | |||
| 43 | C<method get_type_dimension : int ();> | ||
| 44 | |||
| 45 | Returns the type dimension of this argument. | ||
| 46 | |||
| 47 | =head2 get_type_flag | ||
| 48 | |||
| 49 | C<method get_type_flag : int ();> | ||
| 50 | |||
| 51 | Returns the type flag of this argument. | ||
| 52 | |||
| 53 | =head2 is_optional | ||
| 54 | |||
| 55 | C<method is_optional : int ();> | ||
| 56 | |||
| 57 | If this argument is an optional argument, returns 1, otherwise returns 0. | ||
| 58 | |||
| 59 | =head2 get_default_value_byte | ||
| 60 | |||
| 61 | C<method get_default_value_byte : byte ();> | ||
| 62 | |||
| 63 | Returns the default value of the optional argument I<arg> of the C<byte> type. | ||
| 64 | |||
| 65 | =head2 get_default_value_short | ||
| 66 | |||
| 67 | C<method get_default_value_short : short ();> | ||
| 68 | |||
| 69 | Returns the default value of the optional argument I<arg> of the C<short> type. | ||
| 70 | |||
| 71 | =head2 get_default_value_int | ||
| 72 | |||
| 73 | C<method get_default_value_int : int ();> | ||
| 74 | |||
| 75 | Returns the default value of the optional argument I<arg> of the C<int> type. | ||
| 76 | |||
| 77 | =head2 get_default_value_long | ||
| 78 | |||
| 79 | C<method get_default_value_long : long ();> | ||
| 80 | |||
| 81 | Returns the default value of the optional argument I<arg> of the C<long> type. | ||
| 82 | |||
| 83 | =head2 get_default_value_float | ||
| 84 | |||
| 85 | C<method get_default_value_float : float ();> | ||
| 86 | |||
| 87 | Returns the default value of the optional argument I<arg> of the C<float> type. | ||
| 88 | |||
| 89 | =head2 get_default_value_double | ||
| 90 | |||
| 91 | C<method get_default_value_double : double ();> | ||
| 92 | |||
| 93 | Returns the default value of the optional argument I<arg> of the C<double> type. | ||
| 94 | |||
| 95 | =head2 get_default_value_object | ||
| 96 | |||
| 97 | C<method get_default_value_object : object ();> | ||
| 98 | |||
| 99 | Returns the default value of the optional argument I<arg> of an object type. | ||
| 100 | |||
| 101 | =head2 See Also | ||
| 102 | |||
| 103 | =over 2 | ||
| 104 | |||
| 105 | =item * L<Native::Method|SPVM::Native::Method> | ||
| 106 | |||
| 107 | =item * L<Native::BasicType|SPVM::Native::BasicType> | ||
| 108 | |||
| 109 | =item * L<Native::Runtime|SPVM::Native::Runtime> | ||
| 110 | |||
| 111 | =item * L<Native|SPVM::Native> | ||
| 112 | |||
| 113 | =back | ||
| 114 | |||
| 115 | =head1 Copyright & License | ||
| 116 | |||
| 117 | Copyright (c) 2023 Yuki Kimoto | ||
| 118 | |||
| 119 | MIT License | ||
| 120 |