Main Content

Event Access List

This class declares an access list for the event ListenAccess attribute:

classdef EventAccess
   events (NotifyAccess = private, ListenAccess = {?ClassA, ?ClassB})
      Event1
      Event2
   end
end

The class EventAccess specifies the following event access:

  • Limits notify access for Event1 and Event2 to EventAccess; only methods of the EventAccess can trigger these events.

  • Gives listen access for Event1 and Event2 to methods of ClassA and ClassB. Methods of EventAccess, ClassA, and ClassB can define listeners for these events. Subclasses of MyClass cannot define listeners for these events.

Related Topics