class RLTK::CG::VectorType
A type used to represent vector operations (SIMD). This is NOT an aggregate type.
Public Class Methods
new(overloaded, size = 0)
click to toggle source
Create a new vector type from a pointer or a type.
@param [FFI::Pointer, Type] overloaded Pointer to existing vector type or Type
of object stored in the vector. @param [Integer] size Number of objects in this vector type.
# File lib/rltk/cg/type.rb, line 326 def initialize(overloaded, size = 0) @ptr = case overloaded when FFI::Pointer overloaded else @element_type = check_cg_type(overloaded, Type, 'overloaded') bname = Bindings.get_bname(self.class.short_name) Bindings.send(bname, @element_type, size) end end
Public Instance Methods
element_type()
click to toggle source
@return [Type] Type
of object stored inside this vector.
# File lib/rltk/cg/type.rb, line 340 def element_type @element_type ||= Type.from_ptr(Bindings.get_element_type(@ptr)) end
size()
click to toggle source
@return [Integer] Number of objects in this vector type.
# File lib/rltk/cg/type.rb, line 345 def size Bindings.get_vector_size(@ptr) end
Also aliased as: length