Oberon || Library || Module Index || Search Engine || Definition || Module

Ulm's Oberon Library:


IndirectDisciplines - shared disciplines


TYPE Object = Disciplines.Object;
TYPE ObjectRec = Disciplines.ObjectRec;
TYPE Discipline = Disciplines.Discipline;
TYPE DisciplineRec = Disciplines.DisciplineRec;
TYPE Identifier = Disciplines.Identifier;

PROCEDURE Add(object: Object; discipline: Discipline); PROCEDURE Remove(object: Object; id: Identifier); PROCEDURE Seek(object: Object; id: Identifier; VAR discipline: Discipline) : BOOLEAN; PROCEDURE Unique() : Identifier;

PROCEDURE Forward(from, to: Object);


Not all kinds of disciplines are valid only in the context of a specific object. Disciplines which carries parameter sets like StreamDisciplines, for instance, need not to be tied to one object only and are good candidates for sharing. IndirectDisciplines offers all declarations of Disciplines and is, in fact, plug-compatible. Thus, modules which don't care about the carrier of their disciplines are free to use IndirectDisciplines instead of Disciplines:
IMPORT Disciplines := IndirectDisciplines;

Forward causes all discipline related operations of IndirectDisciplines for from to be forwarded to to:

causes all disciplines to be added at to instead of from.
Remove and Seek
first check for the presence of the discipline at from, and, if not present, forward the request to to.
Transitive connections (i.e. a chain of forwarding references) are legal.

Usually Forward needs not to be called directly because IndirectDisciplines supports Forwarders, i.e. Forwarders.Forward will call Forward implicitly.

Note that, if necessary, operations of Disciplines and IndirectDisciplines may be freely intermixed because IndirectDisciplines relies upon Disciplines.


discipline operations without indirection
general forwarding mechanism

Edited by: borchert, last change: 1995/03/20, revision: 1.2, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module