- A message is broadcast.
- The callback function is executed.
- A listener awaiting the message
executes its callback. - The SetObservable attribute of Properties
is set to Tr ue, so setting the property
automatically triggers a PostSet event.
Note that methods and events did not have
to be declared in myfunceval. - New limits are assigned. myfunceval
Properties (SetObservable)
Lm
Listener
Properties
EventName = ‘PostSet’
FunctionHandle = @listenLm
myfuncview
Methods
listenLm
PostSet
obj.Lm = [-3 5];
Sequence During the Lm Property Assignment
The fcneval class defines a set function for the Lm property. When a value is assigned to
this property during object construction or property reassignment, the following
sequence occurs:
(^1) An attempt is made to assign argument value to Lm property.
(^2) The set.Lm method executes to check whether the value is in appropriate range — if
yes, it makes assignment, if no, it generates an error.
(^3) If the value of Lm is set successfully, MATLAB triggers a PostSet event.
(^4) All listeners execute their callbacks, but the order is nondeterministic.
Techniques for Using Events and Listeners