This cluster contains two very intersting classes since they provide a framework to build multiplexing servers.
SERVER is a multiplexing server. IT can either start its
own stand-alone stack or use an existing stack. You give it an access and it listens onto it and starts
connections when a new client connects.CONNECTION is a connection started by the server
whenever a client connects. A stream connected to that client is provided.This cluster provides the main collection abstractions and their implementations. This document provides a few hints that may help choosing the most relevant data structure.
Collections are linear sequences of objects. They are traversable by either using an index (an INTEGER between lower and upper) or an iterator.
The standard library implementations are:
COLLECTION2 and COLLECTION3 provide similar facilities for two- and three-dimension object collections.
Maps provide indexed collections: access to object values using object keys.
The standard library implementations are:
Sets of objects have unique occurrences of each object. Mathematical set operators are available.
The standard library implementations are:
A repository is a collection of STORABLE objects. The aim of this structure is to make objects persistent.
The standard library implementations are:
See also: REPOSITORY_TRANSIENT to register objects that must not be persisted.
This cluster provides deferred classes that abstract out component behaviour:
Moreover, the class SMART_EIFFEL drives the compilation process. It stays in this cluster because it is so important.
Provides ACE handling and class loading algorithms, including the (in)famous "distance class loader". Let's explain how this algorithm works.
Classes are stored in clusters which are physical directories. Those clusters are organized:
In both cases, clusters are organized in a tree. The interface of this tree is CLASSES. The root instance of the tree is a direct instance of UNIVERSE, which is a singleton. Node instances of the tree are direct instances of LOADPATH. Leaf instances, i.e. the ones holding a reference to an actual cluster, are direct instances of CLASSES_TREE. Note that both inherit from CLUSTERS, and technically a CLASSES_TREE is a node that may contain other cluster nodes. In fact that's not the case but that could change of course ;-)
How do we load classes now that the tree is built?
A class is searched starting from who searches it. A "provider" class is always looked for in conjunction to its "client". We compute the distance between the client and one or more would-be provider classes having the same name, and the closest class is selected.
The distance is calculated thus:
This cluster contains all the main classes used to implement the SmartEiffel tools.
Provides all types of EXPRESSIONs.
Provides all types of INSTRUCTIONs.
Maybe one of the most important clusters. This cluster contains all the classes one should first get used to in order to understand how the compiler and the other tools work. These classes contain the core algorithms and structures used by the SmartEiffel suite.
Provides all types of RUN_FEATUREs.
Provides for all kinds of Eiffel types of entities. For example, MY_OBJECT and like my_object type markers lead to different TYPE_MARKs. Among the most frequent are:
Provides the Acyclic Visitor Design Pattern.
Most data classes are visitable; but a lot are not, when it has no sense to make them so. In this category go all the algorithm classes (tools/kernel cluster), pools, singletons, and framework classes (such as GLOBALS).
How to use the "net" cluster
This page is divided into the following sections:
Vocabulary
Be a Client
To be client means trying to reach some server and getting some data from it.
There are two concepts to grasp before making a connection:
To be a client, you have to do three things, in that order:
In Liberty Eiffel, you would write it this way:
(See also the tutorial: class
SOCKETS)Be a Server
To be a server, things are a bit more complex but not tremendously so.
First note that you must know something of the
lib/sequencercluster. You must also be familiar with agents.To create a server, start by creating an address and an access. The address will filter which connections are allowed1, and the access port will determine which port the server will listen to.
Now you must create a
SOCKET_SERVER, give it one or more agents using the`when_connect'feature. Those agents are called whenever a new client connects; each agent is given the same stream that represents the connection to the client.Note that having multiple agents is potentially dangerous. Either all the agents cooperate, either having one registered is enough. Remember that all agents share the same stream.