class RLTK::CG::SimpleAggregateType

{ArrayType} and {PointerType} inherit from this class so they can share a constructor.

@abstract

Public Class Methods

new(overloaded, size_or_address_space = 0) click to toggle source

Used to initialize {ArrayType ArrayTypes} and {PointerType PointerTypes}.

@param [FFI::Pointer, Type] overloaded Pointer to an existing aggregate type or a Type object that

describes the objects that will be stored in an aggregate type.
# File lib/rltk/cg/type.rb, line 283
def initialize(overloaded, size_or_address_space = 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_or_address_space)
        end
end

Public Instance Methods

element_type() click to toggle source

@return [Type] Type of objects stored inside this aggregate.

# File lib/rltk/cg/type.rb, line 297
def element_type
        @element_type ||= Type.from_ptr(Bindings.get_element_type(@ptr))
end