WalnutRegistryInternalImpl.mesa
Copyright Ó 1985, 1992 by Xerox Corporation. All rights reserved.
Donahue, July 9, 1985 1:37:20 pm PDT
Willie-Sue, June 18, 1985 5:38:35 pm PDT
Swinehart, May 16, 1986 10:52:24 am PDT
DIRECTORY
MBQueue,
Rope USING [ROPE],
WalnutRegistry,
WalnutRegistryInternal,
WalnutRegistryPrivate;
WalnutRegistryInternalImpl: CEDAR PROGRAM
IMPORTS MBQueue EXPORTS WalnutRegistryInternal =
BEGIN
QueueData: TYPE = WalnutRegistryInternal.QueueData;
QueueRecord: TYPE = WalnutRegistryInternal.QueueRecord;
QueueEvent: PUBLIC PROC[event: WalnutRegistry.Event, queue: MBQueue.Queue,
proc: WalnutRegistry.EventProc, clientData: REF ANY] = {
queueData: QueueData = NEW[QueueRecord ¬ [event: event, clientData: clientData, eventProc: proc]];
MBQueue.QueueClientAction[queue, DoQueuedEvent, queueData];
};
DoQueuedEvent: PROC[r: REF ANY] = {
queueData: QueueData = NARROW[r];
queueData.eventProc[queueData.event, queueData.clientData];
};
QueueMsgEvent: PUBLIC PROC[msgEvent: WalnutRegistry.MsgEvent, msg: Rope.ROPE,
queue: MBQueue.Queue, proc: WalnutRegistry.MsgProc, clientData: REF ANY] = {
queueData: QueueData =
NEW[QueueRecord ¬ [msgEvent: msgEvent, name: msg, clientData: clientData, msgProc: proc]];
MBQueue.QueueClientAction[queue, DoQueuedMsgEvent, queueData];
};
DoQueuedMsgEvent: PROC[r: REF ANY] = {
queueData: QueueData = NARROW[r];
queueData.msgProc[queueData.name, queueData.msgEvent, queueData.clientData];
};
QueueMoveEvent: PUBLIC PROC[msg: Rope.ROPE, to, from: Rope.ROPE,
queue: MBQueue.Queue, proc: WalnutRegistry.MoveProc, clientData: REF ANY] = {
queueData: QueueData =
NEW[QueueRecord ¬ [name: msg, fromMsgSet: from, toMsgSet: to, clientData: clientData, moveProc: proc]];
MBQueue.QueueClientAction[queue, DoQueuedMoveEvent, queueData];
};
DoQueuedMoveEvent: PROC[r: REF ANY] = {
queueData: QueueData = NARROW[r];
queueData.moveProc[msgName: queueData.name, fromMsgSet: queueData.fromMsgSet, toMsgSet: queueData.toMsgSet, clientData: queueData.clientData];
};
QueueMsgGroupEvent: PUBLIC PROC[event: WalnutRegistry.MsgGroupEvent, group: REF WalnutRegistry.MsgGroup, queue: MBQueue.Queue, proc: WalnutRegistry.MsgGroupProc, clientData: REF ANY] = {
queueData: QueueData = NEW[QueueRecord ¬ [
msgGroup: NEW[WalnutRegistry.MsgGroup ¬ group­],
msgGroupEvent: event, clientData: clientData, msgGroupProc: proc]];
MBQueue.QueueClientAction[queue, DoQueuedMsgGroupEvent, queueData];
};
DoQueuedMsgGroupEvent: PROC[r: REF ANY] = {
queueData: QueueData = NARROW[r];
queueData.msgGroupProc[queueData.msgGroup, queueData.msgGroupEvent, queueData.clientData];
};
QueueMsgSetEvent: PUBLIC PROC[event: WalnutRegistry.MsgSetEvent, msgSet: Rope.ROPE, queue: MBQueue.Queue, proc: WalnutRegistry.MsgSetProc, clientData: REF ANY] = {
queueData: QueueData =
NEW[QueueRecord ¬ [name: msgSet, msgSetEvent: event, clientData: clientData, msgSetProc: proc]];
MBQueue.QueueClientAction[queue, DoQueuedMsgSetEvent, queueData];
};
DoQueuedMsgSetEvent: PROC[r: REF ANY] = {
queueData: QueueData = NARROW[r];
queueData.msgSetProc[queueData.name, queueData.msgSetEvent, queueData.clientData];
};
END.