Name

SPVM::Native::BasicType - Information of Basic Types

Description

The Native::BasicType class of SPVM has methods to manipulate information of basic types.

Usage

use Native::BasicType;

Instance Methods

get_id

method get_id : int ();

Returns the basic type ID.

If a memory error occurs, an exception is thrown.

get_name

method get_name : string ();

Returns the basic type name.

If a memory error occurs, an exception is thrown.

get_class_dir

method get_class_dir : string ();

Returns the module directory.

If a memory error occurs, an exception is thrown.

get_rel_file

method get_rel_file : string ();

Returns the module relative file path.

If a memory error occurs, an exception is thrown.

get_parent

method get_parent : Native::BasicType ();

Returns the parent Native::BasicType object.

If a memory error occurs, an exception is thrown.

get_category

method get_category : int ();

Returns the category.

If a memory error occurs, an exception is thrown.

get_version_string

method get_version_string : string ();

Returns the version string. If it is not specified, returns undef.

If a memory error occurs, an exception is thrown.

is_pointer

method is_pointer : int ();

If the basic type is a pointer class, returns 1. Otherwise returns 0.

If a memory error occurs, an exception is thrown.

is_anon

method is_anon : int ();

If the basic type is anon basic type, returns 1. Otherwise returns 0.

If a memory error occurs, an exception is thrown.

get_class_var_by_index

method get_class_var_by_index : Native::ClassVar ($class_var_index : int);

Gets a class variable object by an index.

If a memory error occurs, an exception is thrown.

get_class_var_by_name

method get_class_var_by_name : Native::ClassVar ($class_var_name : string);

Gets a class variable object by a name.

If a memory error occurs, an exception is thrown.

get_class_vars_length

method get_class_vars_length : int ();

Gets the length of the class variables.

If a memory error occurs, an exception is thrown.

get_field_by_index

method get_field_by_index : Native::Field ($field_index : int);

Gets a field object by an index.

If a memory error occurs, an exception is thrown.

get_field_by_name

method get_field_by_name : Native::Field ($field_name : string);

Gets a field object by a name.

If a memory error occurs, an exception is thrown.

get_fields_length

method get_fields_length : int ();

Gets the length of the fields.

If a memory error occurs, an exception is thrown.

get_method_by_index

method get_method_by_index : Native::Method ($method_index : int);

Gets a method object by an index.

If a memory error occurs, an exception is thrown.

get_method_by_name

method get_method_by_name : Native::Method ($method_name : string);

Gets a method object by a name.

If a memory error occurs, an exception is thrown.

get_methods_length

method get_methods_length : int ();

Gets the length of the methods.

If a memory error occurs, an exception is thrown.

get_anon_basic_type_by_index

method get_anon_basic_type_by_index : Native::BasicType ($anon_basic_type_index : int);

Gets a anon basic type object defined in this basic type by an index.

If a memory error occurs, an exception is thrown.

get_anon_basic_types_length

method get_anon_basic_types_length : int ();

Gets the length of the anon basic types defined in this basic type.

If a memory error occurs, an exception is thrown.

get_methods

method get_methods : Native::Method[] ($options : object[] = undef);

Returns methods.

get_fields

method get_fields : Native::Field[] ($options : object[] = undef);

Returns fields.

get_class_vars

method get_class_vars : Native::ClassVar[] ($options : object[] = undef);

Returns class variables.

get_basic_type_in_version_from

method get_basic_type_in_version_from : Native::BasicType ();

Returns the basic typeNative::BasicType object specified by version_from statement.

If a memory error occurs, an exception is thrown.

has_monitor_var

method has_monitor_var : int ();

If the basic type has a monitor variable $^MONITOR, returns 1. Otherwise returns 0.

If a memory error occurs, an exception is thrown.

get_monitor_var_type

method get_monitor_var_type : void ($basic_type_id_ref : int*, $type_dimension_ref : int*, $type_flag_ref : int*);

Gets the type information of the monitor variable $^MONITOR and sets it to the references.

The basic type ID is set to $basic_type_id_ref.

The type dimension is set to $type_dimension_ref.

The type flag is set to $type_flag_ref.

Exceptions:

If the monitor variable is not found, an exception is thrown.

If $basic_type_id_ref, $type_dimension_ref, or $type_flag_ref is not defined, an exception is thrown.

If a memory error occurs, an exception is thrown.

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License