DelegateMQ
Loading...
Searching...
No Matches
dmq::IThread Class Referenceabstract

A base class for a delegate enabled execution thread. Implemented by application code if asynchronous delegates are used. More...

#include <IThread.h>

Inheritance diagram for dmq::IThread:
Thread Thread Thread Thread Thread Thread

Public Member Functions

virtual ~IThread ()=default
 Destructor.
 
virtual void DispatchDelegate (std::shared_ptr< DelegateMsg > msg)=0
 Enqueues a delegate message for execution on this thread.
 

Detailed Description

A base class for a delegate enabled execution thread. Implemented by application code if asynchronous delegates are used.

@TODO Implement the IThread interface if necessary.

Each platform specific implementation must inherit from IThread and provide an implementation for DispatchDelegate(). The DispatchDelegate() function is called by the source thread to initiate an asynchronous function call onto the destination thread of control.

Constructor & Destructor Documentation

◆ ~IThread()

virtual dmq::IThread::~IThread ( )
virtualdefault

Destructor.

Member Function Documentation

◆ DispatchDelegate()

virtual void dmq::IThread::DispatchDelegate ( std::shared_ptr< DelegateMsg > msg)
pure virtual

Enqueues a delegate message for execution on this thread.

This function is called by the source thread (the caller). The implementation must thread-safely transfer ownership of the msg into the target thread's processing queue.

Once the message is received by the target thread's main loop, that loop is responsible for calling IInvoker::Invoke(msg) to actually execute the function.

Parameters
[in]msgA shared pointer to the delegate message. This pointer must remain valid until the target thread finishes execution.

Implemented in Thread, Thread, Thread, Thread, Thread, and Thread.


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