| 1 | package SPVM::Native::Method; | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | 1; | ||
| 6 | |||
| 7 | =head1 Name | ||
| 8 | |||
| 9 | SPVM::Native::Method - Information of Methods | ||
| 10 | |||
| 11 | =head1 Description | ||
| 12 | |||
| 13 | The Native::Method class of L<SPVM> has methods to manipulate information of methods. | ||
| 14 | |||
| 15 | =head1 Usage | ||
| 16 | |||
| 17 | use Native::Method; | ||
| 18 | |||
| 19 | =head1 Instance Methods | ||
| 20 | |||
| 21 | =head2 get_index | ||
| 22 | |||
| 23 | C<method get_index : int ();> | ||
| 24 | |||
| 25 | Returns the index. | ||
| 26 | |||
| 27 | If a memory error occurs, an exception is thrown. | ||
| 28 | |||
| 29 | =head2 get_name | ||
| 30 | |||
| 31 | C<method get_name : string ();> | ||
| 32 | |||
| 33 | Returns the name. | ||
| 34 | |||
| 35 | If a memory error occurs, an exception is thrown. | ||
| 36 | |||
| 37 | =head2 get_return_basic_type | ||
| 38 | |||
| 39 | C<method get_return_basic_type : L<Native::BasicType|SPVM::Native::BasicType> ();> | ||
| 40 | |||
| 41 | Returns L<Native::BasicType|SPVM::Native::BasicType> object of the return value. | ||
| 42 | |||
| 43 | If a memory error occurs, an exception is thrown. | ||
| 44 | |||
| 45 | =head2 get_return_type_dimension | ||
| 46 | |||
| 47 | C<method get_return_type_dimension : int ();> | ||
| 48 | |||
| 49 | Returns the type dimension of the return value. | ||
| 50 | |||
| 51 | If a memory error occurs, an exception is thrown. | ||
| 52 | |||
| 53 | =head2 get_return_type_flag | ||
| 54 | |||
| 55 | C<method get_return_type_flag : int ();> | ||
| 56 | |||
| 57 | Returns the type flag of the return value. | ||
| 58 | |||
| 59 | If a memory error occurs, an exception is thrown. | ||
| 60 | |||
| 61 | =head2 get_current_basic_type | ||
| 62 | |||
| 63 | C<method get_current_basic_type : L<Native::BasicType|SPVM::Native::BasicType> ();> | ||
| 64 | |||
| 65 | Returns the current L<Native::BasicType|SPVM::Native::BasicType> object that defines this method. | ||
| 66 | |||
| 67 | If a memory error occurs, an exception is thrown. | ||
| 68 | |||
| 69 | =head2 get_arg_by_index | ||
| 70 | |||
| 71 | C<method get_arg_by_index : L<Native::Arg|SPVM::Native::Arg> ($arg_index : int);> | ||
| 72 | |||
| 73 | Gets a L<arg|Native::Arg> object by an index, and returns it. | ||
| 74 | |||
| 75 | If a memory error occurs, an exception is thrown. | ||
| 76 | |||
| 77 | =head2 get_args_length | ||
| 78 | |||
| 79 | C<method get_args_length : int ();> | ||
| 80 | |||
| 81 | Returns the length of the arguments. | ||
| 82 | |||
| 83 | If a memory error occurs, an exception is thrown. | ||
| 84 | |||
| 85 | =head2 get_required_args_length | ||
| 86 | |||
| 87 | C<method get_required_args_length : int ();> | ||
| 88 | |||
| 89 | Returns the length of the required arguments. | ||
| 90 | |||
| 91 | If a memory error occurs, an exception is thrown. | ||
| 92 | |||
| 93 | =head2 is_class_method | ||
| 94 | |||
| 95 | C<method is_class_method : int ();> | ||
| 96 | |||
| 97 | If the method is class method, returns 1. Otherwise returns 0. | ||
| 98 | |||
| 99 | If a memory error occurs, an exception is thrown. | ||
| 100 | |||
| 101 | =head2 is_anon | ||
| 102 | |||
| 103 | C<method is_anon : int ();> | ||
| 104 | |||
| 105 | If the method is anon method, returns 1. Otherwise returns 0. | ||
| 106 | |||
| 107 | If a memory error occurs, an exception is thrown. | ||
| 108 | |||
| 109 | =head2 is_native | ||
| 110 | |||
| 111 | C<method is_native : int ();> | ||
| 112 | |||
| 113 | If the method is native method, returns 1. Otherwise returns 0. | ||
| 114 | |||
| 115 | If a memory error occurs, an exception is thrown. | ||
| 116 | |||
| 117 | =head2 is_precompile | ||
| 118 | |||
| 119 | C<method is_precompile : int ();> | ||
| 120 | |||
| 121 | If the method is precompiled method, returns 1. Otherwise returns 0. | ||
| 122 | |||
| 123 | If a memory error occurs, an exception is thrown. | ||
| 124 | |||
| 125 | =head2 is_enum | ||
| 126 | |||
| 127 | C<method is_enum : int ();> | ||
| 128 | |||
| 129 | If the method is enumeration, returns 1. Otherwise returns 0. | ||
| 130 | |||
| 131 | If a memory error occurs, an exception is thrown. | ||
| 132 | |||
| 133 | =head2 get_native_address | ||
| 134 | |||
| 135 | C<method get_native_address : L<Address|SPVM::Address> ();> | ||
| 136 | |||
| 137 | Gets the native L<address|SPVM::Address>. | ||
| 138 | |||
| 139 | If a memory error occurs, an exception is thrown. | ||
| 140 | |||
| 141 | =head2 set_native_address | ||
| 142 | |||
| 143 | C<method set_native_address : void ($address : L<Address|SPVM::Address>);> | ||
| 144 | |||
| 145 | Sets the native L<address|SPVM::Address>. | ||
| 146 | |||
| 147 | If a memory error occurs, an exception is thrown. | ||
| 148 | |||
| 149 | =head2 get_precompile_address | ||
| 150 | |||
| 151 | C<method get_precompile_address : L<Address|SPVM::Address> ();> | ||
| 152 | |||
| 153 | Gets the precompiled L<address|SPVM::Address>. | ||
| 154 | |||
| 155 | If a memory error occurs, an exception is thrown. | ||
| 156 | |||
| 157 | =head2 set_precompile_address | ||
| 158 | |||
| 159 | C<method set_precompile_address : void ($address : L<Address|SPVM::Address>);> | ||
| 160 | |||
| 161 | Sets the precompiled L<address|SPVM::Address>. | ||
| 162 | |||
| 163 | If a memory error occurs, an exception is thrown. | ||
| 164 | |||
| 165 | =head2 is_precompile_fallback | ||
| 166 | |||
| 167 | C<method is_precompile_fallback : int ();> | ||
| 168 | |||
| 169 | Gets the C<is_precompile_fallback>. | ||
| 170 | |||
| 171 | =head2 set_is_precompile_fallback | ||
| 172 | |||
| 173 | C<method set_is_precompile_fallback : void ($is_precompile_fallback : int);> | ||
| 174 | |||
| 175 | Sets the C<is_precompile_fallback>. | ||
| 176 | |||
| 177 | =head2 get_args_signature | ||
| 178 | |||
| 179 | C<method get_args_signature : string ();> | ||
| 180 | |||
| 181 | Returns the arguments signature. | ||
| 182 | |||
| 183 | If a memory error occurs, an exception is thrown. | ||
| 184 | |||
| 185 | =head1 Copyright & License | ||
| 186 | |||
| 187 | Copyright (c) 2023 Yuki Kimoto | ||
| 188 | |||
| 189 | MIT License | ||
| 190 |