DIRECTORY CD, Rope, SymTab; CDGenerate: CEDAR DEFINITIONS = BEGIN Table: TYPE = REF READONLY TableRep; TableRep: TYPE = RECORD [rep: PRIVATE REF, case: BOOL, cache: BOOL]; GeneratorProc: TYPE = PROC [design: CD.Design, key: Rope.ROPE, table: Table, data: REF] RETURNS [ob: CD.Object_NIL]; Create: PROC [case: BOOL _ TRUE, cache: BOOL _ TRUE] RETURNS [Table]; Clear: PROC [table: Table]; Register: PROC[table: Table, key: Rope.ROPE, generator: GeneratorProc, cache: BOOL_TRUE, data: REF_NIL] RETURNS [first: BOOL]; FetchRegistration: PROC[table: Table, key: Rope.ROPE] RETURNS [generator: GeneratorProc, cache: BOOL, data: REF]; FetchCached: PROC[table: Table, design: CD.Design, key: Rope.ROPE] RETURNS [CD.Object]; FetchNCall: PROC[table: Table, design: CD.Design, key: Rope.ROPE, cache: BOOL_TRUE] RETURNS [CD.Object]; Flush: PROC [table: Table, design: CD.Design, key: Rope.ROPE]; FlushAll: PROC [table: Table, design: CD.Design]; SelectOneOf: PROC[table: Table, label: Rope.ROPE] RETURNS [key: Rope.ROPE]; AssertTable: PROC [project: Rope.ROPE] RETURNS [Table]; publicTables: PRIVATE SymTab.Ref; END. FCDGenerate.mesa (part of ChipNDale) Copyright c 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, June 5, 1985 8:02:35 pm PDT Last Edited by Christian Jacobi, March 14, 1986 3:54:38 pm PST Common interface for object generators. A Table is a name space of object generators. --creates a new, empty table --undo all registrations --first if key did not already exist --cache: tries to cache the result --data: passed through to FetchNCall calling generator Caching genenerated objects: to avoid multiple generation of aequivalent objects. The user assumes that he might reuse an object instead of creating a new object, whenever he uses the caching scheme... --fetch the registration of a generator key --generator NIL if not found --fetch a generated object if it is cached. --returns NIL if not found, not cached or looks different --fetch a generator and invoke it --returns NIL if not found or generated --caching only if generator and this call want caching --Removes this entry from the cache --Removes all entries from the cache --convenient procedures --Interactive selection --NIL if discarded --Fetches a table; if not done then create one and store it for next call of AssertTable. --This table can be imported by lots of unknown applications... --space for tables to be returned or created using AssertTable ΚΑ˜codešœ#™#Kšœ Οmœ1™™>K˜—šΟk œ˜ Kšžœ˜—K˜KšΠbl œžœž œ˜Kšž˜K˜KšœV™VK˜šœžœžœžœ ˜$š œ žœžœžœžœžœ žœ˜EK˜——Kšœžœžœ žœžœžœžœžœžœ˜tK˜šΟnœžœžœžœ žœžœžœ ˜EKšœ™K˜—š œžœ˜Kšœ™K˜—š œžœžœ#žœžœžœžœžœ žœ˜~Kšœ$™$Kšœ"™"Kšœ6™6K™K™QK™PK™&K™—K˜š  œžœžœžœ#žœžœ˜qKšœ+™+Kšœ™K˜—š  œžœ,žœžœ ˜WKšœ+™+Kšœ9™9K˜—š  œžœžœžœ žœžœžœžœ ˜hKšœ!™!Kšœ'™'Kšœ6™6—K˜š œžœ-žœ˜>Kšœ#™#K˜—š œžœ#˜1Kšœ$™$K˜—K™Kšœ™K˜š   œžœžœžœ žœ˜KKšœ™Kšœ™K˜—š  œžœžœžœ ˜7KšœY™YKšœ?™?K˜—šœžœ ˜!Kšœ>™>—K˜Kšžœ˜K˜—…—h o