ADTF
3.18.2
|
The Kernel Thread Loop class provides a thread that repeatedly calls the LoopFunc method. More...
Public Types | |
using | tLoopState = adtf_util::cLooper::tLoopState |
Public Member Functions | |
virtual | ~cKernelThreadLoop () |
Destructor. | |
tResult | Create (const char *strName, const adtf::services::IKernel::tSchedulingInfo &sScheduling=adtf::services::IKernel::tSchedulingInfo(), bool bSelfDestruct=false, tLoopState eInitialState=tLoopState::Running) |
Creates the thread that executes the LoopFunc method. More... | |
tResult | Release () |
Destroys the thread. More... | |
tLoopState | GetState () |
Retrieves the current state of the looper. More... | |
tResult | SetState (tLoopState eState, bool bWaitForAck=true) |
Changes the state of the internal looper. More... | |
Protected Member Functions | |
virtual tResult | LoopFunc ()=0 |
Implement this method. More... | |
Private Member Functions | |
void | Loop () |
void | SelfDestruct () |
Private Attributes | |
kernel_thread_looper | m_oLooper |
bool | m_bSelfDestruct |
The Kernel Thread Loop class provides a thread that repeatedly calls the LoopFunc method.
You can change the state of the loop from within the LoopFunc as well.
Definition at line 60 of file kernel_thread_loop.h.
tResult Create | ( | const char * | strName, |
const adtf::services::IKernel::tSchedulingInfo & | sScheduling = adtf::services::IKernel::tSchedulingInfo() , |
||
bool | bSelfDestruct = false , |
||
tLoopState | eInitialState = tLoopState::Running |
||
) |
Creates the thread that executes the LoopFunc method.
[in] | strName | The name of the thread. |
[in] | sScheduling | The scheduling to use. |
[in] | bSelfDestruct | If true, then the thread will release all its resources once the LoopFunc returns an error. Do not call any other methods of the current object after this call! |
[in] | eInitialState | The initial state of the internal looper A_UTILS_NS::cLooper. |
tLoopState GetState | ( | ) |
Retrieves the current state of the looper.
|
protectedpure virtual |
Implement this method.
tResult Release | ( | ) |
Destroys the thread.
Keep in mind that this blocks until LoopFunc returns.
tResult SetState | ( | tLoopState | eState, |
bool | bWaitForAck = true |
||
) |
Changes the state of the internal looper.
[in] | eState | The new state. |
[in] | bWaitForAck | If true, wait until the thread aknowledges the change. |