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

#include <TPZReschedulableTask.h>

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

Public Member Functions

std::shared_future< void > GetFuture ()
 
- Public Member Functions inherited from TPZTask
 TPZTask (const int priority, TPZAutoPointer< std::packaged_task< void(void)>> &task, TPZTaskGroup *taskGroup=NULL)
 
int priority () const
 
virtual void Cancel ()
 
virtual ~TPZTask ()
 

Protected Member Functions

 TPZReschedulableTask (const int priority, TPZAutoPointer< std::packaged_task< void(void)>> task, TPZTaskGroup *taskGroup=NULL)
 
virtual void startInternal ()
 
virtual void start ()
 

Protected Attributes

std::mutex mStateMutex
 
- Protected Attributes inherited from TPZTask
TPZAutoPointer< std::packaged_task< void(void)> > mTask
 
EProcessingState mState
 
TPZTaskGroupmTaskGroup
 

Private Attributes

std::shared_future< void > mFuture
 
std::condition_variable mCondition
 

Friends

class TPZThreadPool
 

Additional Inherited Members

- Protected Types inherited from TPZTask
enum  EProcessingState { CREATED, SCHEDULED, STARTED, FINISHED }
 

Detailed Description

Definition at line 8 of file TPZReschedulableTask.h.

Constructor & Destructor Documentation

◆ TPZReschedulableTask()

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

Definition at line 12 of file TPZReschedulableTask.cpp.

Member Function Documentation

◆ GetFuture()

std::shared_future< void > TPZReschedulableTask::GetFuture ( )

Definition at line 17 of file TPZReschedulableTask.cpp.

References mFuture.

◆ start()

void TPZReschedulableTask::start ( )
protectedvirtual

Reimplemented from TPZTask.

Definition at line 25 of file TPZReschedulableTask.cpp.

References mCondition, TPZTask::mState, mStateMutex, TPZTask::SCHEDULED, and startInternal().

◆ startInternal()

void TPZReschedulableTask::startInternal ( )
protectedvirtual

Definition at line 21 of file TPZReschedulableTask.cpp.

References TPZTask::start().

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

Friends And Related Function Documentation

◆ TPZThreadPool

friend class TPZThreadPool
friend

Definition at line 10 of file TPZReschedulableTask.h.

Member Data Documentation

◆ mCondition

std::condition_variable TPZReschedulableTask::mCondition
private

Definition at line 28 of file TPZReschedulableTask.h.

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

◆ mFuture

std::shared_future<void> TPZReschedulableTask::mFuture
private

Definition at line 27 of file TPZReschedulableTask.h.

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

◆ mStateMutex

std::mutex TPZReschedulableTask::mStateMutex
protected

Definition at line 23 of file TPZReschedulableTask.h.

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


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