#include <ActiveObject.h>
Public Member Functions | |
ActiveObject (const icl_core::String &description, icl_core::ThreadPriority priority=0) | |
virtual void | onThreadStart () |
virtual void | onThreadStop () |
virtual void | run () |
void | stop () |
Protected Member Functions | |
void | queue (ActiveOperation *active_operation) |
Protected Attributes | |
icl_core::List< ActiveOperation * > | m_operation_queue |
Mutex | m_operation_queue_mutex |
Semaphore | m_sem |
Implements the generic part of the "Active Object" pattern.
Definition at line 43 of file ActiveObject.h.
icl_core::thread::ActiveObject::ActiveObject | ( | const icl_core::String & | description, |
icl_core::ThreadPriority | priority = 0 |
||
) |
Initialize an active object with a description and thread priority.
Definition at line 28 of file ActiveObject.cpp.
virtual void icl_core::thread::ActiveObject::onThreadStart | ( | ) | [inline, virtual] |
Subclasses can override this virtual function if they need to do some processing in the active object thread before the thread starts to process the operation queue.
Definition at line 61 of file ActiveObject.h.
virtual void icl_core::thread::ActiveObject::onThreadStop | ( | ) | [inline, virtual] |
Subclasses can override this virtual function if they need to do some processing after the active object thread has stopped to process the operation queue but before the thread stops.
Definition at line 67 of file ActiveObject.h.
void icl_core::thread::ActiveObject::queue | ( | ActiveOperation * | active_operation | ) | [protected] |
Queue a new active operation for future execution.
Definition at line 81 of file ActiveObject.cpp.
void icl_core::thread::ActiveObject::run | ( | ) | [virtual] |
Processes the operation queue. This function should not be overridden by subclasses.
Implements icl_core::thread::Thread.
Definition at line 34 of file ActiveObject.cpp.
void icl_core::thread::ActiveObject::stop | ( | ) |
Stop the active object thread.
Reimplemented from icl_core::thread::Thread.
Definition at line 75 of file ActiveObject.cpp.
Definition at line 88 of file ActiveObject.h.
Definition at line 89 of file ActiveObject.h.
Semaphore icl_core::thread::ActiveObject::m_sem [protected] |
Definition at line 90 of file ActiveObject.h.