shares are now lenses
[mTask.git] / Shares / mTaskShare.dcl
index a9c6f39..57855c1 100644 (file)
@@ -1,14 +1,38 @@
 definition module Shares.mTaskShare
 
 import iTasks
+import iTasks._Framework.Serialization
+import mTask
+import Devices.mTaskDevice
 
-:: MTaskShare = {
-               initValue :: Int,
-               withTask :: String,
-               identifier :: Int,
-               realShare :: String
-       }
+derive class iTask MTaskShare
 
-instance zero MTaskShare
+:: MTaskShare =
+               {withTask :: [String]
+               ,identifier :: Int
+               ,value :: BCValue
+               }
 
-manageShares :: [MTaskShare] -> Task ()
+instance == MTaskShare
+
+//Constructor
+makeShare :: String Int BCValue -> MTaskShare
+
+//General viewing task
+manageShares :: Task [MTaskDevice]
+//manageShares :: [MTaskShare] -> Task MTaskShare
+
+updateShares :: MTaskDevice ([MTaskShare] -> [MTaskShare]) -> Task [MTaskShare]
+
+//Clean out shares when a task has been removed
+cleanSharesTask :: Int MTaskDevice -> Task [MTaskShare]
+//cleanSharesTask :: Int MTaskDevice -> Task [MTaskShare]
+//Clean out shares when a device has been removed
+
+updateShareFromPublish :: MTaskDevice Int BCValue -> Task BCValue
+//updateShare :: Int BCValue -> Task [MTaskShare]
+
+getRealShare :: MTaskDevice MTaskShare -> Shared BCValue
+//getRealShare :: MTaskDevice BCShare -> Shared BCValue
+
+//updateShare :: Int BCValue -> Task ()