Deskflow 1.22.0.197
Keyboard and mouse sharing utility
|
#include <Event.h>
Classes | |
struct | EventFlags |
Public Types | |
using | Flags = uint32_t |
Public Member Functions | |
Event ()=default | |
Event (EventTypes type, void *target=nullptr, void *data=nullptr, Flags flags=EventFlags::NoFlags) | |
Create Event with data (POD) | |
Event (EventTypes type, void *target, EventData *dataObject) | |
Create Event with non-POD data. |
accessors | |
EventTypes | getType () const |
Get event type. | |
void * | getTarget () const |
Get the event target. | |
void * | getData () const |
Get the event data (POD). | |
EventData * | getDataObject () const |
Get the event data (non-POD) | |
Flags | getFlags () const |
Get event flags. |
manipulators | |
void | setDataObject (EventData *dataObject) |
Set data (non-POD) | |
static void | deleteData (const Event &) |
Release event data. |
using Event::Flags = uint32_t |
|
default |
Event::Event | ( | EventTypes | type, |
void * | target = nullptr, | ||
void * | data = nullptr, | ||
Flags | flags = EventFlags::NoFlags ) |
Create Event
with data (POD)
The data
must be POD (plain old data) allocated by malloc(), which means it cannot have a constructor, destructor or be composed of any types that do. For non-POD (normal C++ objects use setDataObject()
or use appropriate constructor. target
is the intended recipient of the event. flags
is any combination of Flags
.
Event::Event | ( | EventTypes | type, |
void * | target, | ||
EventData * | dataObject ) |
Create Event
with non-POD data.
type
of the event target
is the intended recipient of the event. dataObject
with event data
|
static |
Release event data.
Deletes event data for the given event (using free()).
void * Event::getData | ( | ) | const |
Get the event data (POD).
Returns the event data (POD).
EventData * Event::getDataObject | ( | ) | const |
Get the event data (non-POD)
Returns the event data (non-POD). The difference between this and getData()
is that when delete is called on this data, so non-POD (non plain old data) dtor is called.
Event::Flags Event::getFlags | ( | ) | const |
Get event flags.
Returns the event flags.
void * Event::getTarget | ( | ) | const |
Get the event target.
Returns the event target.
EventTypes Event::getType | ( | ) | const |
Get event type.
Returns the event type.
void Event::setDataObject | ( | EventData * | dataObject | ) |
Set data (non-POD)
Set non-POD (non plain old data), where delete is called when the event is deleted, and the destructor is called.