381cca7907670fe4565ad135eae331d52aa6319d
12 * Storable extensible data types like Views.View or TextModels.Text are derived from Store.
13 * Stores are typically allocated by suitable directories, e.g., Views.Directory or TextModels.Directory.
14 * Stores are used as base types for all objects that must be both extensible and persistent.
18 static const SHORTCHAR NEWBASE
= 0xF0; // (* new base type (level = 0), i.e. not yet in dict *)
19 static const SHORTCHAR NEWEXT
= 0xF1; // (* new extension type (level = 1), i.e. not yet in dict *)
20 static const SHORTCHAR OLDTYPE
= 0xF2; // (* old type, i.e. already in dict *)
21 static const SHORTCHAR NIL
= 0x80; // (* nil store *)
22 static const SHORTCHAR LINK
= 0x81; // (* link to another elem in same file *)
23 static const SHORTCHAR STORE
= 0x82; // (* general store *)
24 static const SHORTCHAR ELEM
= 0x83; // (* elem store *)
25 static const SHORTCHAR NEWLINK
= 0x84; // (* link to another non-elem store in same file *)
27 * PROCEDURE (s: Store) Domain (): Domain
29 * A store may be associated with a domain. This is done by the procedure InitDomain, which assigns a domain to the store.
30 * Domain may be called by arbitrary clients.
35 * PROCEDURE (s: Store) CopyFrom- (source: Store)
37 * Copy the contents of source to s. Copying is a deep copy.
40 * source # NIL guaranteed
41 * TYP(source) = TYP(s) guaranteed
42 * s.Domain() = NIL guaranteed
43 * s is not yet initialized guaranteed
47 * PROCEDURE (s: Store) Internalize- (VAR rd: Reader)
49 * (For backward compatibility, this method is actually still EXTENSIBLE. This may change in the future.)
50 * Reads the contents of s from reader rd. Internalize must read the same (amount of) data as is written by the corresponding Externalize procedure.
51 * Internalize is called locally.
52 * Internalize is extended by various persistent object types, e.g., models, views, and controllers.
55 * source.Domain() = NIL guaranteed
56 * source is not yet initialized guaranteed
58 // void internalize(Reader &reader) {
59 // PROCEDURE (s: Store) Internalize- (VAR rd: Reader), NEW, EXTENSIBLE;
60 // VAR thisVersion: INTEGER;
62 // rd.ReadVersion(minVersion, maxStoreVersion, thisVersion);
63 // IF ~rd.cancelled & s.isElem THEN
64 // rd.ReadVersion(minVersion, maxStoreVersion, thisVersion)
65 // (* works since maxStoreVersion = maxElemVersion = 0 in pre-1.3 *)
71 * PROCEDURE (s: Store) Externalize- (VAR wr: Writer)
73 * (For backward compatibility, this method is actually still EXTENSIBLE. This may change in the future.)
74 * Write the contents of s to writer wr. Externalize must write the same (amount of) data as is read by the corresponding Internalize procedure.
75 * Externalize ist called locally.
76 * Externalize is extended by various persistent object types, e.g., models, views, and controllers.
81 * PROCEDURE (s: Store) ExternalizeAs- (VAR s1: Store)
83 * Before a store's Externalize procedure is called, its ExternalizeAs procedure is called, which gives the store the opportunity to denote another store that should be externalized in its place (a "proxy"). It is also possible to set s1 to NIL, which means that the store should not be externalized at all. This is used e.g. for compiler error markers, which are never stored.
84 * ExternalizeAs ist called locally.