DIRECTORY CD USING [Design, Instance, InstanceList, PropList], Rope USING [ROPE]; CDSatellites: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; InstanceList: TYPE = CD.InstanceList; satellitesProp: ATOM; maxGroupIdProp: ATOM; groupIdProp: ATOM; AddSatellite: PROC [design: CD.Design, master: CD.Instance, satellite: CD.Instance]; RemoveSatellite: PROC [world: InstanceList, satellite: CD.Instance]; GetSatellites: PROC [master: CD.Instance] RETURNS [satellites: InstanceList _ NIL]; GetSatelliteRopes: PROC [masterProps: CD.PropList] RETURNS [ropes: LIST OF ROPE _ NIL]; EnforceInvariants: PROC [design: CD.Design, world: InstanceList]; END. όCDSatellites.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Written by Pradeep Sindhu December 20, 1985 1:22:54 pm PST This module is descended from the early implementation of satellites by Monier. It has been rewritten a number of times since then by Sindhu and Serlet to find an implementation that is comfortable to use both from programs and interactively. This last version is a complete rewrite, one hopes for the last time! Pradeep Sindhu December 24, 1985 2:55:01 pm PST Abstract A satellite is a text CD.Instance associated with another CD.Instance called the satellite's master. A master along with its satellites forms a satellite group. It is useful to think of satellites simply as visible properties attatched to the master. However, three things distinguish satellites from ordinary properties: 1) satellites are always visible, 2) the user can control their looks and placement to suit his taste, and 3) satellites are untypedas far as clients are concerned satellites are simply pieces of text. Clients of this interface should be aware of the following set of invariants maintained for satellites, so they may avoid violating them inadvertently (the description below uses the notion of a world, which is a list of CD.Instance belonging to a cell or to the top level of the design): I1) A master must be a non-text CD.Instance with a non-nil groupIDProp. I2) A satellite must be a text CD.Instance with a non-nil groupIDProp. I3) Every satellite in a given world must have a corresponding master. That is, if n is the value of its groupIDProp (its groupID), then there must be a master in world that also has n as its groupID. I4) A design may have at most one master with a given groupID. I5) Each master must have a satellitesProp property that points to a list instances that are the master's satellites. These invariants are enforced by the procedure EnforceInvariants, which should be called whenever one or more of them could have been violated. NB The procedures in this interface do not acquire any ChipNDale locks. It is the responsibility of clients to get these locks if they believe there is danger of conflict. This property hangs on a master. Its value is the list of the master's satellites. This property hangs on a design. Its value is the highest numbered satellite group in the design. This property hangs on each instance that is in a satellite group. Its value is the group's groupId. Adds satellite to master if satellite isn't already present; old satellites are preserved. Caller must guarantee that satellite is in master's world. Removes satellite from its master. Returns the satellites for master. Convenience proc that returns the list of satellite ropes for masterProps. Enforces the satellite invariants listed above. Κ#˜šœ™Jšœ Οmœ1™<™:J™\J™ZJ™\J™%—Icode™/—headšœ™IbodyšœΟi œRžœ.žœπ™šœΓžœX™ MšœžBœ™GMšœžAœ™FMšœžΔœ™ΙMšœž9œ™>Mšœžpœ™u—Mšœ™MšΟbœ«™­—J˜šΟk œ˜ Jš œ œ-˜5Jšœ œ œ˜—J˜šΠbl œ œ  œ œ˜(J˜Jš œ œ œ˜Jšœ œ œ˜%K˜šœ œ˜JšœS™S—šœ œ˜Jšœb™b—šœ  œ˜Jšœe™e—˜J˜—š Οn œ œ  œ œ œ ˜TJ™–J™—š’œ œ" œ ˜DJ™"J™—š ’ œ œ  œ  œ œ˜SJ™"J™—š’œ œ œ  œ  œ œ œ œ˜WJšœL™LK˜—š’œ œ  œ˜AJšœ/™/K˜——Jš œ˜—…—―