class RCGTK::ConstantAggregate

All constant aggregate values inherit from this class.

@abstract

Public Instance Methods

extract(*indices) click to toggle source

Extract values from a constant aggregate value.

@param [Array<Value>] indices Array of values representing indices into the aggregate.

@return [ConstantExpr] Extracted values.

# File lib/rcgtk/value.rb, line 381
def extract(*indices)
        indices_ptr = FFI::MemoryPointer.new(:uint, indices.length)
        indices_ptr.write_array_of_uint(indices)

        ConstantExpr.new(Bindings.const_extract_value(@ptr, indices_ptr, indices.length))
end
insert(value, indices) click to toggle source

Insert values into a constant aggregate value.

@param [Value] value Value to insert. @param [Array<Value>] indices Array of values representing indices into the aggregate.

@return [ConstantExpr] New aggregate representation with inserted values.

# File lib/rcgtk/value.rb, line 394
def insert(value, indices)
        indices_ptr = FFI::MemoryPointer.new(:uint, indices.length)
        indices_ptr.write_array_of_uint(indices)

        ConstantExpr.new(Bindings.const_insert_value(@ptr, value, indices_ptr, inicies.length))
end