Quantcast

Documentation Center

  • Trial Software
  • Product Updates

meta.event

meta.event class describes MATLAB class events

Description

The meta.event class provides information about MATLAB® class events. The read/write properties of the meta.event class correspond to event attributes and are specified only from within class definitions.

You can query the read-only properties of the meta.event object to obtain information that is specified syntactically by the class (for example, to obtain the name of the class defining the event).

You cannot instantiate a meta.event object directly. Obtain a meta.event object from the meta.class EventList property, which contains an array of meta.event objects, one for each event defined by the class. For example, replace ClassName with the name of the class whose events you want to query:

mco = ?ClassName;
elist = mco.EventList;
elist(1).Name; % name of first event in list

Use the metaclass function to obtain a meta.class object from a class instance:

mco = metaclass(obj);

Properties

PropertyPurpose
Name read only

Name of the event.

Description read only

Currently not used

DetailedDescription read only

Currently not used

Hidden

If true, the event does not appear in the list of events returned by the events function (or other event listing functions or viewers)

ListenAccess

Determines where you can create listeners for the event.

  • public — unrestricted access

  • protected — access from methods in class or subclasses

  • private — access by class methods only (not from subclasses)

  • List classes that have listen access to this event. Specify classes as meta.class objects in the form:

    • A single meta.class object

    • A cell array of meta.class objects. An empty cell array, {}, is the same as private access.

    See Controlling Access to Class Members

NotifyAccess

Determines where code can trigger the event.

  • public — any code can trigger event

  • protected — can trigger event from methods in class or subclasses

  • private — can trigger event by class methods only (not from subclasses)

  • List classes that have notify access to this event. Specify classes as meta.class objects in the form:

    • A single meta.class object

    • A cell array of meta.class objects. An empty cell array, {}, is the same as private access.

    See Controlling Access to Class Members

DefiningClassThe meta.class object representing the class that defines this event.

See Also

| | |

Was this topic helpful?