netobjrt/src/TransportUtils.i3


Copyright (C) 1994, Digital Equipment Corp.
TransportUtils.i3
 The TransportUtils interface reveals methods of Transport.Ts
   and Transport.Locations which are useful for management and
   debugging tools. 

INTERFACE TransportUtils;

IMPORT Transport;

REVEAL
  Transport.T <: Public;
  Transport.Location <: LocationP;

TYPE
  Public = Transport.Public OBJECT METHODS
    enumerateLocs (p: EnumProc; cl: REFANY := NIL);
  END;

  EnumProc = PROCEDURE (loc: Transport.Location; cl: REFANY): BOOLEAN;

  LocationP = Transport.LocationP OBJECT METHODS
    getInfo (): TEXT;
    getEp (): Transport.Endpoint;
  END;

END TransportUtils.
The call tr.enumerateLocs (p, cl) should invoke p (loc, cl) for each live loc: Location owned by tr. The enumeration should terminate after the first invocation of p which returns TRUE.

The method loc.getInfo should return a TEXT suitable for presentation to a human which identifies the location amongst those managed by the transport.

The method loc.getEp should return a Transport.Endpoint e such that loc = tr.fromEndpoint (e).