17#ifndef __albaAgentThreaded_h
18#define __albaAgentThreaded_h
131 HANDLE m_MessageSignal;
MCH_UP
channel used to send events up in the tree
long albaID
type for IDs inside ALBA
#define mmuThreadInfoStruct
This is the structure that is passed to the thread that is created from the SingleMethodExecute,...
Base class for managing event queueing and synchronized dispatching.
An agent processing the queued events on a separate thread.
int GetActiveFlag()
Get the present value of the Thread Active flag.
static void UpdateLoop(mmuThreadInfoStruct *data)
This function is used to startup the thread.
ALBA_ID_DEC(AGENT_ASYNC_DISPATCH)
virtual int InternalInitialize()
This function is overridden by subclasses to perform custom initialization.
virtual int InternalUpdate()
This function must be overridden by subclasses to perform custom polling of dispatcher when in thread...
void AsyncSendEvent(albaObserver *target, albaEventBase *event, albaID channel=MCH_UP)
Send an event to the specified object (i.e.
virtual ~albaAgentThreaded()
void SignalNewMessage()
Internal functions used to send a wakeup signal among the different threads.
void SetThreaded(int flag)
This is used to enable thread spawning for this Agent.
virtual void InternalShutdown()
to be redefined by subclasses to define the shutdown actions
virtual void OnEvent(albaEventBase *event)
This function enques events to be processed by agent.
int GetThreaded()
Return true if this is a Agent with its own polling thread.
albaTypeMacro(albaAgentThreaded, albaAgentEventQueue)
mmuThreadInfoStruct * m_ThreadData
void AsyncSendEvent(albaObserver *target, void *sender, albaID id, albaID channel=MCH_UP, void *data=NULL)
void AsyncInvokeEvent(albaEventBase *event, albaID channel=MCH_UP)
This function implements asynchronous forward of an event.
void AsyncInvokeEvent(albaID id, albaID channel=MCH_UP, void *data=NULL)
albaMutexLock * m_Gate
This mutex is normally locked.
albaMultiThreader * m_Threader
int Update()
This function forces the agent to update its state.
virtual void RequestForDispatching()
Internal function used to request the dispatching.
int IsInitialized()
Return true if this agent has been initialized.
Implementation of the message object for the Subject/Observer design pattern.
albaMultiThreader - A class for performing multithreaded execution.
Critical section locking class that can be allocated on the stack.
Interface implementing the Observer of the Subject/Observer design pattern.