#include <acsThread.h>
Inheritance diagram for ACS::Thread:
Public Member Functions | |
Thread (const ACE_CString &name, const TimeInterval &responseTime=ThreadBase::defaultResponseTime, const TimeInterval &sleepTime=ThreadBase::defaultSleepTime, const bool del=false, const long _thrFlags=THR_NEW_LWP|THR_DETACHED, const size_t stackSize=ACE_DEFAULT_THREAD_STACKSIZE) | |
virtual | ~Thread () |
virtual void | onStart () |
virtual void | onStop () |
virtual void | commonStart () |
virtual void | commonStop () |
virtual void | run () |
virtual void | runLoop () |
Protected Member Functions | |
virtual Logging::Logger::LoggerSmartPtr | getLogger () |
ACS::ThreadManager * | getThreadManager () |
Static Protected Member Functions | |
void | threadSvc (void *param) |
Protected Attributes | |
LoggingProxy * | logger_mp |
ponter to Logging proxy | |
ACS::ThreadManager * | thrMgr_mp |
Pointer to thread manager. | |
Private Member Functions | |
void | operator= (const Thread &) |
Thread (const Thread &) | |
Private Attributes | |
bool | delete_m |
The Thread class is ment to be used with the support of a ThreaManager.
It is possible to use it without a ThreadManager, but you have to be careful and read accurately this documentation to be aware of things you have to be careful with.
|
Constructor of the Thread class. If someone wants to set thread parameters, s/he has to send these parameters from the constructor of the derived class up to the base class.
|
|
Thread destructor. |
|
ALMA C++ coding standards state copy constructors should be disabled. |
|
This method performs basic thread initialization, common to all threads. It is called by threadSvc and call the user hook onStart. The common initialization performs the initialization of the logging system, which has to be done on a per thread base. It shall not be overridden unless it is really necessary (for example. user does not like what is done for common initialization). In most cases if should be sufficient to override of onStart. |
|
This method performs basic thread cleanup, common to all threads. It is called by threadSvc and call the user hook onStop. The common cleanup performs the cleanup of the logging system, which has to be done on a per thread base. It shall not be overridden unless it is really necessary (for example. user does not like what is done for common cleanup). In most cases if should be sufficient to override of onStop. |
|
Overrides getLogger from ThreadBase. Returns the logger. In the case a thread manager is used, the logger is from the component. |
|
Returns pointer to the thread manager responsible for this thread. |
|
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 in RequestProcessorThread, ControllerThread, and DoorThread.
|
|
Method which is executed after the body of the thread, i.e. after the thread execution. It is the hook method for a user that wants to do some cleanup after the thread execution (thread cleanup), s/he has to override/implement this method in the implementation class. It is called by commonStop Reimplemented in DoorThread.
|
|
ALMA C++ coding standards state assignment operators should be disabled. |
|
Basic used hook to implement the thread functionality. The provided default implementation executes the method runLoop in a loop, to provide periodic loops. If a user wants that his/her thread function is executed periodically, s/he has to override the runLoop. Between two iterations the runLoop sleeps for #responseTime 100ns If a user wants that his/her thread function is executed only once, s/he has to override this method. Reimplemented in SenderThread.
|
|
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 in PositionControlThread, PositionControlThread, RequestProcessorThread, ControllerThread, DoorThread, FridgeThread, SamplingThread<>, SamplingThreadFlush<>, TestACSThread, SamplingThread< ACS_SAMP_TL >, and SamplingThreadFlush< ACS_SAMP_TL >.
|
|
Static method which is passed to the ACE thread manager which than spawns the thread. This is the actual thread service function. It executes:
|
|
flag that indicates if thread should be deleted after the thread exits |
|
ponter to Logging proxy
|
|
Pointer to thread manager.
|