forsyth20121205-174063a80cc13 years agoHistory
63 lines · 1.7 KB · Text
RawDownload
.TH SPREE-OBJSTORE 2.SH NAMEObjstore \- support for object archiving in Spree engines..SH SYNOPSIS.EXinclude "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;.EE.SH DESCRIPTIONThe.IR spree (2)module provides an.B Archivesmodule to allow storage of an engine's object hierarchy to a persistentmedium. This does not store the state internal to an engine thatis not reflected in the object hierarchy, e.g. global variables.In particular, if an engine holds a variable referring to an object,it is not able to reset that variable correctly when the archive islater restored.The.B Objstoremodule provides some support for the naming of objectsbefore archival, and for their retrieval by name, in order to enable this..PP.B Initmust be called first with the spree module,.IR m ,and the current clique,.IR c .When a module is archiving itself, it should name each objectthat it wishes to retrieve, using.BR setname .It is permissible for a single object to be given multiplenames: the object will later be retrievable under any of its givennames..PPWhen restoring from an archive, a module should call.BR unarchive ,which scans through the object hierarchy lookingfor named objects and storing their names.After this,.BI get( name )will return the object,.IR o ,that was named.IR nameby a previous.BI setname( o ,\  name )\fR,or.B nilif there was none such..PPThe names for an object are stored in the attribute ``§'',which is cleared when.B unarchiveis called.