view arrows/@erate/erate.m @ 27:5de03f77dae1

Added documentation about types and revised arrow type specifications.
author samer
date Sat, 19 Jan 2013 14:22:09 +0000
parents 672052bd81f8
children
line wrap: on
line source
% erate - Drive sub-arrow at event rate, ie when events arrive
%
% erate :: arrow(A@typelist(N),B@typelist(M),S),
% -> arrow(events(A), events(B),S).
%
% the type events(A) denotes a list of types where each
% type is a boxed version of the the corresponding type in A.
% The boxed type boxed(A) is either {} (no-event) or {A},
% (event with data of type A). If the encapsulated arrow has
% multiple inputs, the arrow is fired only if all inputs
% receive an event simultaneously. The arrow must have at
% least one input.

function o=erate(a,sizes_in)

	s.base=a;
	s.sizes_in=sizes_in;
	if nargin(a)<1, error('erate arrow must have at least 1 input'); end
	o=class(s,'erate',arrow(nargin(a),nargout(a)));
end