Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Architecture = POINTER TO ArchitectureRec; TYPE ArchitectureRec = RECORD (PersistentDisciplines.ObjectRec) class: ConstStrings.String; variant: ConstStrings.String; vendor: ConstStrings.String; model: ConstStrings.String; os, osrelease: ConstStrings.String; END;
VAR system: Architecture;
PROCEDURE Create(VAR arch: Architecture; class: ARRAY OF CHAR); PROCEDURE CreateCopy(VAR arch: Architecture; orig: Architecture); PROCEDURE Compatible(arch1, arch2: Architecture; VAR combined: Architecture) : BOOLEAN; PROCEDURE Identical(arch1, arch2: Architecture) : BOOLEAN; PROCEDURE GetString(arch: Architecture; VAR string: ConstStrings.String); PROCEDURE GetArch(string: ConstStrings.String; VAR arch: Architecture);
Note that objects of type Architectures.Architecture are persistent and may have persistent disciplines attached to it.
Create creates an architecture specification of the given class. Further components that need to be specified should initialized shortly thereafter preferably by using ConstStrings.Create. Note, however, that thereafter architectures should be treated as constants, i.e. they must not be modified. Instead CreateCopy allows to create a copy of an architecture that may be changed shortly thereafter.
Compatible returns TRUE if arch1 and arch2 are compatible to each other that means that either the set of architectures defined by arch1 includes those of arch2 or vice versa. Compatible sets on success combined to the intersection of both architecture sets. Identical returns TRUE if arch1 and arch2 are identical.
Architectures may be converted from oder to strings using following EBNF grammar:
ArchString = Hardware [ ";" Model ] [ "-" Software ] . Hardware = Class [ ":" [ Variant ] [ ":" Vendor ] ] . Model = AlphaNum . Software = OS [ ":" Release ] . Class = AlphaNum . Variant = AlphaNum . Vendor = AlphaNum . OS = AlphaNum . Release = AlphaNum .GetString creates a constant string representing arch. GetArch reconstructs an architecture object from string which is set to NIL in case of syntax errors.
The architectural information of the current system can be made available through system if a module that is familiar with the current architecture was loaded to retrieve these informations.
Oberon || Library || Module Index || Search Engine || Definition || Module