INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "Fixed array for WEL_STRUCTURE. Used internally by WEL. ", "WEL: library of reusable components for Eiffel. ", "Based on WEL library for ISE Eiffel, used with permission. "
project: "Windows Eiffel Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
cluster: wel
class WEL_ARRAY [G -> WEL_STRUCTURE]
inherit

WEL_STRUCTURE
rename
make as structure_make
end
creation

make
feature {NONE}-- Initialization

make (a_count, an_item_size: INTEGER)
-- Create a fixed array.
-- `a_count' specifies the number of items and
-- `an_item_size' specifies the item_size of an item.
require
positive_count: a_count >= 0
positive_item_size: an_item_size >= 0
ensure
count_set: count = a_count
item_size_set: item_size = an_item_size
feature -- Element change

put (an_item: G; index: INTEGER)
-- Put `an_item' at zero based index `index'.
require
an_item_not_void: an_item /= void
valid_item_size: item_size = an_item.structure_size
index_large_enough: index >= 0
index_small_enpugh: index < count

i_th_item (index: INTEGER): POINTER
-- Retrieve the pointer at the zero-based `index'.
require
index_large_enough: index >= 0
index_small_enpugh: index < count
feature -- Measurement

count: INTEGER

item_size: INTEGER

structure_size: INTEGER
-- Size of the array (in bytes)
invariant

positive_count: count >= 0
positive_item_size: item_size >= 0
end -- class WEL_ARRAY

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES