|
ADTF
|
#include <kernel_thread_loop.h>
Public Types | |
| using | tLoopState = adtf_util::cLooper::tLoopState |
Public Member Functions | |
| virtual | ~cKernelThreadLoop () |
| tResult | Create (const char *strName, const adtf::services::IKernel::tSchedulingInfo &sScheduling=adtf::services::IKernel::tSchedulingInfo(), bool bSelfDestruct=false, tLoopState eInitialState=tLoopState::Running) |
| tResult | Release () |
| tLoopState | GetState () |
| tResult | SetState (tLoopState eState, bool bWaitForAck=true) |
Protected Member Functions | |
| virtual tResult | LoopFunc ()=0 |
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.
|
virtual |
Destructor
| tResult adtf::system::cKernelThreadLoop::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 adtf::system::cKernelThreadLoop::GetState | ( | ) |
Retrieves the current state of the looper.
|
protectedpure virtual |
Implement this method.
| tResult adtf::system::cKernelThreadLoop::Release | ( | ) |
Destroys the thread.
Keep in mind that this blocks until LoopFunc returns.
| tResult adtf::system::cKernelThreadLoop::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. |