Workspace 6.21.5
Public Member Functions | Protected Member Functions | List of all members
EventID Class Reference

Subclassed and instantiated exactly once for each event type. More...

#include <Workspace/DataExecution/Events/observableevent.h>

Inheritance diagram for EventID:
[legend]

Public Member Functions

const QString & getName () const
 

Protected Member Functions

 EventID (const QString &name)
 

Detailed Description

Every event type has an associated EventID singleton instance. In all cases, the handling of this instance is done automatically for you by making your event class derive from ObserverableEventType (there is no choice, this is enforced by the access restrictions of ObservableEvent). The only other thing you then need to do is to use the DECLARE_WORKSPACE_EVENT_INSTANCE and DEFINE_WORKSPACE_EVENT_INSTANCE macros for your event, with the DECLARE_... macro typically appearing at the bottom of your event class' header file and the DEFINE_... macro at the top of the file that contains your plugin's setup() function.

For a detailed example of how to define your own event, see the ProgressEvent class.

See also
ObservableEvent, ObservableEventType, ObserverSet

Constructor & Destructor Documentation

◆ EventID()

EventID ( const QString &  name)
protected
Parameters
nameThe name to associate with this event. It will normally be the class name of the ObservableEvent subclass that "owns" this event ID. The constructor takes a copy of this string, so it does not have to continue to exist after the constructor returns.

Member Function Documentation

◆ getName()

const QString & getName ( ) const
Returns
The name assigned to this event ID in its constructor.