Mercurial > hg > ishara
annotate arrows/@arrow/mkunit.m @ 2:7357e1dc2ad6
Simplified scheduler library with new schedule representation.
author | samer |
---|---|
date | Sat, 22 Dec 2012 16:17:51 +0000 |
parents | 672052bd81f8 |
children | 5de03f77dae1 |
rev | line source |
---|---|
samer@0 | 1 % mkunit - Initialise processing unit structure |
samer@0 | 2 % |
samer@0 | 3 % This is for use by arrow implementations. It |
samer@0 | 4 % fills in defaults for the function handles in the |
samer@0 | 5 % structure representing a live processing unit. |
samer@0 | 6 % |
samer@0 | 7 % mkunit :: |
samer@0 | 8 % arrow(_:arglist(N),_:arglist(M),S) |
samer@0 | 9 % -> struct { |
samer@0 | 10 % starting :: () -> action (); |
samer@0 | 11 % stopping :: () -> action (); |
samer@0 | 12 % dispose :: () -> action (); |
samer@0 | 13 % set_state :: S -> action () |
samer@0 | 14 % get_state :: () -> S. |
samer@0 | 15 % viewables :: () -> list(samer.core.Viewable) |
samer@0 | 16 % }. |
samer@0 | 17 % |
samer@0 | 18 % NB arrow(A,B,S) denotes an arrow with an accessible state |
samer@0 | 19 % of type S. It is a subtype of arrow(A,B). |
samer@0 | 20 % |
samer@0 | 21 % list(A) denotes the type of cell arrays of objects of |
samer@0 | 22 % type A, ie list(A) :== {[N]->A} where N can be any |
samer@0 | 23 % natural number. |
samer@0 | 24 |
samer@0 | 25 function u=mkunit(o) |
samer@0 | 26 u.starting=@nop; |
samer@0 | 27 u.stopping=@nop; |
samer@0 | 28 u.dispose=@nop; |
samer@0 | 29 u.viewables={}; |
samer@0 | 30 u.get_state=@()[]; |
samer@0 | 31 u.set_state=@nop; |
samer@0 | 32 end |