include "spree.m"; include "spree/objstore.m"; Object: import Spree; objstore := load Objstore Objstore->PATH; init: fn(m: Spree, c: ref Clique); setname: fn(o: ref Object, name: string); unarchive: fn(); get: fn(name: string): ref Object;
Init must be called first with the spree module, m, and the current clique, c. When a module is archiving itself, it should name each object that it wishes to retrieve, using setname. It is permissible for a single object to be given multiple names: the object will later be retrievable under any of its given names.
When restoring from an archive, a module should call unarchive, which scans through the object hierarchy looking for named objects and storing their names. After this, get(name) will return the object, o, that was named name by a previous setname(o, name), or nil if there was none such.
The names for an object are stored in the attribute ``§'', which is cleared when unarchive is called.
SPREE-OBJSTORE(2 ) | Rev: Thu Feb 15 14:43:26 GMT 2007 |