Class: FFI::Clang::Types::Vector

Inherits:
Type
  • Object
show all
Defined in:
lib/ffi/clang/types/vector.rb

Overview

Represents a vector type (SIMD vector). Vector types are used for SIMD operations and have a fixed number of elements of the same type.

Instance Attribute Summary

Attributes inherited from Type

#translation_unit, #type

Instance Method Summary collapse

Methods inherited from Type

#==, #address_space, #alignof, #canonical, #const_qualified?, #copy_assignable?, #copyable?, create, #declaration, #fqn_elaborated, #fqn_impl, #fqn_pointer, #fqn_record, #fqn_template_args, #fully_qualified_name, #initialize, #intrinsic_type, #kind, #kind_spelling, #modified_type, #non_reference_type, #nullability, #num_template_arguments, #parse_template_args_from_spelling, #pod?, #pretty_printed, #ref_qualifier, #reference?, #restrict_qualified?, #sizeof, #spelling, #template_argument_type, #to_s, #transparent_tag_typedef?, #typedef_name, #unqualified_type, #value_type, #visit_base_classes, #visit_fields, #visit_methods, #volatile_qualified?

Constructor Details

This class inherits a constructor from FFI::Clang::Types::Type

Instance Method Details

#element_typeObject

Get the element type of this vector.



15
16
17
# File 'lib/ffi/clang/types/vector.rb', line 15

def element_type
	Type.create Lib.get_element_type(@type), @translation_unit
end

#sizeObject

Get the number of elements in this vector.



21
22
23
# File 'lib/ffi/clang/types/vector.rb', line 21

def size
	Lib.get_num_elements(@type)
end