deviceStore :: RWShared (Maybe (MTaskDevice, Int)) [MTaskDevice] [MTaskDevice]
deviceStore = SDSSource {SDSSource
| name = "deviceStore"
- , read = \_->read realDeviceStore
+ , read = realRead
, write= realWrite
}
where
- realRead p iw
- | not (trace_tn $ "read called with: " +++ printToString p) = undef
- = read realDeviceStore iw
+ realRead :: (Maybe (MTaskDevice,Int)) *IWorld -> (MaybeError TaskException [MTaskDevice], *IWorld)
+ realRead p iw = read realDeviceStore iw
+ realWrite :: (Maybe (MTaskDevice,Int)) [MTaskDevice] *IWorld -> (MaybeError TaskException (SDSNotifyPred (Maybe (MTaskDevice,Int))), *IWorld)
realWrite mi w iw
| not (trace_tn $ "write called with: " +++ printToString mi +++ " w " +++ printToString w) = undef
# (merr, iw) = write w realDeviceStore iw
notifyPred (Just (d1, i1)) (Just (d2, i2)) = d1 == d2 && i1 == i2
realDeviceStore :: Shared [MTaskDevice]
-realDeviceStore = memoryShare "mTaskDevices" []
-
-bcStateStore :: Shared BCState
-bcStateStore = memoryShare "mTaskBCState" zero
+realDeviceStore = sharedStore "mTaskDevices" []
+//realDeviceStore = memoryShare "mTaskDevices" []
mTaskTaskStore :: Shared [String]
mTaskTaskStore = memoryShare "mTaskTasks" $ 'DM'.keys allmTasks