mn_msg_task.hpp
Go to the documentation of this file.
Definition: mn_mutex.hpp:37
@ Normal
Definition: mn_convar.hpp:55
Definition: mn_convar_task.hpp:42
Extends the basic_convar_task with a message queue support.
Definition: mn_msg_task.hpp:55
mutex_t m_ltMessageQueueLock
Definition: mn_msg_task.hpp:118
void post_msg(message_id msg_id, unsigned int timeout)
Create the task message and add the message to the task queue, without message data.
Definition: mn_msg_task.hpp:85
basic_message_task(std::string strName="message_task", basic_task::priority uiPriority=priority::Normal, unsigned short usStackDepth=MN_THREAD_CONFIG_MINIMAL_STACK_SIZE)
Constructor for this task.
Definition: mn_msg_task.cpp:28
int on_task()
The current message handling code.
Definition: mn_msg_task.cpp:50
void post_msg(message_id msg_id, void *message_data, unsigned int timeout)
Create the task message and add the message to the task queue, with message data.
Definition: mn_msg_task.hpp:96
basic_message_task & operator=(const basic_message_task &)=delete
typename task_message::message_id message_id
Definition: mn_msg_task.hpp:57
virtual void on_message(id_t id, void *message)=0
Implementation of your actual message code.
basic_message_task(const basic_message_task &)=delete
void post_msg(task_message *msg, unsigned int timeout)
Add a pre-created task message to the task queue.
Definition: mn_msg_task.cpp:41
queue::queue_t m_qeMessageQueue
Definition: mn_msg_task.hpp:119
#define MN_THREAD_CONFIG_MINIMAL_STACK_SIZE
Definition: mn_config.hpp:219
Definition: mn_allocator_typetraits.hpp:25
Definition: mn_msg_task.hpp:35
task_message(message_id _id, void *_message=nullptr)
Definition: mn_msg_task.hpp:42