-- CoordinatorMap.mesa
-- TransID -> Coordinator.Handle.
-- Last edited by
--   MBrown on November 8, 1982 3:19 pm

  DIRECTORY
    AlpineEnvironment,
    Coordinator USING [Handle, nullHandle];

CoordinatorMap: DEFINITIONS =
  BEGIN
  TransID: TYPE = AlpineEnvironment.TransID;

  Handle: TYPE = Coordinator.Handle;
  nullHandle: Handle = Coordinator.nullHandle;


  -- Creating, finding, and deleting Handles

  Register: PROC [handle: Handle];

  GetHandle: PROC [trans: TransID] RETURNS [handle: Handle];

  Unregister: PROC [handle: Handle];

  Count: PROC [] RETURNS [INT];
    -- Returns the number of Handles currently registered.

  EnumProc: TYPE = PROC [Handle] RETURNS [stop: BOOL];
  LockedEnumerate: PROC [proc: EnumProc];
    -- proc is called with CoordinatorMap monitor locked.  All Handles Registered
    --before the start of the enumeration and not Unregistered before the start of the
    --enumeration will be seen exactly once.
  UnlockedEnumerate: PROC [proc: EnumProc];
    -- proc is called with CoordinatorMap monitor unlocked.  All Handles Registered
    --before the start of the enumeration and not Unregistered before the end of the
    --enumeration will be seen at least once.

  END.