Multiple implementations of abstract interface with late binding

From: [at]} <Tony>
Date: Fri, 17 Sep 1999 10:31:55 +1200

My subject is multiple implementations of abstract interfaces with late
binding. A good example is the CommStreams interface in BB. Now for
every implementation of this abstract interface there needs to be some
factory procedure defined, for example the NewListner procedure. In
order to create an actual instance of the the abstract interface this
factory procedure must be executed. This acutual factory object is
identified by the driver parameter given to the abstract interface via a
call to the abstract interface's create call.

My question is, how do I code it using meta? I guess I can get the
required procedure using Meta.LookupPath. But how do I execute it? How
do I map the parameter strings? I have included an excerpt from the

CommStreams documentation.

Finally, does anyone know how to use Meta.CallWith, my guess is that
this is the procedure to use.

Thank you for the time you have taken to read this. I appreciate any
assistance you may be able to give.

Tony Wallace


Requirements for implementors

Implementors of the interface have to implement all the procedures of
the types Stream and Listener according to the specification described
in the previous section. Furthermore, two procedures for object
allocation must be provided according to the following types:

PROCEDURE (localAdr, remoteAdr: ARRAY OF CHAR; OUT s: Stream; OUT res:
INTEGER)
PROCEDURE (localAdr: ARRAY OF CHAR; OUT l: Listener; OUT res: INTEGER)

These procedures will be activated by CommStreams using the
metaprogramming facility of BlackBox. For example, if the protocol is
TCP/IP, its driver's module name is used as protocol name, e.g.,
"CommTCP". For creating a stream, "CommTCP.NewStream" is called with the
above described arguments. For creating a listener,
"CommTCP.NewListener" is called with its set of arguments.
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
Received on Fri Sep 17 1999 - 00:43:16 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:43 UTC