Difference between revisions of "Lib/abilities"

From Liberty Eiffel Wiki
Jump to navigation Jump to search
m (6 revisions: initial import from SamrtEiffel Wiki - The Grand SmartEiffel Book)
 
Line 1: Line 1:
[[Category:Book]]
+
[[Category:Smarteiffel]]
   
 
This essential library brings together abstract classes that allow to grant certain ''properties'' to objects.
 
This essential library brings together abstract classes that allow to grant certain ''properties'' to objects.

Revision as of 22:11, 4 March 2013


This essential library brings together abstract classes that allow to grant certain properties to objects.

COMPARABLE

Sort objects by increasing order. This class supplies comparison features <, >, <=, >= etc. One of them is deferred (<), the others are built using that one.

Identically, the is_equal feature is redefined as being a comparison of two objects where one is neither lower nor greater than the other.

Specifically, this class allows to define numbers (see the lib/numeric library), to sort collections (see the lib/sorting library), or to store dictionaries and sets (with AVL trees, see the lib/storage library).

DISPOSABLE

Memory management. This class supplies the dispose feature that is called when the object is freed by the garbage collector.

HASHABLE

Define a hash key. This class fournit la fonction déferrée hash_code et force la redéfinition de is_equal comme devant impliquer l'égalité des clés de hashage.

OBSERVABLE

This class is used with the observer design pattern. An instance of this class is in charge of notifying its attached observers each time a modification of the instance happens, by using the notify feature.

STORABLE

Serializing objects. This class only allows to mark the kind of the objects storable in a repository (see the lib/storage library).

TRAVERSABLE

Look through a set of objects. It is the read part of a collection (see the lib/storage library).

It can be used in two different ways: either directly (by using lower, upper and item), either by using an iterator.

VISITABLE

This class is used with the visitor design pattern. An instance of this class must implement the accept feature.