Skip To Content ArcGIS for Developers Sign In Dashboard

TaskWatcher Class

(Esri::ArcGISRuntime::TaskWatcher)

Information about the state of a running task with cancel support. More...

Header: #include <TaskWatcher>
Since: Esri::ArcGISRuntime 100.0

Public Functions

TaskWatcher()
TaskWatcher(const TaskWatcher &other)
TaskWatcher(TaskWatcher &&other)
~TaskWatcher()
bool cancel()
QString description() const
bool isCanceled() const
bool isDone() const
bool isValid() const
QUuid taskId() const
TaskWatcher &operator=(const TaskWatcher &other)
TaskWatcher &operator=(TaskWatcher &&other)

Detailed Description

Information about the state of a running task with cancel support.

TaskWatcher supports examining the state of a task along with the ability to cancel a task.

This class is only copyable for convenience. All copies are shallow copies and reference the same underlying task.

Member Function Documentation

TaskWatcher::TaskWatcher()

Default constructor.

TaskWatcher::TaskWatcher(const TaskWatcher &other)

Copy constructor from other TaskWatcher.

Note: Both copies will reference the same underlying task.

TaskWatcher::TaskWatcher(TaskWatcher &&other)

Move constructor from other TaskWatcher.

TaskWatcher::~TaskWatcher()

Destructor.

bool TaskWatcher::cancel()

Cancels the task.

Returns true if the task was canceled successfully.

QString TaskWatcher::description() const

Gets the unique task description.

The task description will be a simple description of the task, for example, the task function name.

Returns the task description.

bool TaskWatcher::isCanceled() const

Gets whether the task was canceled.

Returns true if the task was canceled.

bool TaskWatcher::isDone() const

Gets whether the task has come to a terminal state, either canceled or completed.

Returns true if the task is done.

bool TaskWatcher::isValid() const

Gets whether the task was created successfully.

Returns true if the task could be created, otherwise false. If false, then the task's corresponding completed signal will never emit.

QUuid TaskWatcher::taskId() const

Gets the unique task ID associated with this task.

Returns the task id.

TaskWatcher &TaskWatcher::operator=(const TaskWatcher &other)

Copy assignment from other TaskWatcher.

Note: Both copies will reference the same underlying task.

TaskWatcher &TaskWatcher::operator=(TaskWatcher &&other)

Move operator from other TaskWatcher.


Feedback on this topic?