--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]]}; PutPropOnApplication: PROC [onto: CD.ApplicationPtr, 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.ObPtr, prop: REF, val: REF_NIL]; PutPropOnLevel: PROC [onto: CD.Level, prop: REF, val: REF_NIL]; GetPropFromApplication: PROC [from: CD.ApplicationPtr, 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.ObPtr, prop: REF] RETURNS [REF]; GetPropFromLevel: PROC [from: CD.Level, 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 ownersData: REF ANY _ NIL, -- for the registrar of the property myData: REF ANY _ NIL -- for CDProperties own implementation ]; MakeCopyProc: TYPE = PROC [prop: REF, val: REF] RETURNS [valCopy: REF]; InternalPWriteProc: TYPE = PROC [prop: REF, val: REF]; InternalPReadProc: TYPE = PROC [prop: ATOM] RETURNS [val: REF]; CopyProps: PROC [propList: Properties] RETURNS [copy: Properties]; DontCopy: PROC [prop: REF, val: REF] RETURNS [nil: REF]; CopyVal: PROC [prop: REF, val: REF] 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 --by Ch. Jacobi September 27, 1983 2:06 pm --last edited Christian Jacobi May 7, 1984 6:35:07 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.ApplicationPtr'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 --property procedures --prop must be registered and yours --overwrites values for which new has non NIL entries --never copy PropertyProcs^; it can be extended by future calls of InstallProcs --copies properties individually using their MakeCopyProc's and defaults for some types --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 havn'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" User Requests: = Please tell me if you need other chunks of property actions monitored. = Please tell me if you need other property procedures. Ê̘Jšœ(™(Jšœ,™,Jšœ;™;J˜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˜š Ÿœžœžœžœžœžœ˜NJšœ ™ —š Ÿœžœžœžœžœžœ˜AJšœ ™ —š Ÿœžœžœžœžœžœ˜IJšœ ™ —š Ÿ œžœžœžœžœžœ˜:Jšœœ™2Jšœ1™1Jšœ ™ —š Ÿœžœžœžœžœžœ˜@Jšœ ™ J™C—š Ÿœžœžœžœžœžœ˜?Jšœ ™ J™—š Ÿœžœžœžœžœžœ˜PJšœ™—š Ÿœžœžœžœžœžœ˜CJšœ™—š Ÿœžœžœžœžœžœ˜KJšœ™—š Ÿœžœžœžœžœžœ˜