Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
icl_core::thread::ActiveObject Class Reference

#include <ActiveObject.h>

Inheritance diagram for icl_core::thread::ActiveObject:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from icl_core::thread::Thread
void cancel ()
 
bool checkHardRealtime ()
 
bool execute () const
 
bool executesHardRealtime () const
 
icl_core::String getDescription () const
 
bool isHardRealtime () const
 
void join ()
 
virtual void onStop ()
 
icl_core::ThreadPriority priority () const
 
bool running () const
 
void setDescription (const icl_core::String &description)
 
bool setHardRealtime (bool hard_realtime=true)
 
bool setPriority (icl_core::ThreadPriority priority)
 
bool start ()
 
void stop ()
 
 Thread (const icl_core::String &description, icl_core::ThreadPriority priority=0)
 
icl_core::ThreadId threadId () const
 
const char * threadInfo () const
 
bool threadSelf () const
 
bool wait ()
 
bool wait (const icl_core::TimeStamp &timeout)
 
bool wait (const icl_core::TimeSpan &timeout)
 
virtual ~Thread ()
 

Protected Member Functions

void queue (ActiveOperation *active_operation)
 
- Protected Member Functions inherited from icl_core::Noncopyable
 Noncopyable ()
 
virtual ~Noncopyable ()
 

Protected Attributes

icl_core::List< ActiveOperation * > m_operation_queue
 
Mutex m_operation_queue_mutex
 
Semaphore m_sem
 

Additional Inherited Members

- Static Public Member Functions inherited from icl_core::thread::Thread
static icl_core::ThreadId selfId ()
 

Detailed Description

Implements the generic part of the "Active Object" pattern.

Definition at line 43 of file ActiveObject.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

virtual void icl_core::thread::ActiveObject::onThreadStart ( )
inlinevirtual

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 ( )
inlinevirtual

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.

Definition at line 75 of file ActiveObject.cpp.

Member Data Documentation

icl_core::List<ActiveOperation*> icl_core::thread::ActiveObject::m_operation_queue
protected

Definition at line 88 of file ActiveObject.h.

Mutex icl_core::thread::ActiveObject::m_operation_queue_mutex
protected

Definition at line 89 of file ActiveObject.h.

Semaphore icl_core::thread::ActiveObject::m_sem
protected

Definition at line 90 of file ActiveObject.h.


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


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59