Plasma Engine  2.0
Loading...
Searching...
No Matches
plMessageLoop Class Referenceabstract

Internal sub-system used by plIpcChannel. More...

#include <MessageLoop.h>

Inheritance diagram for plMessageLoop:

Public Member Functions

void AddChannel (plIpcChannel *pChannel)
 Needs to be called by newly created channels' constructors.
 
void RemoveChannel (plIpcChannel *pChannel)
 

Protected Member Functions

 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND (Foundation, MessageLoop)
 
void StartUpdateThread ()
 
void StopUpdateThread ()
 
void RunLoop ()
 
bool ProcessTasks ()
 
void Quit ()
 
virtual void WakeUp ()=0
 Wake up the message loop when new work comes in.
 
virtual bool WaitForMessages (plInt32 iTimeout, plIpcChannel *pFilter)=0
 Waits until a new message has been processed (sent, received).
 

Protected Attributes

plThreadID m_ThreadId = 0
 
plMutex m_Mutex
 
bool m_bShouldQuit = false
 
bool m_bCallTickFunction = false
 
class plLoopThread * m_pUpdateThread = nullptr
 
plMutex m_TasksMutex
 
plDynamicArray< plIpcChannel * > m_ConnectQueue
 
plDynamicArray< plIpcChannel * > m_DisconnectQueue
 
plDynamicArray< plIpcChannel * > m_SendQueue
 
plDynamicArray< plIpcChannel * > m_ConnectQueueTask
 
plDynamicArray< plIpcChannel * > m_DisconnectQueueTask
 
plDynamicArray< plIpcChannel * > m_SendQueueTask
 
plDynamicArray< plIpcChannel * > m_AllAddedChannels
 

Friends

class plLoopThread
 
class plIpcChannel
 

Detailed Description

Internal sub-system used by plIpcChannel.

This sub-system creates a background thread as soon as the first plIpcChannel is added to it. This class should never be needed to be accessed outside of plIpcChannel implementations.

Member Function Documentation

◆ WaitForMessages()

virtual bool plMessageLoop::WaitForMessages ( plInt32 iTimeout,
plIpcChannel * pFilter )
protectedpure virtual

Waits until a new message has been processed (sent, received).

Parameters
timeoutIf negative, wait indefinitely.
pFilterIf not null, wait for a message for the specific channel.
Returns
Returns whether a message was received or the timeout was reached.

Implemented in plMessageLoop_Fallback.

◆ WakeUp()

virtual void plMessageLoop::WakeUp ( )
protectedpure virtual

Wake up the message loop when new work comes in.

Implemented in plMessageLoop_Fallback.


The documentation for this class was generated from the following files: