indexing description: "[ Class for wrapping C int16 arrays for passing them to SDL. ]" date: "$Date$" revision: "$Revision$" class EM_INTEGER_ARRAY inherit EWG_ARRAY create make_new_unshared, make_new_shared, make_unshared, make_shared feature {ANY} -- Access item (i: INTEGER): INTEGER is -- Return `i'-th item require exists: exists valid_index: is_valid_index (i) do Result := managed_data.read_integer_16 (i * item_size) end put (v: INTEGER; i: INTEGER) is -- Replace `i'-th entry by `v' require exists: exists valid_index: is_valid_index (i) do managed_data.put_integer_16 (v, i * item_size) ensure integer_set: item (i) = v end -- copy_items (source_index, a_count, destination_index: INTEGER) is -- -- Copy `a_count' items at `source_index' to `destination_index' in `Current'. -- require -- not_overlaping: source_index + a_count <= destination_index or else destination_index + a_count <= source_index -- do -- (array_address + destination_index * item_size).memory_copy (array_address + source_index * item_size, a_count * item_size) -- end feature {NONE} -- Implementation item_size: INTEGER is -- Size in bytes. once Result := 2 end end