All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Member Functions
Qtilities::Core::Interfaces::ITaskContainer Class Reference

Generic interface which provides a way for objects to expose tasks that they can perform. More...

#include <ITaskContainer.h>

Inheritance diagram for Qtilities::Core::Interfaces::ITaskContainer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void disableTask (int task_id)
 Disables the creation and registering in the global object pool of a task object to monitor the progress of the task.
void enableTask (int task_id)
 Enables the creation and registering in the global object pool of a task object to monitor the progress of the task.
int findTaskID (const QString &task_name) const
 Returns the task ID for the task specified by the given task_name.
bool isTaskActive (int task_id) const
 Checks if a specific task is active.
bool isTaskGlobal (int task_id) const
 Checks if a specific task is global or local. See Qtilities::Core::Interfaces::ITask::TaskType.
void setTaskGlobal (int task_id)
 Sets a task a global. See Qtilities::Core::Interfaces::ITask::TaskType.
void setTaskLocal (int task_id)
 Sets a task a local. See Qtilities::Core::Interfaces::ITask::TaskType.
ITasktask (int task_id) const
 Returns the task specified by the given task_id.
QList< ITask * > tasks () const
 A list of tasks provided by the object.
- Public Member Functions inherited from Qtilities::Core::Interfaces::IObjectBase
virtual QObject * objectBase ()=0
 Returns the QObject* base of the interface.
virtual const QObject * objectBase () const =0
 Returns a const QObject* base of the interface.
QString objectOriginID () const
 Allows interfaces to provide some sort of source identification.
void setObjectOriginID (const QString &object_origin_id)
 Allows setting of the object source ID of this interface implementation.

Protected Member Functions

TaskfindTask (const QString &task_name) const
 Returns the Task object specified by the given task_name.
void registerTask (Task *task, const QString &task_name)
 Registers a task in this container.

Detailed Description

Generic interface which provides a way for objects to expose tasks that they can perform.

This interface allows any object to expose tasks which can be performed by it.

To find the ID of an exposed task:

int task_id = d->file_utils.findTaskID(d->file_utils.taskNameToString(FileUtils::TaskFindFilesUnderDir));

See the Tasking article for more information on tasking.

Note:
ITaskContainer will delete all tasks registered in it during destruction.

This class was added in Qtilities v1.0.


Member Function Documentation

int Qtilities::Core::Interfaces::ITaskContainer::findTaskID ( const QString &  task_name) const

Returns the task ID for the task specified by the given task_name.

Returns:
The task ID linked to the given name. If a task linked to the given task_name does not exist, -1 is returned.
void Qtilities::Core::Interfaces::ITaskContainer::registerTask ( Task task,
const QString &  task_name 
)
protected

Registers a task in this container.

This function will automatically register the task in the global object pool.

Note:
Tasks registered within a container must have unique names.


Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé