redef type SELF
Type of this instance, automatically specialized in every class
A common use case of the virtual type
SELF is to type an attribute and
store another instance of the same type as
self. It can also be used as as
return type to a method producing a copy of
self or returning an instance
expected to be the exact same type as self.
This virtual type must be used with caution as it can hinder specialization.
In fact, it imposes strict restrictions on all sub-classes and their usage.
For example, using
SELF as a return type of a method
forces all subclasses to ensure that
foo returns the correct and updated
A dangerous usage take the form of a method typed by
SELF which creates
and returns a new instance.
If not correctly specialized, this method would break when invoked on a
A general rule for safe usage of
SELF is to ensure that inputs typed
SELF are stored in attributes typed
SELF and returned by methods typed
SELF, pretty much the same things as you would do with parameter types.
- core::kernel::Object: The root of the class hierarchy.
- core::stream::Stream: Any kind of stream to read/write/both to or from a source
- binary::binary::BinaryStream: A stream of binary data
- core::stream::Reader: A
Streamthat can be read from
Readercapable of declaring if readable without blocking
- pnacl::pnacl::PnaclStream: A stream for PNaCl, redefines basic input and output methods.
fun check_message: CString
Checks if there is a message in the queue, and if so the message is handled automatically.
redef fun end_reached
protected fun end_reached=(end_reached: Bool)
redef fun eof
Is there something to read.
This function returns 'false' if there is something to read.