DMPBusModelImpl.mesa
Written By: Jean Vuillemin and Pradeep Sindhu
Last Edited By: Pradeep Sindhu September 2, 1985 11:42:36 pm PDT
DIRECTORY
DM, DragOpsCross, DMPBusModel;
DMPBusModelImpl: CEDAR PROGRAM
IMPORTS DM
EXPORTS DMPBusModel = BEGIN OPEN DMPBusModel;
Create: PUBLIC PROC [] RETURNS [pbus: DM.Component] = {
pbus ← NEW [DM.ComponentRec ← [
action: [Reset, PhA, EvPhA, PhB, EvPhB],
history: NIL,
componentType: $PBus,
subComponents: NIL,
specific: NEW [PBusSpecificRec]]]
};
Cmd: PUBLIC PROC [pbus: DM.Component] RETURNS [PCmdType] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
RETURN [pvt.pCmdA]
};
DrCmd: PUBLIC PROC [pbus: DM.Component, pCmdA: PCmdType] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
pvt.pCmdA ← pCmdA;
};
Data: PUBLIC PROC [pbus: DM.Component] RETURNS [DM.Word] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
RETURN [pvt.pData]
};
DrData: PUBLIC PROC [pbus: DM.Component, pData: DM.Word] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
pvt.pData ← pData;
};
Reject: PUBLIC PROC [pbus: DM.Component] RETURNS [BOOL] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
RETURN [pvt.pRejectB]
};
DrReject: PUBLIC PROC [pbus: DM.Component, pRejectB: BOOL] = {
pvt: PBusSpecific ← NARROW[pbus.specific];
pvt.pRejectB ← pRejectB;
};
PhA: DM.ActionProc = {
};
EvPhA: DM.ActionProc = {
pvt: PBusSpecific ← NARROW[component.specific];
component.history ← DM.ConsHistory[EvPhA, NEW[PBusSpecificRec ← pvt^], component.history]
};
PhB: DM.ActionProc = {
};
EvPhB: DM.ActionProc = {
pvt: PBusSpecific ← NARROW[component.specific];
component.history ← DM.ConsHistory[EvPhB, NEW[PBusSpecificRec ← pvt^], component.history]
};
Reset: DM.ActionProc = {
component.history ← NIL
};
END.