indexing
description: "A data packet for sending and receiving on a socket."
status: "See notice at end of class"
date: "$Date$"
revision: "$Revision$"
class interface
PACKET
create
make (size: INTEGER)
require
valid_size: size >= 0
feature
make (size: INTEGER)
require
valid_size: size >= 0
feature
data: SPECIAL [CHARACTER]
TO_SPECIAL
element (pos: INTEGER): CHARACTER
pos
require
pos_valid: valid_position (pos)
feature
count: INTEGER
feature
is_equal (other: like Current): BOOLEAN
other
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
feature
valid_position (pos: INTEGER): BOOLEAN
pos
feature
put_element (an_item: CHARACTER; pos: INTEGER)
an_itempos
require
pos_valid: valid_position (pos)
feature
copy (other: like Current)
other
clone
require ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
ensure then
size_valid: count = other.count
invariant
data_not_equal_void: data /= void
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- PACKET