- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Interfaces::Task Class Reference

`#include <Task.h>`

Inheritance diagram for Mers::Interfaces::Task:

[legend]
Collaboration diagram for Mers::Interfaces::Task:

[legend]
List of all members.

## Public Member Functions
| Task (const Mers::Utils::Lang::String &taskName)
| Task (const Mers::Utils::Lang::String &taskName, std::vector< const Mers::Utils::Lang::String * > const &parameters)
| Task (Task const &other)
Task & | operator= (Task const &other)
virtual | ~Task ()
const Mers::Utils::Lang::String & | getName () const
std::vector< const Mers::Utils::Lang::String * > const & | getParameters () const
void | setControllable (bool value)
bool | isControllable ()
virtual Mers::Utils::Lang::String | toString () const
bool | operator== (Task const &task)
virtual bool | Start (void)=0
virtual bool | Stop (void)=0
virtual bool | Completed (void)=0
virtual bool | Failed (void)=0
## Protected Attributes
Mers::Utils::Lang::String | mName
| The name of this task.
std::vector< const Mers::Utils::Lang::String * > | mParameters
| The parameters to this task.
bool | mControllable

## Detailed Description

The Task class captures a task requested of an executive. It contains a task identifier that enables it to traced during dispatching. Both the start and end of an activity have the same task with the same id.

A command includes:

- id: task idenification number ( both the start and the end task have the same id).

- name: The name of the task being issued.

- paramenters: A vector of parameters associated with the task.

Author:
  John Stedl

  Paul H. Elliott

Date:
  08.09.2002

Definition at line 54 of file Task.h.

## Constructor & Destructor Documentation

Task::Task | ( | const Mers::Utils::Lang::String & | taskName | ) |

Creates a new, parameterless Task

Parameters:

  | taskName | The name of the task that should be executed.

Definition at line 28 of file Task.cpp.

References mName.

Mers::Interfaces::Task::Task | ( | const Mers::Utils::Lang::String & | taskName,
|  | std::vector< const Mers::Utils::Lang::String * > const & | parameters |
| ) |  |  |

Creates a new, parameterized Task.

Parameters:

  | taskName | The name of the task that should be executed.
  | parameters | The list of parameters associated with this task.

Task::Task | ( | Task const & | other | ) | `[explicit]`

Creates a copy of the Task - the two tasks are equivalent with equal identifiers.

Parameters:

  | other | The object being used to initialize this object.

Definition at line 52 of file Task.cpp.

Task::~Task | ( |  | ) | `[virtual]`

Destroys this object.

Reimplemented in Mers::Executives::DeductiveController::Task.

Definition at line 78 of file Task.cpp.

References mParameters.

## Member Function Documentation

Task & Task::operator= | ( | Task const & | other | ) |

Copies the contents of the other Task into this object, making this object equivalent to the other object, including its identifier.

Parameters:

  | other | The object being used to initialize this object.

Returns:
  A reference to this object.

Definition at line 60 of file Task.cpp.

References mControllable, mName, and mParameters.

const String & Task::getName | ( |  | ) | const

Returns the name of this task.

Returns:
  the name of the task that this Task represents.

Definition at line 88 of file Task.cpp.

References mName.

vector< const String * > const & Task::getParameters | ( |  | ) | const

Returns the list of parameters for this task.

Returns:
  All of the parameters of this task.

Definition at line 95 of file Task.cpp.

References mParameters.

String Task::toString | ( |  | ) | const`[virtual]`

Converts this Task into an equivalent string that represents this object.

Returns:
  A string representation of this object.

Reimplemented in Mers::Executives::DeductiveController::Task.

Definition at line 102 of file Task.cpp.

References mName, and mParameters.

Referenced by Mers::Interfaces::Stub::TaskStub::Start(), Mers::Interfaces::Stub::TaskStub::Stop(), and Mers::Interfaces::Stub::TaskStub::TaskStub().

bool Task::operator== | ( | Task const & | task | ) |

Tests if the two tasks are the same- ie same name and parameter list

Parameters:

  | task | The task being compared against this object.

Returns:
  True if they two tasks have the same name and parameter list

Definition at line 123 of file Task.cpp.

References mName, and mParameters.

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

- /Users/fpy/titan-1-5-MBARI/Mers/Interfaces/Task.h
- /Users/fpy/titan-1-5-MBARI/Mers/Interfaces/Task.cpp