--Registration Rules for property names DIRECTORY CD, Atom; CDProperties: CEDAR DEFINITIONS IMPORTS Atom = BEGIN Properties: TYPE = CD.Properties; RegisterProperty: PROC [prop: REF, registrationKey: REF_NIL] RETURNS [first: BOOLEAN]; PutProp: PROC [onto: REF, prop: REF, val: REF_NIL]; GetProp: PROC [from: REF, prop: REF] RETURNS [REF]; GetPropFromList: PROC [propList: Properties, prop: REF] RETURNS [REF] = INLINE{RETURN[Atom.GetPropFromList[propList, prop]]}; PutPropOnInstance: PROC [onto: CD.Instance, prop: REF, val: REF_NIL]; PutPropOnDesign: PROC [onto: CD.Design, prop: REF, val: REF_NIL]; PutPropOnTechnology: PROC [onto: CD.Technology, prop: REF, val: REF_NIL]; PutPropOnAtom: PROC [onto: ATOM, prop: REF, val: REF_NIL]; PutPropOnObject: PROC [onto: CD.Object, prop: REF, val: REF_NIL]; PutPropOnLayer: PROC [onto: CD.Layer, prop: REF, val: REF_NIL]; GetPropFromInstance: PROC [from: CD.Instance, prop: REF] RETURNS [REF]; GetPropFromDesign: PROC [from: CD.Design, prop: REF] RETURNS [REF]; GetPropFromTechnology: PROC [from: CD.Technology, prop: REF] RETURNS [REF]; GetPropFromAtom: PROC [from: ATOM, prop: REF] RETURNS [REF]; GetPropFromObject: PROC [from: CD.Object, prop: REF] RETURNS [REF]; GetPropFromLayer: PROC [from: CD.Layer, prop: REF] RETURNS [REF]; InstallProcs: PROC [prop: REF, new: PropertyProcsRec]; FetchProcs: PROC [prop: REF] RETURNS [PropertyProcs]; PropertyProcs: TYPE = REF PropertyProcsRec; PropertyProcsRec: TYPE = RECORD [ makeCopy: MakeCopyProc _ NIL, internalWrite: InternalPWriteProc _ NIL, internalRead: InternalPReadProc _ NIL, exclusive: BOOL _ FALSE, --the implementation requests others not too fool with key: REF _ NIL, --the prop field of registration properties: Properties _ NIL --registration required ]; MakeCopyProc: TYPE = PROC [prop: REF, val: REF, purpose: REF_NIL] RETURNS [valCopy: REF]; InternalPWriteProc: TYPE = PROC [prop: REF, val: REF]; InternalPReadProc: TYPE = PROC [prop: ATOM] RETURNS [val: REF]; CopyProps: PROC [propList: Properties, purpose: REF_NIL] RETURNS [copy: Properties]; AppendProps: PROC [winner, looser: Properties_NIL, purpose: REF_NIL] RETURNS [copy: Properties]; DontCopy: PROC [prop: REF, val: REF, purpose: REF_NIL] RETURNS [nil: REF]; CopyVal: PROC [prop: REF, val: REF, purpose: REF_NIL] RETURNS [valCopy: REF]; RopePWrite: PROC [prop: REF, val: REF]; RopePRead: PROC [prop: ATOM] RETURNS [val: REF]; IntPWrite: PROC [prop: REF, val: REF]; IntPRead: PROC [prop: ATOM] RETURNS [val: REF]; AtomPWrite: PROC [prop: REF, val: REF]; AtomPRead: PROC [prop: ATOM] RETURNS [val: REF]; SomePWrite: PROC [prop: REF, val: REF]; SomePRead: PROC [prop: ATOM] RETURNS [val: REF]; END. CDProperties.mesa a ChipNDale module Copyright c 1983, 1984 by Xerox Corporation. All rights reserved. by Ch. Jacobi, September 27, 1983 2:06 pm last edited Christian Jacobi, July 8, 1985 4:15:51 pm PDT --Using property names without following the rules is considered unfair. --Atoms which start with the letters "CDX" or "CDx" (e.g. $CDxNMosTransitors) --must be manual registered by the registrar and RegisterProperty must --not be used. --Atoms which start with the letters "CDY" or "CDy" (e.g. $CDyNMosTransitors) --must not be registered, and there is no waranty of non-conflict. --These may be used for debugging only. --Atoms which start with other letters must be registered with RegisterProperty. --Other REF-types need not be registered, since no conflicts may occur. --Every module is allowed to introduce only a finite (fixed at compile time) --number of "property names"s. --registers "prop" in a table; any program which wants to use an ATOM --as a "prop" gets to know if it is already in use. --if registrationKey#NIL and registrationKey is equal to registrationKey of previous --registration, a property may be multiple registered --may raise CD.Error[doubleRegistration] and others --Property names cannot be removed, since they may reside somewhere in the --stored data. --Usage --Include (or remove) properties exclusively with PutProp; so the property-lists --are monitored correctly; --Properties hang on (if a REF ANY is used): --CD.Instance's --CD.Design's --CD.Technology's --Atoms [these properties are not shared to the module Atom] -- the Atom need not be registered anywhere, the registration of the -- propertynames is enough to prevent conflicts --the REF ANY's must not be NIL --a NIL val removes the property --NIL if prop is not found --NIL if prop is not found --bypasses monitor lock; --speed ups --a NIL val removes the property --a NIL val removes the property --a NIL val removes the property --this property is NOT fetchable with Atom.GetProp --there is no registration need for the onto-Atom --a NIL val removes the property --a NIL val removes the property --warning: different objects may share bits, property owners loose! --a NIL val removes the property --NIL if prop is not found --NIL if prop is not found --NIL if prop is not found --does NOT fetch properties put with Atom.PutProp --NIL if prop is not found --NIL if prop is not found --warning: different objects may share bits, property owners loose! --NIL if prop is not found --general property procedures --prop must be registered and yours --overwrites values for which new has non NIL entries --(except key) --never copy PropertyProcs^; it can be extended by future calls of InstallProcs --valCopy: may be NIL if property should not be copied --purpose: -- copy procs will not recognize most purposes.. -- but a particular property might want a particular handling from some tool --copies properties individually using their MakeCopyProc's and defaults for some types --copies properties individually using their MakeCopyProc's and defaults for some types --works like first copying looser, then copying winner --copy is a different list from both, looser and winner --particular property procedures for implementors --to be shure that no copy is made; trivial procedure --copy of val; trivial procedure; is for some types a default anyway Design consideration: = A registeration procedure for property names is needed to prevent the same property name beeing used by two independent modules. = Props are unique, and not used per technology since they hang on objects where the technology does not hang and some procs haven't a design or technology parameter. = CDProperties serves for object classes with few numbers of properties, CDValue serves for object classes with huge numbers of "properties" Ê8˜šœ&™&Jšœ Ïmœ7™BJšœ)™)Jšœ9™9J˜—J˜JšÏb'˜'J˜JšœH™HJ™JšœM™MJšœG™GJšœ™J™JšœM™MJšœB™BJšœ'™'J™JšœP™PJ™J™GJ™JšœM™MJšœ™J™J™šÏk ˜ JšŸœ˜J˜J˜—šÏn œŸœŸ œ˜ JšŸœ˜—JšŸ˜Jšœ ŸœŸœ ˜!J˜š  œŸœŸœŸœŸœ Ÿœ˜VJšœF™FJšœ4™4JšœU™UJšœ6™6Jšœ3™3J™—JšœJ™JJšœ™™J˜—Jšœ™J˜JšœP™PJšœ™J˜Jšœ,™,Jšœ™Jšœ ™ Jšœ™šœžœ™=J™DJ™/—J™Jšœ™J˜š  œŸœŸœŸœŸœŸœ˜3Jšœ ™ J˜—š  œŸœŸœŸœŸœŸœ˜3Jšœ™J˜—š  œŸœŸœŸœŸœ˜GJšœ™Jšœ™JšŸœŸœ(˜5J˜J˜—Jšœ ™ J˜š  œŸœŸœŸœŸœŸœ˜EJšœ ™ —š  œŸœŸœŸœŸœŸœ˜AJšœ ™ —š  œŸœŸœŸœŸœŸœ˜IJšœ ™ —š   œŸœŸœŸœŸœŸœ˜:Jšœžœ™2Jšœ1™1Jšœ ™ —š  œŸœŸœŸœŸœŸœ˜AJšœ ™ J™C—š  œŸœŸœŸœŸœŸœ˜?Jšœ ™ J™—š  œŸœŸœŸœŸœŸœ˜GJšœ™—š  œŸœŸœŸœŸœŸœ˜CJšœ™—š  œŸœŸœŸœŸœŸœ˜KJšœ™—š  œŸœŸœŸœŸœŸœ˜