Switchboard SDK
Loading...
Searching...
No Matches
Event.hpp
1#pragma once
2
3#include <any>
4#include <functional>
5#include <string>
6
7namespace switchboard {
8
10using EventData = std::any;
11
13struct Event {
15 std::string id;
16
18 std::string objectID;
19
21 std::string name;
22
24 int64_t timestamp;
25
27 EventData data;
28};
29
31using EventCallback = std::function<void(const Event&)>;
32
33}
Represents an event that can be emitted and listened to.
Definition Event.hpp:13
std::string objectID
Unique identifier for the object emitting the event.
Definition Event.hpp:18
int64_t timestamp
Timestamp of when the event was created (in milliseconds since epoch)
Definition Event.hpp:24
std::string name
Name of the event.
Definition Event.hpp:21
std::string id
Unique identifier for the event.
Definition Event.hpp:15
EventData data
Data associated with the event.
Definition Event.hpp:27