10 #include "tb_linklist.h"
12 #include "tb_object.h"
17 class TBMessageHandler;
21 #define TB_NOT_SOON 0xffffffff
TBLinkListOf is a double linked linklist.
Definition: tb_linklist.h:122
void DeleteAllMessages()
Delete all messages from this message handler.
Definition: tb_msg.cpp:132
TBID id1
Use for anything.
Definition: tb_msg.h:34
double GetFireTime()
The time which a delayed message should have fired (0 for non delayed messages)
Definition: tb_msg.h:58
TBValue v1
Use for anything.
Definition: tb_msg.h:32
TBMessageData * data
The message data, or nullptr if no data is set.
Definition: tb_msg.h:55
TBMessage * GetMessageByID(TBID message)
Check if this messagehandler has a pending message with the given id.
Definition: tb_msg.cpp:104
static double GetNextMessageFireTime()
Get when the time when ProcessMessages needs to be called again.
Definition: tb_msg.cpp:176
TBID id2
Use for anything.
Definition: tb_msg.h:35
TBID is a wrapper for a uint32_t to be used as ID.
Definition: tb_id.h:18
TBValue v2
Use for anything.
Definition: tb_msg.h:33
Definition: tb_object.h:21
TBMessageHandler handles a list of pending messages posted to itself.
Definition: tb_msg.h:72
bool PostMessageOnTime(TBID message, TBMessageData *data, double fire_time)
Posts a message to the target at the given time (relative to TBSystem::GetTimeMS()).
Definition: tb_msg.cpp:46
TBID message
The message id.
Definition: tb_msg.h:54
TBValue holds value of a specific type.
Definition: tb_value.h:59
TBMessage is a message created and owned by TBMessageHandler.
Definition: tb_msg.h:47
Definition: tb_linklist.h:83
void DeleteMessage(TBMessage *msg)
Delete the message from this message handler.
Definition: tb_msg.cpp:113
virtual void OnMessageReceived(TBMessage *)
Called when a message is delivered.
Definition: tb_msg.h:108
bool PostMessageDelayed(TBID message, TBMessageData *data, uint32_t delay_in_ms)
Posts a message to the target after a delay.
Definition: tb_msg.cpp:41
TBMessageData holds custom data to send with a posted message.
Definition: tb_msg.h:25
bool PostMessage(TBID message, TBMessageData *data)
Posts a message to the target.
Definition: tb_msg.cpp:88
TBMessageLink should never be created or subclassed anywhere except in TBMessage. ...
Definition: tb_msg.h:41
static void ProcessMessages()
Process any messages in queue.
Definition: tb_msg.cpp:139