DIRECTORY BasicTime, CD, Rope; CDDesignCache: CEDAR DEFINITIONS = BEGIN IsCached: PROC [for: CD.Design, remoteName: Rope.ROPE] RETURNS [BOOL]; Fetch: PROC [for: CD.Design, remoteName: Rope.ROPE] RETURNS [remote: CD.Design]; Set: PROC [for: CD.Design, remote: CD.Design]; Forget: PROC [for: CD.Design, remoteName: Rope.ROPE]; CheckProc: TYPE = PROC [design: CD.Design, data: REF] RETURNS [ok: BOOL_TRUE]; Search: PROC [remoteName: Rope.ROPE, fileName: Rope.ROPE_NIL, createdTime: BasicTime.GMT _ BasicTime.nullGMT, check: CheckProc_NIL, data: REF_NIL] RETURNS [found: CD.Design]; MakeUpFile: PROC [for: CD.Design, remoteName: Rope.ROPE] RETURNS [fileName: Rope.ROPE]; GetOrRead: PROC [for: CD.Design, remoteName: Rope.ROPE, remoteFile: Rope.ROPE _ NIL, reload: BOOL _ FALSE, checkFile: BOOL _ TRUE, check: CheckProc_NIL, data: REF_NIL] RETURNS [remote: CD.Design, different: BOOL]; END. CDDesignCache.mesa (part of ChipNDale) Copyright c 1987 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, April 9, 1987 12:03:09 pm PDT Last edited by: Christian Jacobi, April 9, 1987 4:13:05 pm PDT This module implements caching of readonly designs. Readonly: clients must/can not know whether cached designs are shared. --Basic functions -- Returns whether a design "remoteName" is cached for "for" -- Returns cached design if there is one; NIL otherwise. -- "remote" will be readonly and therefore must [and will] never be changed -- (but a different design with the same name might be cached later...) -- Remembers [caches] the design "remote". -- Forgets previous cache contents. -- "remote" must be readonly -- Forgets cache of remote design "remoteName" --Higher level functions -- Tries hard to find a cached design and returns it, or NIL if not found. -- The returned design is readonly. -- "fileName" [if ~NIL]: checks that cached design comes from this file. -- "createdTime" [if ~nullGMT]: checks that cached design's file has this create time. -- "check" [if ~NIL]: returns cached design only in case check returns TRUE. -- "data": given to check, if called. -- Checks whether for wants a special file name to be used for caching design "remoteName". -- Returns "remoteName" if no file name could be made up. -- Might use properties, user profile, or magic to find a name. -- Conveniance; Tries hard to make and return a cached design, -- using Fetch, Search or Read to get it, and, sets the cache. -- "remoteFile" file name; make up name if NIL. -- "reload" -- if true: discards previous cache contents if loading suceeds. -- if false: skips loading if design "remoteName" is already cached. -- "checkFile": if a cached design is searched a check is made whether it comes -- from the right file. -- "check": used for Search. -- "data": given to check, if called. -- "remote": the cached design, independent whether loaded before or now. -- "different": the cache contents is changed. Êǘcodešœ&™&Kšœ Ïmœ1™™>K˜—šž œ˜ Kšœ ž˜ Kšžœ˜Kšœ˜—K˜KšÏn œžœž œ˜"Kšž˜K˜šœ3™3K™F—K˜KšÑbcl™K˜š Ÿœžœžœžœžœžœ˜FKšÏc<™<—K˜š Ÿœžœžœžœžœ žœ ˜PKš¡8™8Kš¡K™KKš¡J™J—K˜šŸœžœžœžœ ˜.Kš¡*™*Kš¡#™#Kš¡™—K˜šŸœžœžœžœ˜5Kš¡.™.—K˜K˜Kš ™K™Kšœ žœžœ žœžœžœžœžœ˜NK˜šŸœžœžœžœžœžœ'žœžœžœžœ žœ ˜®Kš¡J™JKš¡#™#Kš¡H™HKš¡V™VKš¡L™LKš¡%™%—K˜š Ÿ œžœžœžœžœžœ˜WKš¡[™[Kš¡:™:Kš¡@™@—K˜š Ÿ œžœžœžœžœžœ žœžœ žœžœžœžœžœžœ žœžœ˜ÕKš¡>™>Kš¡D™DKš¡2™2Kš¡ ™ Kš¡E™EKš¡I™IKš¡O™OKš¡™Kš¡™Kš¡%™%Kš¡J™JKš¡/™/Kšœ™—Kšžœ˜K˜—…—ˆ_