Events that can be emitted, watched, and responded to with event handlers.
More...
#include <event.h>
Events that can be emitted, watched, and responded to with event handlers.
Events are constructed with a jsonable value, as in
See https://github.com/nlohmann/json for details about how to define and manipulated json values.
Definition at line 23 of file event.h.
◆ Event()
elma::Event::Event |
( |
std::string |
name, |
|
|
json |
value |
|
) |
| |
|
inline |
Construct a new event
- Parameters
-
Definition at line 29 of file event.h.
◆ empty()
bool elma::Event::empty |
( |
| ) |
const |
|
inline |
Determine whether the event has no data
- Returns
- Whether the event has no data
Definition at line 38 of file event.h.
◆ name()
std::string elma::Event::name |
( |
| ) |
const |
|
inline |
- Returns
- Whether the event has no data
Definition at line 41 of file event.h.
◆ propagate()
bool elma::Event::propagate |
( |
| ) |
const |
|
inline |
Determine whether the event will propagate to the next event handler
- Returns
- True or false
Definition at line 45 of file event.h.
◆ stop_propagation()
void elma::Event::stop_propagation |
( |
| ) |
|
|
inline |
Prevent the event from propagating to the next event handler. Typically called within an event handler to prevent an subsequent events that are watching the same event from firing. See the Manager methods emit() and watch().
Definition at line 50 of file event.h.
◆ value()
json elma::Event::value |
( |
| ) |
const |
|
inline |
Get the data value associated with an event
- Returns
- The value
Definition at line 34 of file event.h.
The documentation for this class was generated from the following file: