NAME
ctrl_op -- unit to dispatch control messages
PROTOTYPE
unitptr ctrl_op( int iFirstOperand, int iNumOperands, int *piTriggers, int *piResponses, unitptr uHost)
ARGUMENTS
- int iFirstOperand
- nr of first operand; positive value selects successor unit, negative value predecessor unit
- int iNumOperands
- nr of operands, starting at first operand (always counting in the direction of the successors of the first operand)
- int *piTriggers
- nr of triggers and trigger modes (internal copy made on creation)
- int *piResponses
- nr of responses and the responses
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- CTL_in[1]:
- (control field) A value of zero deactivates the unit.
EXECUTION OF CREATED UNIT:
Has only an effect, if NST_EXEC is in the trigger set (otherwise,
this unit reacts only to a ctrl_unit-call). In this case,
the call exec_unit(u) will trigger the sequence of control operations
specified in the response set, i.e., it will apply a ctrl_unit(iMode,uOperand)
call for each operand and for each value iMode that is in the response
set.
ADAPTATION OF CREATED UNIT:
Has only an effect, if NST_ADAPT is in the trigger set (otherwise,
this unit reacts only to a ctrl_unit-call). In this case,
the call adapt_unit(u) will trigger the sequence of control operations
specified in the response set, i.e., it will apply a ctrl_unit(iMode,uOperand)
call for each operand and for each value iMode that is in the response
set.
DESCRIPTION:
This unit is provided to transform an exec_unit or a
ctrl_unit call into a diffent
single or in an entire sequence of (possibly) other control
messages that affect the iNumOperands operands of the present unit.
Depending on the value of iFirstOperand, the first operand can be
a successor (for iFirstOperand>0 ) or a predecessor (for iFirstOperand<0)
of the present unit.
For iFirstOperand<0 and iNumOperands>-iFirstOperand, the unit will among
its own operands. In this case, it will be included in the operand count,
but the recursive self-call will be omitted to avoid an infinite recursion.
If there are
virtual_units among the affected successors, the control messages
will be passed on to the actual unit that is represented by
each virtual_unit. Note that this differs from the effect of a normal
ctrl_unit call with the same control mode: control messages
issued with ordinary ctrl_unit calls are not passed on by virtual_units
(since these messages reach the intended unit already via the direct
route).
If pcTriggers="", the trigger EXEC will be assumed.
CONTROL MODES:
The call ctrl_unit(iMode,u) with iMode from the trigger set
has the effect to apply the control calls
ctrl_unit(piResponse[i],v) for i=0..piResponse[0]-1 to
all operands v of u.
NOTE:
1. This unit does not execute its operands. It only issues control calls
to them!
2. Unlike other operator units, this unit does not `claim'' its
operands for itself. I.e., operands of a ctrl_op unit remain
fully enabled for execution or adaptation via normal exec_unit
and adapt_unit calls (therefore, under Neo the operands of
a ctrl_op unit do not appear as marked).
STATUS:
beta.
SEE ALSO:
FILE
/homes/jontrup/nst5/man/../o.sol2//../nstsrc/nst_stdr.c