Public Member Functions | Private Attributes

ControllerThread Class Reference

#include <acsServiceController.h>

Inheritance diagram for ControllerThread:
Inheritance graph
[legend]
Collaboration diagram for ControllerThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ControllerThread (const ACE_CString &name, const ACS::TimeInterval &responseTime=ThreadBase::defaultResponseTime, const ACS::TimeInterval &sleepTime=ThreadBase::defaultSleepTime)
 ~ControllerThread ()
void setContext (ACSDaemonContext *icontext)
void onStart ()
void stop ()
void exit ()
void runLoop () throw ((CORBA::SystemException, ::ACSErrTypeCommon::BadParameterEx))

Private Attributes

ACSDaemonContextcontext
ACE_Thread_Mutex * m_mutex
ACE_Condition< ACE_Thread_Mutex > * m_wait
volatile bool running

Constructor & Destructor Documentation

ControllerThread::ControllerThread ( const ACE_CString &  name,
const ACS::TimeInterval &  responseTime = ThreadBase::defaultResponseTime,
const ACS::TimeInterval &  sleepTime = ThreadBase::defaultSleepTime 
)
ControllerThread::~ControllerThread (  ) 

Member Function Documentation

void ControllerThread::exit (  )  [virtual]

Notify thread to exit thread worker function. Thread worker function should always exit when this notification was issued. See example of usage.

Reimplemented from ACS::ThreadBase.

void ControllerThread::onStart (  )  [virtual]

Method which is executed before the body of the thread. It is the hook method for a user that wants to do some initialization before the thread execution (thread initialization), s/he has to override/implement this method in the implementation class. It is called by commonStart

Reimplemented from ACS::Thread.

void ControllerThread::runLoop (  )  throw ((CORBA::SystemException, ::ACSErrTypeCommon::BadParameterEx)) [virtual]

Basic used hook to implement the thread functionality in a periodic loop. The method is executed in a loop until the thread is alive and every responseTime 100ns by the run method. The thread can be exited from the lop by calling ACS::ThreadBase::stop or ACS::ThreadBase::exit command. If the run method is overridden than runLoop is not executed.

Reimplemented from ACS::Thread.

void ControllerThread::setContext ( ACSDaemonContext icontext  )  [inline]

References context.

void ControllerThread::stop (  ) 

Member Data Documentation

Referenced by setContext().

ACE_Thread_Mutex* ControllerThread::m_mutex [private]
ACE_Condition<ACE_Thread_Mutex>* ControllerThread::m_wait [private]
volatile bool ControllerThread::running [private]

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