DIRECTORY CD, CDBasics, CoreGeometry; InstanceTable: CEDAR DEFINITIONS = BEGIN Value: TYPE = REF; Rect: TYPE = CD.Rect; Instance: TYPE = CoreGeometry.Instance; universe: Rect = CDBasics.universe; empty: Rect = CDBasics.empty; Table: TYPE = REF TableRec; TableRec: PRIVATE TYPE = MONITORED RECORD [ range: Rect, -- given at creation time, it retains the range of all rects. Clients should not change this field. leafBuckets: NAT, -- private field to detect when ReHashing is necessary. data: REF TableData ]; TableData: PRIVATE TYPE = RECORD [SEQUENCE size: NAT OF LIST OF InstanceValue]; InstanceValue: PRIVATE TYPE = RECORD [instance: Instance, value: Value]; Create: PROC [range: Rect, logSize: NAT _ 2] RETURNS [Table]; Insert: PROC [table: Table, instance: Instance, value: Value]; Enumerate: PROC [table: Table, action: PROC [Instance, Value], rect: Rect _ universe]; DeleteOutside: PROC [table: Table, rect: Rect _ empty]; END. $InstanceTable.mesa Copyright Σ 1987 by Xerox Corporation. All rights reversed. From Intervals, created by Bertrand Serlet, November 16, 1985 7:22:05 pm PST Bertrand Serlet, August 8, 1987 10:05:20 pm PDT Creates a new table with a suggested hash size of 2**logSize. Adds a new value in the table. The corresponding interval must lie in the creation range, otherwise an ERROR might occur. This operation is monitored. Does NOT check if already member of the table. Enumerates all values of the table that overlap a given rect. The interval can be outside the range of the table. This operation is NOT monitored. Deletes all occurences of instances that do not overlap rect in table. The interval can be outside the range of the table. Table is erased when rect=empty. This operation is monitored. Κϋ– "cedar" style˜codešœ™Kšœ<™™>K˜—šžœœ2˜>Kšœ™KšœHœ ™ZK™Kšœœ&™.K˜—šž œœœ+˜VKšœ=™=Kšœ3™3Kšœœ ™ K˜—šž œœ$˜7KšœF™FKšœ3™3Kšœ ™ K™K˜—Kšœ˜K˜—…—ΆΥ