domain::StateChangeData Class Reference

Class to represent the change between different taskstates for a task. More...

#include <statechangedata.h>

Collaboration diagram for domain::StateChangeData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StateChangeData (bool possible)
bool isChangePossible () const
bool areMoreChangesNeeded () const
QList< const Task * > violatingTasks () const
TaskState::SettableState suggestedState (const Task *task) const
const QString & message () const
 operator bool () const
void addViolatingTask (const Task *task, TaskState::SettableState newState=TaskState::Failed)
void setMessage (const QString &message)

Private Attributes

bool changePossible
QMap< const Task
*, TaskState::SettableState > 
badTasks
QString msg

Detailed Description

Class to represent the change between different taskstates for a task.

This class is used to represent the (im)possibility to change states of a certain task. It contains a bool to indicate whether the change is possible, a potential error message and a map of the tasks that need to be adjusted to the settable state they need to be set to in order for the change to be possible.

Definition at line 25 of file statechangedata.h.


Constructor & Destructor Documentation

StateChangeData::StateChangeData ( bool  possible  ) 

Creates a new object of this class, with the 'possibility' bool set to the given argument.

Parameters:
possible bool whether the change is possible or not.

Definition at line 6 of file statechangedata.cpp.


Member Function Documentation

void domain::StateChangeData::addViolatingTask ( const Task task,
TaskState::SettableState  newState = TaskState::Failed 
)

Adds a given task with the given suggested new state to the list of tasks to adjust for this change to be possible.

Parameters:
tasks The task to add.
newState The suggested new state for the task.

Definition at line 43 of file statechangedata.cpp.

bool domain::StateChangeData::areMoreChangesNeeded (  )  const

Indicates whether more tasks need a status update in order to update this task's status.

Definition at line 15 of file statechangedata.cpp.

Here is the call graph for this function:

bool StateChangeData::isChangePossible (  )  const

Indicates whether the state change is possible.

Definition at line 10 of file statechangedata.cpp.

const QString & domain::StateChangeData::message (  )  const

Returns the error message.

Definition at line 20 of file statechangedata.cpp.

void domain::StateChangeData::setMessage ( const QString &  message  ) 

Sets the error message.

Parameters:
message The error message to set.

Definition at line 49 of file statechangedata.cpp.

TaskState::SettableState StateChangeData::suggestedState ( const Task task  )  const

Returns the new suggested state for a given violating task.

Parameters:
task The violating task for which to give the suggested state.
Exceptions:
InvalidDataException If there is no suggested state for the given task.

Definition at line 30 of file statechangedata.cpp.

Here is the call graph for this function:

QList< const domain::Task * > domain::StateChangeData::violatingTasks (  )  const

Returns a list of the tasks that need to be adjusted in order for the change to be possible.

Definition at line 25 of file statechangedata.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator
Generated on Thu May 27 14:20:16 2010 for MopTaskManager by  doxygen 1.6.3