Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Task Class Reference

Class for defining Tasks. More...

#include <task.hpp>

Collaboration diagram for Task:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Task ()
 Constructor.
 Task (int, const timespec &, const timespec &, const timespec &, const TimeInterval &)
 Constructor.
 Task (int, long int, long int, long int, long int, long int, long int, long int, long int, long int, long int)
 Constructor.
 Task (const Task &)
 Copy constructor.
virtual ~Task ()
 Destructor.
virtual void prepare ()
virtual void run ()
virtual void finish ()
int getId () const
 Get the identifier of a task.
timespec getWaitPrepareExecute () const
 Get the duration of time which will be waited between prepare and execute phase.
timespec getWaitExecuteFinish () const
 Get the duration of time which will be waited between execute and finish phase.
timespec getWaitFinishNextTask () const
 Get the duration of time which will be waited between finish phase and the start of the prepare phase of the next task.
const TimeIntervalgetReactionWindow () const
 Get the vector telling how a successful reaction should look like.
const vector< bool > & getSuccessfulReaction () const
 Get the vector telling how a successful reaction should look like.
void setReactionWindow (long int, long int, long int, long int)
 Set the duration of time in which a reaction may be valid.
void setReactionWindow (const timespec &, const timespec &)
 Set the duration of time in which a reaction may be valid.
void setReactionWindow (const TimeInterval &)
 Set the duration of time in which a reaction may be valid.
void setWaitPrepareExecute (long int, long int)
 Set the duration of time which will be waited between prepare and execute phase.
void setWaitExecuteFinish (long int, long int)
 Set the duration of time which will be waited between execute and finish phase.
void setWaitFinishNextTask (long int, long int)
 Set the duration of time which will be waited until the next task enters preparation phase.
void setWaitPrepareExecute (const timespec &)
 Set the duration of time which will be waited between prepare and execute phase.
void setWaitExecuteFinish (const timespec &)
 Set the duration of time which will be waited between execute and finish phase.
void setWaitFinishNextTask (const timespec &)
 Set the duration of time which will be waited until the next task enters preparation phase.
void setSuccessfulReaction (const vector< bool > &)
 Set the vector of booleans telling how a successful reaction looks like.

Protected Attributes

int id
 unique identifier
timespec waitPrepareExecute
 wait time between preparation and execution phase
timespec waitExecuteFinish
 wait time between execution and finish phase
timespec waitFinishNextTask
 wait time between preparation and execution phase
TimeInterval reactionWindow
 time in which a reaction is sucessful relative to end of execution phase
vector< bool > successfulReaction
 vector of booleans which tell how a sucessful reaction should look like

Detailed Description

Class for defining Tasks.

Tasks are used to present stimulus to test persons. Each task is divided in three phases, a prepare, execute and finish phase. In the prepare phase it is common to display a fixation cross on screen and prepare all things which will be shown on the screen in the execute phase. In the finish phase the screen is cleaned for the next task. The main task for the programmer of test is overwriting the prepare(), run() and finish() methods wit their own code to make a custom task. Furthermore three wait times must be defined. This are the delays between the phases and the wait time between the end of this task and the start of the next one. Finally a reaction window has to be defined. This is the time relative to the end of the execute phase in which the test person is supposed to react. How she/he is supposed is defined by a vector of booleans representing the desired pattern of user actions.

Definition at line 41 of file task.hpp.


Constructor & Destructor Documentation

Task::Task  ) 
 

Constructor.

All wait times are set to 2 seconds and the task id is 0. Furthermore the vector telling how a successfull reaction looks like is empty. Definition at line 24 of file task.cpp.

References setReactionWindow(), setWaitExecuteFinish(), setWaitFinishNextTask(), and setWaitPrepareExecute().

Here is the call graph for this function:

Task::Task int  taskId,
const timespec &  prepExeWait,
const timespec &  exeFinWait,
const timespec &  finNextWait,
const TimeInterval window
 

Constructor.

Parameters:
taskId unique task identifier
prepExeWait delay between prepare and execute phase
exeFinWait delay between execute and finish phase
finNextWait delay between finish phase and next taskId
window reaction window
Definition at line 40 of file task.cpp.

References TimeInterval::getInterval(), reactionWindow, TimeInterval::setInterval(), setWaitExecuteFinish(), setWaitFinishNextTask(), and setWaitPrepareExecute().

Here is the call graph for this function:

Task::Task int  taskId,
long int  prepExeWaitSec,
long int  prepExeWaitNano,
long int  exeFinWaitSec,
long int  exeFinWaitNano,
long int  finNextWaitSec,
long int  finNextWaitNano,
long int  windowStartSec,
long int  windowStartNano,
long int  windowEndSec,
long int  windowEndNano
 

Constructor.

Parameters:
taskId unique task identifier
prepExeWaitSec delay between prepare and execute phase (seconds)
prepExeWaitNano delay between prepare and execute phase (nano seconds)
exeFinWaitSec delay between execute and finish phase (seconds)
exeFinWaitNano delay between execute and finish phase (nano seconds)
finNextWaitSec delay between finish phase and next taskId (seconds)
finNextWaitNano delay between finish phase and next taskId (nano seconds)
windowStartSec reaction window (seconds)
windowStartNano reaction window (nano seconds)
windowEndSec reaction window (seconds)
windowEndNano reaction window (nano seconds)
Definition at line 65 of file task.cpp.

References setReactionWindow(), setWaitExecuteFinish(), setWaitFinishNextTask(), and setWaitPrepareExecute().

Here is the call graph for this function:

Task::Task const Task task  ) 
 

Copy constructor.

Definition at line 81 of file task.cpp.

References id, reactionWindow, waitExecuteFinish, waitFinishNextTask, and waitPrepareExecute.

Task::~Task  )  [virtual]
 

Destructor.

Definition at line 92 of file task.cpp.


Member Function Documentation

virtual void Task::finish  )  [inline, virtual]
 

Definition at line 52 of file task.hpp.

int Task::getId  )  const
 

Get the identifier of a task.

Returns:
id of the task
Definition at line 100 of file task.cpp.

Referenced by PtfCore::taskRegistrationHelper().

const TimeInterval & Task::getReactionWindow  )  const
 

Get the vector telling how a successful reaction should look like.

Returns:
the vector telling how a successful reaction should look like
Definition at line 134 of file task.cpp.

References reactionWindow.

const vector< bool > & Task::getSuccessfulReaction  )  const
 

Get the vector telling how a successful reaction should look like.

Returns:
the vector telling how a successful reaction should look like
Definition at line 142 of file task.cpp.

References successfulReaction.

timespec Task::getWaitExecuteFinish  )  const
 

Get the duration of time which will be waited between execute and finish phase.

Returns:
duration of time which will be waited between execute and finish phase
Definition at line 116 of file task.cpp.

References waitExecuteFinish.

timespec Task::getWaitFinishNextTask  )  const
 

Get the duration of time which will be waited between finish phase and the start of the prepare phase of the next task.

Returns:
duration of time which will be waited between finish phase and the start of the prepare phase of the next task
Definition at line 126 of file task.cpp.

References waitFinishNextTask.

timespec Task::getWaitPrepareExecute  )  const
 

Get the duration of time which will be waited between prepare and execute phase.

Returns:
duration of time which will be waited between prepare and execute phase
Definition at line 108 of file task.cpp.

References waitPrepareExecute.

virtual void Task::prepare  )  [inline, virtual]
 

Definition at line 50 of file task.hpp.

virtual void Task::run  )  [inline, virtual]
 

Definition at line 51 of file task.hpp.

void Task::setReactionWindow const TimeInterval time  ) 
 

Set the duration of time in which a reaction may be valid.

This time is relative to the end of the execute phase.

Parameters:
time reaction window
Definition at line 176 of file task.cpp.

References reactionWindow.

void Task::setReactionWindow const timespec &  a,
const timespec &  b
 

Set the duration of time in which a reaction may be valid.

This time is relative to the end of the execute phase.

Parameters:
a window start
b window end
Definition at line 167 of file task.cpp.

References reactionWindow, and TimeInterval::setInterval().

Here is the call graph for this function:

void Task::setReactionWindow long int  s1,
long int  ns1,
long int  s2,
long int  ns2
 

Set the duration of time in which a reaction may be valid.

This time is relative to the end of the execute phase.

Parameters:
s1 window start seconds
ns1 window start nano-seconds
s2 window end seconds
ns2 window end nano-seconds
Definition at line 154 of file task.cpp.

References reactionWindow, and TimeInterval::setInterval().

Referenced by Task().

Here is the call graph for this function:

void Task::setSuccessfulReaction const vector< bool > &  reaction  ) 
 

Set the vector of booleans telling how a successful reaction looks like.

Parameters:
reaction vector of booleans
Definition at line 243 of file task.cpp.

References successfulReaction.

void Task::setWaitExecuteFinish const timespec &  time  ) 
 

Set the duration of time which will be waited between execute and finish phase.

Parameters:
time the variable which specifys the duration
Definition at line 224 of file task.cpp.

References waitExecuteFinish.

void Task::setWaitExecuteFinish long int  s,
long int  ns
 

Set the duration of time which will be waited between execute and finish phase.

Parameters:
s the variable which specifys the duration in seconds
ns the variable which specifys the duration in nano-seconds
Definition at line 195 of file task.cpp.

References waitExecuteFinish.

Referenced by Task().

void Task::setWaitFinishNextTask const timespec &  time  ) 
 

Set the duration of time which will be waited until the next task enters preparation phase.

Parameters:
time the variable which specifys the duration
Definition at line 234 of file task.cpp.

References waitFinishNextTask.

void Task::setWaitFinishNextTask long int  s,
long int  ns
 

Set the duration of time which will be waited until the next task enters preparation phase.

Parameters:
s the variable which specifys the duration in seconds
ns the variable which specifys the duration in nano-seconds
Definition at line 206 of file task.cpp.

References waitFinishNextTask.

Referenced by Task().

void Task::setWaitPrepareExecute const timespec &  time  ) 
 

Set the duration of time which will be waited between prepare and execute phase.

Parameters:
time the variable which specifys the duration
Definition at line 215 of file task.cpp.

References waitPrepareExecute.

void Task::setWaitPrepareExecute long int  s,
long int  ns
 

Set the duration of time which will be waited between prepare and execute phase.

Parameters:
s the variable which specifys the duration in seconds
ns the variable which specifys the duration in nano-seconds
Definition at line 185 of file task.cpp.

References waitPrepareExecute.

Referenced by Task().


Member Data Documentation

int Task::id [protected]
 

unique identifier

Definition at line 70 of file task.hpp.

Referenced by Task().

TimeInterval Task::reactionWindow [protected]
 

time in which a reaction is sucessful relative to end of execution phase

Definition at line 74 of file task.hpp.

Referenced by getReactionWindow(), setReactionWindow(), and Task().

vector<bool> Task::successfulReaction [protected]
 

vector of booleans which tell how a sucessful reaction should look like

Definition at line 75 of file task.hpp.

Referenced by getSuccessfulReaction(), and setSuccessfulReaction().

timespec Task::waitExecuteFinish [protected]
 

wait time between execution and finish phase

Definition at line 72 of file task.hpp.

Referenced by getWaitExecuteFinish(), setWaitExecuteFinish(), and Task().

timespec Task::waitFinishNextTask [protected]
 

wait time between preparation and execution phase

Definition at line 73 of file task.hpp.

Referenced by getWaitFinishNextTask(), setWaitFinishNextTask(), and Task().

timespec Task::waitPrepareExecute [protected]
 

wait time between preparation and execution phase

Definition at line 71 of file task.hpp.

Referenced by getWaitPrepareExecute(), setWaitPrepareExecute(), and Task().


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 14:54:32 2004 for Psychological Test Framework by doxygen 1.3.8