Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.network.multiplayer

Class EM_NET_SERIALIZER


Direct ancestors

EM_NETWORK_HELPER_FUNCTIONS, EM_FUNCTIONS, KL_STRING_OUTPUT_STREAM

Creation

Features

Invariants

indexing

description

The EM network serializer.

date

$Date: 2005/10/26 12:17:56 $

revision

$Revision: 1.11 $

class

EM_NET_SERIALIZER

inherit

KL_STRING_OUTPUT_STREAM

create

make (a_string: STRING)

-- Create output to an existing string.

-- (From KL_STRING_OUTPUT_STREAM)

require
a_string_not_void: a_string /= Void
ensure
string_set: string = a_string
make_empty

-- Create string for output.

-- (From KL_STRING_OUTPUT_STREAM)

ensure
empty: string.count = 0

feature -- Access

string_: KL_STRING_ROUTINES

-- Routines that ought to be in class STRING

-- (From KL_IMPORTED_STRING_ROUTINES)

ensure
string_routines_not_void: Result /= Void
eol: STRING

-- Line separator

-- (From KI_TEXT_OUTPUT_STREAM)

ensure
eol_not_void: Result /= Void
eol_not_empty: Result.count > 0
name: STRING

-- Name of output stream

-- (From KI_OUTPUT_STREAM)

ensure
name_not_void: Result /= Void
string: STRING

-- String into which the output is stored

-- (From KL_STRING_OUTPUT_STREAM)

feature -- Status report

is_closable: BOOLEAN

-- Can current output stream be closed?

-- (From KI_OUTPUT_STREAM)

ensure
is_open: Result implies is_open_write
is_open_write: BOOLEAN

-- Can characters be written to output stream?

-- (From KI_OUTPUT_STREAM)

feature -- Basic operations

close

-- Try to close output stream if it is closable. Set
-- is_open_write to false if operation was successful.

-- (From KI_OUTPUT_STREAM)

require
is_closable: is_closable
flush

-- Do nothing (operation does not apply to string).

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write

feature -- Integer operation

put_integer (an_i: INTEGER)

-- Put an integer (32 bits) to the stream in network byte order.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_integer_16 (an_i: INTEGER_16)

-- Put an short integer (16 bits) to the stream in network byte order

put_integer_8 (an_i: INTEGER_8)

-- Put a byte (8 bits) to the stream in network byte order.

feature -- Real operation

put_real (r: REAL)

-- Put a real to the stream.

feature -- Setting

set_string (a_string: STRING)

-- Set string to a_string.

-- (From KL_STRING_OUTPUT_STREAM)

require
a_string_not_void: a_string /= Void
ensure
string_set: string = a_string

feature -- Output

append (an_input_stream: KI_INPUT_STREAM [CHARACTER])

-- Read items of an_input_stream until the end
-- of input is reached, and write these items to
-- current output stream.

-- (From KI_OUTPUT_STREAM)

require
is_open_write: is_open_write
an_input_stream_not_void: an_input_stream /= Void
an_input_stream_open_read: an_input_stream.is_open_read
ensure
end_of_input: an_input_stream.end_of_input
put_boolean (b: BOOLEAN)

-- Write "True" to output stream if
-- b is true, "False" otherwise.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_character (c: CHARACTER)

-- Write c to output stream.

-- (From KI_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_line (a_string: STRING)

-- Write a_string to output stream
-- followed by a line separator.

-- (From KI_TEXT_OUTPUT_STREAM)

require
is_open_write: is_open_write
a_string_not_void: a_string /= Void
put_new_line

-- Write a line separator to output stream.

-- (From KI_TEXT_OUTPUT_STREAM)

require
is_open_write: is_open_write
put_string (a_string: STRING)

-- Write a_string to output stream.
-- Note: If a_string is a UC_STRING or descendant, then
-- write the bytes of its associated UTF unicode encoding.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
a_string_not_void: a_string /= Void
put_substring (a_string: STRING; s, e: INTEGER)

-- Write substring of a_string between indexes
-- s and e to output stream.

-- (From KI_CHARACTER_OUTPUT_STREAM)

require
is_open_write: is_open_write
a_string_not_void: a_string /= Void
s_large_enough: s >= 1
e_small_enough: e <= a_string.count
valid_interval: s <= e + 1

invariant


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

string_not_void: string /= Void

end