TwiceAsNice  2019-02-18
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Nice::TaskControl Class Referenceabstract

This class contains common behaviour of a TaskControl object. More...

#include <TaskControl.h>

Inheritance diagram for Nice::TaskControl:
Inheritance graph
Collaboration diagram for Nice::TaskControl:
Collaboration graph

Public Member Functions

virtual ~TaskControl ()=0
 
void init ()
 initializes the object. More...
 
virtual void cancelTask ()
 
virtual bool isCancelled ()
 
virtual void executeTask ()
 
virtual bool isDone ()
 
virtual void waitUntilEndOfTask ()
 

Protected Member Functions

void setTask (TaskPtr task)
 

Private Types

enum  State { STATE_READY = 0, STATE_DONE = 1, STATE_RUNNING = 2, STATE_CANCELLED = 3 }
 

Private Member Functions

bool isTaskStillExecutable ()
 
void goToRunningStateIfPossible ()
 
bool isEndOfTask ()
 
void changeStateTo (State newState)
 

Private Attributes

volatile State state_
 
TaskPtr task_
 
Nice::Monitor stateChanging_
 

Detailed Description

This class contains common behaviour of a TaskControl object.

Note
thread-safe

Member Enumeration Documentation

◆ State

Enumerator
STATE_READY 
STATE_DONE 
STATE_RUNNING 
STATE_CANCELLED 

Constructor & Destructor Documentation

◆ ~TaskControl()

Nice::TaskControl::~TaskControl ( )
pure virtual

Member Function Documentation

◆ cancelTask()

void Nice::TaskControl::cancelTask ( )
virtual

◆ changeStateTo()

void Nice::TaskControl::changeStateTo ( State  newState)
private

◆ executeTask()

void Nice::TaskControl::executeTask ( )
virtual

◆ goToRunningStateIfPossible()

void Nice::TaskControl::goToRunningStateIfPossible ( )
private

◆ init()

void Nice::TaskControl::init ( )

initializes the object.

Note
this method has to be called after setTask(TaskPtr).

◆ isCancelled()

bool Nice::TaskControl::isCancelled ( )
virtual

◆ isDone()

bool Nice::TaskControl::isDone ( )
virtual

◆ isEndOfTask()

bool Nice::TaskControl::isEndOfTask ( )
private

◆ isTaskStillExecutable()

bool Nice::TaskControl::isTaskStillExecutable ( )
private

◆ setTask()

void Nice::TaskControl::setTask ( TaskPtr  task)
protected

◆ waitUntilEndOfTask()

void Nice::TaskControl::waitUntilEndOfTask ( )
virtual

Member Data Documentation

◆ state_

volatile State Nice::TaskControl::state_
private

◆ stateChanging_

Nice::Monitor Nice::TaskControl::stateChanging_
private

◆ task_

TaskPtr Nice::TaskControl::task_
private

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