CDRemote.mesa (part of ChipNDale)
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, June 5, 1985 8:02:35 pm PDT
Last Edited by Christian Jacobi, September 1, 1985 2:29:26 pm PDT
DIRECTORY
CD,
CDGenerate,
Rope;
CDRemote: CEDAR DEFINITIONS =
BEGIN
--This module implements transfering (copying) objects from one design into an other.
--Transfered objects are cached; Transfering two objects in the same ChipNDale session
--(while the design stays in memory) will not create duplicate copies of the children objects.
--To guarantee correct cacheing, a copy of the source design is needed and the source
--design is specified with its name only.
GetTable: PROC [remoteDesign: Rope.ROPE] RETURNS [CDGenerate.Table];
--Creates a generator table, "generating" = fetching an object from the remote design.
--Generating objects with the table will cause reading remoteDesign if it
--is not loaded and cached for the destination design. If filename was not specified,
--defaults to remoteDesign.
Get: PROC [for: CD.Design, remoteDesign: Rope.ROPE, object: Rope.ROPE] RETURNS [CD.Object];
--Transferes object (and its children) from other remoteDesign.
--Reads remoteDesign if necessary.
--Returns NIL if object not found.
GetTableUsingFile: PROC [for: CD.Design, remoteDesign: Rope.ROPE, remoteFile: Rope.ROPENIL, reload: BOOLFALSE] RETURNS [CDGenerate.Table];
--Creates a generator table, "generating" = fetching an object from the remote design.
--Reads remoteDesign if necessary or reload
--  remoteFile defaults to remoteDesign
--  re-reading may cause children objects to be duplicated
--Raises ioFailed if reading not successfull; may be resumed.
ioFailed: SIGNAL;
DesignName: PROC [table: CDGenerate.Table] RETURNS [Rope.ROPE];
CacheDesign: PRIVATE PROC [for: CD.Design, remote: CD.Design];
--caller MUST guarantee: remote will NEVER be changed
-- (but a different design with the same name might be cached later...)
--CDRemote guarantees: it will never change remote
FetchDesign: PRIVATE PROC [for: CD.Design, name: Rope.ROPE] RETURNS [remote: CD.Design];
--NIL if no design cached
--caller MUST guarantee: caller will NEVER change remote
--CDRemote guarantees: CDRemote will never change remote
-- (but a different design with the same name might be cached later...)
END.