Logo Search packages:      
Sourcecode: poco version File versions

Poco::Task Class Reference

#include <Task.h>

Inheritance diagram for Poco::Task:

Poco::Runnable Poco::RefCountedObject

List of all members.


Detailed Description

A Task is a subclass of Runnable that has a name and supports progress reporting and cancellation.

A TaskManager object can be used to take care of the lifecycle of a Task.

Definition at line 58 of file Task.h.


Public Types

enum  TaskState {
  TASK_IDLE, TASK_STARTING, TASK_RUNNING, TASK_CANCELLING,
  TASK_FINISHED
}

Public Member Functions

void cancel ()
void duplicate () const
bool isCancelled () const
const std::string & name () const
 Creates the Task.
float progress () const
 Returns the task's name.
int referenceCount () const
void release () const
 Increments the object's reference count.
void reset ()
 Returns the task's current state.
void run ()
virtual void runTask ()=0
TaskState state () const
 Task (const std::string &name)

Protected Member Functions

TaskManagergetOwner () const
 Sets the (optional) owner of the task.
virtual void postNotification (Notification *pNf)
void setOwner (TaskManager *pOwner)
void setProgress (float progress)
void setState (TaskState state)
 Returns the owner of the task, which may be NULL.
bool sleep (long milliseconds)
virtual ~Task ()
 Sets the task's state.

Private Member Functions

Taskoperator= (const Task &)
 Task (const Task &)
 Task ()
 Destroys the Task.

Private Attributes

Event _cancelEvent
FastMutex _mutex
std::string _name
TaskManager_pOwner
float _progress
TaskState _state

Friends

class TaskManager

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

Generated by  Doxygen 1.6.0   Back to index