NeoPZ
Public Member Functions | Protected Types | Protected Attributes | Private Attributes | Friends | List of all members
TPZTask Class Reference

Helper class for ordering the tasks that the user have requested. More...

#include <TPZTask.h>

Inheritance diagram for TPZTask:
[legend]
Collaboration diagram for TPZTask:
[legend]

Public Member Functions

 TPZTask (const int priority, TPZAutoPointer< std::packaged_task< void(void)>> &task, TPZTaskGroup *taskGroup=NULL)
 
int priority () const
 
virtual void start ()
 
virtual void Cancel ()
 
virtual ~TPZTask ()
 

Protected Types

enum  EProcessingState { CREATED, SCHEDULED, STARTED, FINISHED }
 

Protected Attributes

TPZAutoPointer< std::packaged_task< void(void)> > mTask
 
EProcessingState mState
 
TPZTaskGroupmTaskGroup
 

Private Attributes

bool mSystemTask
 
int mPriority
 

Friends

struct TPZTaskOrdering
 
class TPZThreadPool
 

Detailed Description

Helper class for ordering the tasks that the user have requested.

Definition at line 18 of file TPZTask.h.

Member Enumeration Documentation

◆ EProcessingState

enum TPZTask::EProcessingState
protected
Enumerator
CREATED 
SCHEDULED 
STARTED 
FINISHED 

Definition at line 31 of file TPZTask.h.

Constructor & Destructor Documentation

◆ TPZTask()

TPZTask::TPZTask ( const int  priority,
TPZAutoPointer< std::packaged_task< void(void)>> &  task,
TPZTaskGroup taskGroup = NULL 
)

Definition at line 12 of file TPZTask.cpp.

References TPZTaskGroup::RegisterTask().

Referenced by TPZThreadPool::appendTaskToQueue().

◆ ~TPZTask()

TPZTask::~TPZTask ( )
virtual

Definition at line 43 of file TPZTask.cpp.

Member Function Documentation

◆ Cancel()

void TPZTask::Cancel ( )
virtual

Definition at line 36 of file TPZTask.cpp.

References mTaskGroup, and TPZTaskGroup::Notify().

Referenced by TPZThreadPool::threadsLoop().

◆ priority()

int TPZTask::priority ( ) const

◆ start()

void TPZTask::start ( )
virtual

Reimplemented in TPZReschedulableTask.

Definition at line 27 of file TPZTask.cpp.

References mState, mTaskGroup, and TPZTaskGroup::Notify().

Referenced by TPZReschedulableTask::startInternal(), and TPZThreadPool::threadsLoop().

Friends And Related Function Documentation

◆ TPZTaskOrdering

friend struct TPZTaskOrdering
friend

Definition at line 27 of file TPZTask.h.

◆ TPZThreadPool

friend class TPZThreadPool
friend

Definition at line 28 of file TPZTask.h.

Member Data Documentation

◆ mPriority

int TPZTask::mPriority
private

Definition at line 44 of file TPZTask.h.

Referenced by priority(), and TPZThreadPool::runNow().

◆ mState

EProcessingState TPZTask::mState
protected

◆ mSystemTask

bool TPZTask::mSystemTask
private

Definition at line 43 of file TPZTask.h.

Referenced by TPZThreadPool::appendTaskToQueue(), and TPZTaskOrdering::operator()().

◆ mTask

TPZAutoPointer<std::packaged_task<void(void)> > TPZTask::mTask
protected

Definition at line 38 of file TPZTask.h.

Referenced by TPZThreadPool::run(), and TPZThreadPool::runNow().

◆ mTaskGroup

TPZTaskGroup* TPZTask::mTaskGroup
protected

Definition at line 41 of file TPZTask.h.

Referenced by Cancel(), and start().


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