Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Protected Member Functions
TaskBase Class Referenceabstract

TaskBase. More...

#include <TaskBase.h>

Inheritance diagram for TaskBase:
LinkEntry Task< R()> Task< R(A0)> Task< R(A0, A1)>

Public Member Functions

 TaskBase (TaskQueue *q)
 Construct a new TaskBase object. More...
 
virtual ~TaskBase ()
 Destroy this TaskBase. More...
 
void set (TaskQueue *q)
 Set the queue of this task. More...
 
void cancel ()
 Cancel the execution of this task. More...
 
bool ready ()
 Return true if this task is ready to be posted. More...
 
void wait ()
 Wait for this task to finish execution. More...
 
bool finished ()
 Check if the callback has run to completion or been fully canceled. More...
 

Protected Member Functions

virtual uint32_t size ()=0
 Size of buffer required for TaskBase::start. More...
 
virtual run_callback_t start (void *data, uint32_t size)=0
 Copy any callback data and return a callback to run. More...
 
virtual void finish ()
 Inform this task that execution has finished. More...
 
void post ()
 Post this task to the set TaskQueue for execution. More...
 

Detailed Description

TaskBase.

Representation of a caller allocated task

Definition at line 43 of file TaskBase.h.

Constructor & Destructor Documentation

TaskBase ( TaskQueue q)

Construct a new TaskBase object.

Parameters
qQueue for posting to
virtual ~TaskBase ( )
virtual

Destroy this TaskBase.

Member Function Documentation

void cancel ( )

Cancel the execution of this task.

Once cancelled the task can be posted again. Previous calls to post may still run. If you need to ensure the callback has finished the function wait() can be used.

Note
This function is interrupt safe
virtual void finish ( )
protectedvirtual

Inform this task that execution has finished.

bool finished ( )

Check if the callback has run to completion or been fully canceled.

When an task is finished the queue is completely done with it and the callback is either fully complete or has been canceled and will not run.

Returns
true if this task has been flushed from the queue, false otherwise
void post ( )
protected

Post this task to the set TaskQueue for execution.

bool ready ( )

Return true if this task is ready to be posted.

Check if this task is on a queue waiting to be run.

Returns
true if it is safe to call post
void set ( TaskQueue q)

Set the queue of this task.

Parameters
qTaskQueue to post to
virtual uint32_t size ( )
protectedpure virtual

Size of buffer required for TaskBase::start.

Returns
requested buffer size

Implemented in Task< R(A0, A1)>, Task< R(A0)>, and Task< R()>.

virtual run_callback_t start ( void *  data,
uint32_t  size 
)
protectedpure virtual

Copy any callback data and return a callback to run.

Parameters
dataBuffer to copy data to. Do not copy more than TaskBase::size() data.
sizeMaximum size to copy

Implemented in Task< R(A0, A1)>, Task< R(A0)>, and Task< R()>.

void wait ( )

Wait for this task to finish execution.

When this function returns then this task is in the finished state.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.