GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
STREAM_PROTOCOL
+
Point of view
All features
ANY
RECYCLING_POOL
URL_VALIDITY
URL
All features
class STREAM_PROTOCOL
Summary
top
A protocol used for internal purposes: implementation of
STREAM
.url
Direct parents
Inherit list:
PROTOCOL
Class invariant
top
stream
/= Void
instream
/= Void implies
instream
=
stream
outstream
/= Void implies
outstream
=
stream
error /= Void implies not is_connected
Overview
top
Creation features
{
URL
}
make
(a_stream:
STREAM
)
Features
{
ANY
}
name
:
FIXED_STRING
is_connected
:
BOOLEAN
error
:
STRING
{
URL_VALIDITY
}
valid_uri
(a_uri:
STRING
):
BOOLEAN
{
URL
}
connect_to
(url:
URL
, read:
BOOLEAN
, write:
BOOLEAN
)
disconnect
input
:
INPUT_STREAM
output
:
OUTPUT_STREAM
locator
(a_uri:
STRING
):
RESOURCE_LOCATOR
PROTOCOL
is a factory of
RESOURCE_LOCATOR
recycle_locator
(a_locator:
RESOURCE_LOCATOR
)
{}
make
(a_stream:
STREAM
)
stream
:
STREAM
instream
:
INPUT_STREAM
outstream
:
OUTPUT_STREAM
{
RECYCLING_POOL
}
recycle
Do whatever needs to be done to free resources or recycle other objects when recycling this one
{}
dispose
Action to be executed just before garbage collection reclaims an object.
name
:
FIXED_STRING
effective function
{
ANY
}
top
is_connected
:
BOOLEAN
effective function
{
ANY
}
top
error
:
STRING
effective function
{
ANY
}
top
valid_uri
(a_uri:
STRING
):
BOOLEAN
effective function
{
URL_VALIDITY
}
top
connect_to
(url:
URL
, read:
BOOLEAN
, write:
BOOLEAN
)
effective procedure
{
URL
}
top
require
(
True
) or else (
url.uri /= Void
not is_connected
read or write
)
disconnect
effective procedure
{
URL
}
top
require
is_connected
ensure
not is_connected
input
:
INPUT_STREAM
effective function
{
URL
}
top
require
is_connected
output
:
OUTPUT_STREAM
effective function
{
URL
}
top
require
is_connected
locator
(a_uri:
STRING
):
RESOURCE_LOCATOR
effective function
{
URL
}
top
PROTOCOL
is a factory of
RESOURCE_LOCATOR
require
valid_uri(a_uri)
ensure
Result.uri.is_equal(a_uri)
recycle_locator
(a_locator:
RESOURCE_LOCATOR
)
effective procedure
{
URL
}
top
require
a_locator /= Void
make
(a_stream:
STREAM
)
effective procedure
{}
top
require
a_stream /= Void
stream
:
STREAM
writable attribute
{}
top
instream
:
INPUT_STREAM
writable attribute
{}
top
outstream
:
OUTPUT_STREAM
writable attribute
{}
top
recycle
effective procedure
{
RECYCLING_POOL
}
top
Do whatever needs to be done to free resources or recycle other objects when recycling this one
dispose
effective procedure
{}
top
Action to be executed just before garbage collection reclaims an object.