Public Member Functions | Private Attributes | Friends | List of all members
xsens::ThreadPoolTask Class Referenceabstract

A generic task implementation for the thread pool. More...

#include <xsens_threadpool.h>

Inheritance diagram for xsens::ThreadPoolTask:
Inheritance graph
[legend]

Public Member Functions

virtual bool exec ()=0
 
bool isCanceling () const
 Returns true if the task has been told to cancel itself. More...
 
virtual unsigned int needToWaitFor ()
 This function gets called by PooledThread when the exec() function returns false to determine if we should wait for a specific task. More...
 
unsigned int taskId () const
 Returns the task ID of the task or 0 if it doesn't have a proper ID (yet) More...
 
 ThreadPoolTask ()
 
virtual ~ThreadPoolTask ()
 

Private Attributes

PooledTaskm_container
 

Friends

class ThreadPool
 

Detailed Description

A generic task implementation for the thread pool.

Definition at line 82 of file xsens_threadpool.h.

Constructor & Destructor Documentation

◆ ThreadPoolTask()

xsens::ThreadPoolTask::ThreadPoolTask ( )
inline

Definition at line 87 of file xsens_threadpool.h.

◆ ~ThreadPoolTask()

virtual xsens::ThreadPoolTask::~ThreadPoolTask ( )
inlinevirtual

Definition at line 88 of file xsens_threadpool.h.

Member Function Documentation

◆ exec()

virtual bool xsens::ThreadPoolTask::exec ( )
pure virtual
Returns
True if the task completed or false to reschedule the task

Implemented in Xs4FileTask, xsens::ThreadPoolObjectDeleter< T >, and xsens::TaskCompletionWaiter.

◆ isCanceling()

bool xsens::ThreadPoolTask::isCanceling ( ) const

Returns true if the task has been told to cancel itself.

Definition at line 188 of file xsens_threadpool.cpp.

◆ needToWaitFor()

unsigned int xsens::ThreadPoolTask::needToWaitFor ( )
virtual

This function gets called by PooledThread when the exec() function returns false to determine if we should wait for a specific task.

The default implementation returns 0 (no id to wait for)

Returns
False to determine if we should wait for a specific task

Reimplemented in xsens::TaskCompletionWaiter.

Definition at line 119 of file xsens_threadpool.cpp.

◆ taskId()

unsigned int xsens::ThreadPoolTask::taskId ( ) const

Returns the task ID of the task or 0 if it doesn't have a proper ID (yet)

Definition at line 196 of file xsens_threadpool.cpp.

Friends And Related Function Documentation

◆ ThreadPool

friend class ThreadPool
friend

Definition at line 94 of file xsens_threadpool.h.

Member Data Documentation

◆ m_container

PooledTask* xsens::ThreadPoolTask::m_container
private

Definition at line 95 of file xsens_threadpool.h.


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


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:23