« blib/lib/SPVM/Document/NativeAPI/StringBuffer.pm
↑ Summary
blib/lib/SPVM/Document/NativeClass.pm »
| 1 | =head1 Name | ||
| 2 | |||
| 3 | SPVM::Document::NativeAPI::Type - Type Native APIs | ||
| 4 | |||
| 5 | =head1 Description | ||
| 6 | |||
| 7 | The type native APIs in L<SPVM> are the APIs to get type information. | ||
| 8 | |||
| 9 | =head1 Usage | ||
| 10 | |||
| 11 | SPVM_API_TYPE* api_type = env->api->type; | ||
| 12 | |||
| 13 | =head1 Native APIs | ||
| 14 | |||
| 15 | =head2 can_assign | ||
| 16 | |||
| 17 | C<int32_t (*can_assign)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* dist_basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t dist_type_dimension, int32_t dist_type_flag, L<SPVM_NATIVE_BASIC_TYPE* src_basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t src_type_dimension, int32_t src_type_flag);> | ||
| 18 | |||
| 19 | If the source type given by I<src_basic_type>, I<src_type_dimension>, and I<src_type_flag> can be assigned to the dist type given by I<dist_basic_type>, I<dist_type_dimension>, and I<dist_type_flag> , returns 1, otherwise returns 0. | ||
| 20 | |||
| 21 | =head2 get_type_width | ||
| 22 | |||
| 23 | C<int32_t (*get_type_width)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 24 | |||
| 25 | Returns the L<type width|SPVM::Document::Language::Types/"Type Width"> of the type given by I<basic_type>, I<type_dimension>, and I<type_flag>. | ||
| 26 | |||
| 27 | =head2 is_object_type | ||
| 28 | |||
| 29 | C<int32_t (*is_object_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 30 | |||
| 31 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is an object type, returns 1, otherwise returns 0. | ||
| 32 | |||
| 33 | =head2 is_any_object_type | ||
| 34 | |||
| 35 | C<int32_t (*is_any_object_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 36 | |||
| 37 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is the any object type C<object>, returns 1, otherwise returns 0. | ||
| 38 | |||
| 39 | =head2 is_object_array_type | ||
| 40 | |||
| 41 | C<int32_t (*is_object_array_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 42 | |||
| 43 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is an object array type, returns 1, otherwise returns 0. | ||
| 44 | |||
| 45 | =head2 is_any_object_array_type | ||
| 46 | |||
| 47 | C<int32_t (*is_any_object_array_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 48 | |||
| 49 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is any object array type C<object[]>, returns 1, otherwise returns 0. | ||
| 50 | |||
| 51 | =head2 is_numeric_type | ||
| 52 | |||
| 53 | C<int32_t (*is_numeric_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 54 | |||
| 55 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is a numeric type, returns 1, otherwise returns 0. | ||
| 56 | |||
| 57 | =head2 is_class_type | ||
| 58 | |||
| 59 | C<int32_t (*is_class_type)(L<SPVM_NATIVE_RUNTIME* runtime|SPVM::Document::NativeAPI::Runtime>, L<SPVM_NATIVE_BASIC_TYPE* basic_type|SPVM::Document::NativeAPI::BasicType>, int32_t type_dimension, int32_t type_flag);> | ||
| 60 | |||
| 61 | If the type given by I<basic_type>, I<type_dimension>, and I<type_flag> is a class type, returns 1, otherwise returns 0. | ||
| 62 | |||
| 63 | =head1 Native API IDs | ||
| 64 | |||
| 65 | 0 can_assign | ||
| 66 | 1 get_type_width | ||
| 67 | 2 is_object_type | ||
| 68 | 3 is_any_object_type | ||
| 69 | 4 is_object_array_type | ||
| 70 | 5 is_any_object_array_type | ||
| 71 | 6 is_numeric_type | ||
| 72 | 7 is_class_type | ||
| 73 | |||
| 74 | =head1 See Also | ||
| 75 | |||
| 76 | =over 2 | ||
| 77 | |||
| 78 | =item * L<SPVM::Document::NativeAPI> | ||
| 79 | |||
| 80 | =item * L<SPVM::Document::NativeAPI::BasicType> | ||
| 81 | |||
| 82 | =item * L<SPVM::Document::NativeClass> | ||
| 83 | |||
| 84 | =item * L<SPVM::Document> | ||
| 85 | |||
| 86 | =back | ||
| 87 | |||
| 88 | =head1 Copyright & License | ||
| 89 | |||
| 90 | Copyright (c) 2023 Yuki Kimoto | ||
| 91 | |||
| 92 | MIT License |