blib/lib/SPVM/Native/BasicType.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package SPVM::Native::BasicType;
2  
3  
4  
5 1;
6  
7 =head1 Name
8  
9 SPVM::Native::BasicType - Information of Basic Types
10  
11 =head1 Description
12  
13 The Native::BasicType class of L<SPVM> has methods to manipulate information of basic types.
14  
15 =head1 Usage
16  
17 use Native::BasicType;
18  
19 =head1 Instance Methods
20  
21 =head2 get_id
22  
23 C<method get_id : int ();>
24  
25 Returns the basic type ID.
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 basic type name.
34  
35 If a memory error occurs, an exception is thrown.
36  
37 =head2 get_class_dir
38  
39 C<method get_class_dir : string ();>
40  
41 Returns the module directory.
42  
43 If a memory error occurs, an exception is thrown.
44  
45 =head2 get_rel_file
46  
47 C<method get_rel_file : string ();>
48  
49 Returns the module relative file path.
50  
51 If a memory error occurs, an exception is thrown.
52  
53 =head2 get_parent
54  
55 C<method get_parent : L<Native::BasicType|SPVM::Native::BasicType> ();>
56  
57 Returns the parent L<Native::BasicType|SPVM::Native::BasicType> object.
58  
59 If a memory error occurs, an exception is thrown.
60  
61 =head2 get_category
62  
63 C<method get_category : int ();>
64  
65 Returns the category.
66  
67 If a memory error occurs, an exception is thrown.
68  
69 =head2 get_version_string
70  
71 C<method get_version_string : string ();>
72  
73 Returns the version string. If it is not specified, returns undef.
74  
75 If a memory error occurs, an exception is thrown.
76  
77 =head2 is_pointer
78  
79 C<method is_pointer : int ();>
80  
81 If the basic type is a pointer class, returns 1. Otherwise returns 0.
82  
83 If a memory error occurs, an exception is thrown.
84  
85 =head2 is_anon
86  
87 C<method is_anon : int ();>
88  
89 If the basic type is anon basic type, returns 1. Otherwise returns 0.
90  
91 If a memory error occurs, an exception is thrown.
92  
93 =head2 get_class_var_by_index
94  
95 C<method get_class_var_by_index : L<Native::ClassVar|SPVM::Native::ClassVar> ($class_var_index : int);>
96  
97 Gets a L<class variable|Native::ClassVar> object by an index.
98  
99 If a memory error occurs, an exception is thrown.
100  
101 =head2 get_class_var_by_name
102  
103 C<method get_class_var_by_name : L<Native::ClassVar|SPVM::Native::ClassVar> ($class_var_name : string);>
104  
105 Gets a L<class variable|Native::ClassVar> object by a name.
106  
107 If a memory error occurs, an exception is thrown.
108  
109 =head2 get_class_vars_length
110  
111 C<method get_class_vars_length : int ();>
112  
113 Gets the length of the class variables.
114  
115 If a memory error occurs, an exception is thrown.
116  
117 =head2 get_field_by_index
118  
119 C<method get_field_by_index : L<Native::Field|SPVM::Native::Field> ($field_index : int);>
120  
121 Gets a L<field|Native::Field> object by an index.
122  
123 If a memory error occurs, an exception is thrown.
124  
125 =head2 get_field_by_name
126  
127 C<method get_field_by_name : L<Native::Field|SPVM::Native::Field> ($field_name : string);>
128  
129 Gets a L<field|Native::Field> object by a name.
130  
131 If a memory error occurs, an exception is thrown.
132  
133 =head2 get_fields_length
134  
135 C<method get_fields_length : int ();>
136  
137 Gets the length of the fields.
138  
139 If a memory error occurs, an exception is thrown.
140  
141 =head2 get_method_by_index
142  
143 C<method get_method_by_index : L<Native::Method|SPVM::Native::Method> ($method_index : int);>
144  
145 Gets a L<method|Native::Method> object by an index.
146  
147 If a memory error occurs, an exception is thrown.
148  
149 =head2 get_method_by_name
150  
151 C<method get_method_by_name : L<Native::Method|SPVM::Native::Method> ($method_name : string);>
152  
153 Gets a L<method|Native::Method> object by a name.
154  
155 If a memory error occurs, an exception is thrown.
156  
157 =head2 get_methods_length
158  
159 C<method get_methods_length : int ();>
160  
161 Gets the length of the methods.
162  
163 If a memory error occurs, an exception is thrown.
164  
165 =head2 get_anon_basic_type_by_index
166  
167 C<method get_anon_basic_type_by_index : L<Native::BasicType|SPVM::Native::BasicType> ($anon_basic_type_index : int);>
168  
169 Gets a anon L<basic type|SPVM::Native::BasicType> object defined in this basic type by an index.
170  
171 If a memory error occurs, an exception is thrown.
172  
173 =head2 get_anon_basic_types_length
174  
175 C<method get_anon_basic_types_length : int ();>
176
177 Gets the length of the anon basic types defined in this basic type.
178  
179 If a memory error occurs, an exception is thrown.
180  
181 =head2 get_methods
182  
183 C<method get_methods : L<Native::Method|SPVM::Native::Method>[] ($options : object[] = undef);>
184  
185 Returns methods.
186  
187 =head2 get_fields
188  
189 C<method get_fields : L<Native::Field|SPVM::Native::Field>[] ($options : object[] = undef);>
190  
191 Returns fields.
192  
193 =head2 get_class_vars
194  
195 C<method get_class_vars : L<Native::ClassVar|SPVM::Native::ClassVar>[] ($options : object[] = undef);>
196  
197 Returns class variables.
198  
199 =head2 get_basic_type_in_version_from
200  
201 C<method get_basic_type_in_version_from : L<Native::BasicType|SPVM::Native::BasicType> ();>
202  
203 Returns the basic typeL<Native::BasicType|SPVM::Native::BasicType> object specified by C<version_from> statement.
204  
205 If a memory error occurs, an exception is thrown.
206  
207 =head2 has_monitor_var
208  
209 C<method has_monitor_var : int ();>
210  
211 If the basic type has a monitor variable C<$^MONITOR>, returns 1. Otherwise returns 0.
212  
213 If a memory error occurs, an exception is thrown.
214  
215 =head2 get_monitor_var_type
216  
217 C<method get_monitor_var_type : void ($basic_type_id_ref : int*, $type_dimension_ref : int*, $type_flag_ref : int*);>
218  
219 Gets the type information of the monitor variable C<$^MONITOR> and sets it to the references.
220  
221 The basic type ID is set to C<$basic_type_id_ref>.
222  
223 The type dimension is set to C<$type_dimension_ref>.
224  
225 The type flag is set to C<$type_flag_ref>.
226  
227 Exceptions:
228  
229 If the monitor variable is not found, an exception is thrown.
230  
231 If C<$basic_type_id_ref>, C<$type_dimension_ref>, or C<$type_flag_ref> is not defined, an exception is thrown.
232  
233 If a memory error occurs, an exception is thrown.
234  
235 =head1 Copyright & License
236  
237 Copyright (c) 2023 Yuki Kimoto
238  
239 MIT License
240