|
DelegateMQ
|
A base class for a delegate enabled execution thread. Implemented by application code if asynchronous delegates are used. More...
#include <IThread.h>
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. | |
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.
|
virtualdefault |
Destructor.
|
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.
| [in] | msg | A 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.