ADTF
Loading...
Searching...
No Matches
adtf::system::cKernelThreadLoop Class Referenceabstract

#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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~cKernelThreadLoop()

virtual adtf::system::cKernelThreadLoop::~cKernelThreadLoop ( )
virtual

Destructor

Member Function Documentation

◆ Create()

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.

Parameters
[in]strNameThe name of the thread.
[in]sSchedulingThe scheduling to use.
[in]bSelfDestructIf 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]eInitialStateThe initial state of the internal looper A_UTILS_NS::cLooper.
Returns
Standard result.

◆ GetState()

tLoopState adtf::system::cKernelThreadLoop::GetState ( )

Retrieves the current state of the looper.

Returns
the current state of the looper.

◆ LoopFunc()

virtual tResult adtf::system::cKernelThreadLoop::LoopFunc ( )
protectedpure virtual

Implement this method.

Returns
Any error will stop the looper, but the thread will still be alive and wait for state changes.

◆ Release()

tResult adtf::system::cKernelThreadLoop::Release ( )

Destroys the thread.

Keep in mind that this blocks until LoopFunc returns.

Returns
Standard result.

◆ SetState()

tResult adtf::system::cKernelThreadLoop::SetState ( tLoopState eState,
bool bWaitForAck = true )

Changes the state of the internal looper.

Parameters
[in]eStateThe new state.
[in]bWaitForAckIf true, wait until the thread aknowledges the change.
Returns
Standard result.

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