CDCacheBase.mesa (part of ChipNDale)
Copyright © 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, April 2, 1987 10:34:15 am PST
Last edited by: Christian Jacobi, April 2, 1987 10:34:17 am PST PDT
DIRECTORY
CD;
CDCacheBase: CEDAR DEFINITIONS =
BEGIN
An interface useful for cache implementors to ensure whether cached objects are still valid.
Cache implementors cache ObjectAndKey; after fetching ObjectAndKey from
cache, a call of Match tells whether object has not been changed since cacheing.
Modification keys are not saved when object is written and read from file.
ObjectAndKey: TYPE = RECORD [ob: CD.Object, key: REF];
CurrentKey: PROC [ob: CD.Object] RETURNS [key: REF];
--Returns current modification key of ob.
--Whenever ob is changed it will get a new modification key.
Match: PROC [ok: ObjectAndKey] RETURNS [BOOL];
--Returns whether the current modification key of ok.ob matches ok.key
--Like: (CurrentKey[ok.ob]=cr.modificationKey)
--Warning: If ok.ob's designs lock is not hold, object might be changed
-- in the window between check and returning result.
modificationKeyProp: PRIVATE READONLY REF;
--Used by the implementation; clients probably have no use for it.
END.