libhatchet
Loading...
Searching...
No Matches
hxtask Class Referenceabstract

#include <hxtask.hpp>

Public Member Functions

virtual bool execute (hxtask_queue *)=0
virtual void on_completion (hxtask_queue *)
virtual void on_failure (hxtask_queue *)
virtual void on_cancel (hxtask_queue *)
virtual const char * get_label (void) const

Friends

class hxtask_queue

Detailed Description

hxtask - Pure virtual base class for operations to be performed on a different thread or at a later time.

Member Function Documentation

◆ execute()

virtual bool hxtask::execute ( hxtask_queue * )
pure virtual

Executes the task.

This is the main function to implement in derived classes. It is also wrapped in a hxprofiler scope when called. Returns true on success or false on failure.

  • q : Pointer to the task queue managing this task.

◆ get_label()

virtual const char * hxtask::get_label ( void ) const
inlinevirtual

Returns the label of the task, or "task" by default.

◆ on_cancel()

virtual void hxtask::on_cancel ( hxtask_queue * )
inlinevirtual

Indicates cancelled execution.

This call is the last time this object is touched by the hxtask_queue. WARNING: on_cancel may not reenqueue.

  • q : Pointer to the task queue managing this task.

Reimplemented in hxtask_dag_node< max_successors_ >.

◆ on_completion()

virtual void hxtask::on_completion ( hxtask_queue * )
inlinevirtual

Indicates successful execution.

This call is the last time this object is touched by the hxtask_queue. An on_completion override may delete or re-enqueue the this pointer.

  • q : Pointer to the task queue managing this task.

Reimplemented in hxtask_dag_node< max_successors_ >.

◆ on_failure()

virtual void hxtask::on_failure ( hxtask_queue * )
inlinevirtual

Indicates failed execution.

This call is the last time this object is touched by the hxtask_queue. An on_failure override may delete or re-enqueue the this pointer.

  • q : Pointer to the task queue managing this task.

Reimplemented in hxtask_dag_node< max_successors_ >.

◆ hxtask_queue

friend class hxtask_queue
friend

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