4#ifndef TRAM_SDK_FRAMEWORK_MESSAGE_H
5#define TRAM_SDK_FRAMEWORK_MESSAGE_H
44 static void Send(
const Message& message,
float delay);
47 template <
typename T>
static T*
AllocateData() {
static_assert(std::is_trivially_destructible_v<T>);
return (T*)
AllocateData(
sizeof(T)); }
Generic, type-safe union.
Definition: value.h:18
uint32_t id_t
Definition: core.h:11
uint32_t message_t
Definition: message.h:11
static message_t GetLast()
Definition: message.cpp:77
static message_t Register(const char *name)
Registers a new message type.
Definition: message.cpp:51
int64_t data_int
Definition: message.h:57
static void Send(const Message &message)
Sends a message.
Definition: message.cpp:110
message_t type
Definition: message.h:51
Value * data_value
Definition: message.h:58
void * data
Definition: message.h:56
static T * AllocateData()
Definition: message.h:47
static void Dispatch()
Dispatches sent messsages.
Definition: message.cpp:83
id_t sender
Definition: message.h:52
id_t receiver
Definition: message.h:53
static T * AllocateData(const T &data)
Definition: message.h:48
static message_t GetType(name_t name)
Finds a message type from a name.
Definition: message.cpp:57
Type
Definition: message.h:17
@ STOP
Definition: message.h:29
@ ACTIVATE
Definition: message.h:30
@ SELECT
Definition: message.h:32
@ UNLOCK
Definition: message.h:24
@ KILL
Definition: message.h:26
@ SET_ANIMATION
Definition: message.h:34
@ TRIGGER
Definition: message.h:27
@ NONE
Definition: message.h:18
@ SET_PROGRESS
Definition: message.h:33
@ CLOSE
Definition: message.h:22
@ PING
Definition: message.h:19
@ TOGGLE
Definition: message.h:25
@ LAST_MESSAGE
Definition: message.h:35
@ ACTIVATE_ONCE
Definition: message.h:31
@ MOVE_PICK_UP
Definition: message.h:20
@ OPEN
Definition: message.h:21
@ START
Definition: message.h:28
@ LOCK
Definition: message.h:23
static name_t GetName(message_t type)
Gets a nessage type name.
Definition: message.cpp:73
static void SetInterceptCallback(void(const Message &))
Definition: message.cpp:139