Nebula
|
#include <runthroughhandlerthread.h>
A simple handler thread class which "runs thru", and doesn't wait for messages.
This is the "old behaviour" of the N3 render thread.
Inherits Messaging::HandlerThreadBase.
Public Member Functions | |
RunThroughHandlerThread () | |
constructor | |
virtual void | AddMessage (const Ptr< Message > &msg) |
add a message to be handled (override in subclass!) | |
virtual void | CancelMessage (const Ptr< Message > &msg) |
cancel a pending message (override in subclass!) | |
virtual void | DoWork () |
this method runs in the thread context | |
Public Member Functions inherited from Messaging::HandlerThreadBase | |
HandlerThreadBase () | |
constructor | |
void | AttachHandler (const Ptr< Handler > &h) |
attach a message handler | |
void | RemoveHandler (const Ptr< Handler > &h) |
dynamically remove a message handler | |
void | ClearHandlers () |
clear all attached message handlers | |
void | WaitForHandlersOpened () |
wait until handlers have been opened | |
virtual void | WaitForMessage (const Ptr< Message > &msg) |
wait for message to be handled (optionally override in subclass!) | |
Private Member Functions | |
__DeclareClass (RunThroughHandlerThread) | |
Private Attributes | |
Threading::SafeQueue< Ptr< Message > > | msgQueue |
Additional Inherited Members | |
Protected Member Functions inherited from Messaging::HandlerThreadBase | |
void | ThreadOpenHandlers () |
open message handlers | |
void | ThreadCloseHandlers () |
close message handlers | |
void | ThreadUpdateHandlers () |
open dynamically added handlers, and call DoWork() on all attached handlers | |
bool | ThreadUpdateDeferredMessages () |
update deferred messages, return true if at least one message has been handled | |
void | ThreadDiscardDeferredMessages () |
clear leftover deferred messages | |
bool | ThreadHandleMessages (const Util::Array< Ptr< Message > > &msgArray) |
handle messages in array, return true if at least one message has been handled | |
bool | ThreadHandleSingleMessage (const Ptr< Message > &msg) |
handle a single message without deferred support, return if message has been handled | |
void | ThreadSignalMessageHandled () |
signal message handled event (only call if at least one message has been handled) | |
Protected Attributes inherited from Messaging::HandlerThreadBase | |
Threading::Event | msgHandledEvent |
Threading::Event | handlersOpenedEvent |
Threading::CriticalSection | handlersCritSect |
Util::Array< Ptr< Handler > > | handlers |
Util::Array< Ptr< Message > > | deferredMessages |
Messaging::RunThroughHandlerThread::RunThroughHandlerThread | ( | ) |
constructor
|
private |
add a message to be handled (override in subclass!)
This adds a new message to the thread's message queue.
Reimplemented from Messaging::HandlerThreadBase.
cancel a pending message (override in subclass!)
This removes a message from the thread's message queue, regardless of its state.
Reimplemented from Messaging::HandlerThreadBase.
|
virtual |
this method runs in the thread context
The message processing loop.
|
private |