MipTasks::ExampleTask Class Reference
[Example Task]

Generic example of a task. More...

#include <ExampleTask.h>

Inheritance diagram for MipTasks::ExampleTask:

MipTasks::Task MipTasks::Task MIPObject MIPObject

List of all members.

Public Member Functions

 ExampleTask (ResourcePointers resources, int argc, const char *argv[])
 Constructor.
 ~ExampleTask ()
 Destructor.
TaskPlate getPlate () const
 Gets task plate (mandatory).
Time getMaxDuration ()
 Gets maxDuration, maximum allowed duration for a single call to the run function.
Time getMaxSamplPeriod ()
 Gets maxSamplPeriod, maximum allowed time period between two calls of a run.
Time getMinSamplPeriod ()
 Gets minSamplPeriod, minimum allowed time period between two calls of a run.
TaskOutputs run ()
 Run function.
 ExampleTask (ResourcePointers resources, int argc, const char *argv[])
 Constructor.
 ~ExampleTask ()
 Destructor.
TaskPlate getPlate () const
 Gets task plate (mandatory).
Time getMaxDuration ()
 Gets maxDuration, maximum allowed duration for a single call to the run function.
Time getMaxSamplPeriod ()
 Gets maxSamplPeriod, maximum allowed time period between two calls of a run.
Time getMinSamplPeriod ()
 Gets minSamplPeriod, minimum allowed time period between two calls of a run.
TaskOutputs run ()
 Run function.


Detailed Description

Generic example of a task.

Author:
Paolo Stegagno

Constructor & Destructor Documentation

MipTasks::ExampleTask::ExampleTask ( ResourcePointers  resources,
int  argc,
const char *  argv[] 
)

Constructor.

Then, you have look at the requested resources. The following lines asks for a mobile robot, and save a pointer to it is saved in the variables of the task. The MobileRob is a mandatory resource of this task, so if not provided from ResourceUtilities::macroResFromPlate, the programm gives an error and exit.

The following lines asks for a shared memory and save a pointer to it is saved in the variables of the task. The SharedMem is a mandatory resource of this task, so if not provided from ResourceUtilities::macroResFromPlate, the programm gives an error and exit. The shared memory is then initialized.

The following lines asks for a DraWin and save a pointer to it in the variables of the task. The DraWin is not a mandatory resource of this task, so if not provided from ResourceUtilities::macroResFromPlate, the programm only gives a warning.

Then, it is possible to allocate all the algorithms and the variables needed from the task. The algorithms can also accept the options provided to the task.

MipTasks::ExampleTask::~ExampleTask (  ) 

Destructor.

MipTasks::ExampleTask::ExampleTask ( ResourcePointers  resources,
int  argc,
const char *  argv[] 
)

Constructor.

MipTasks::ExampleTask::~ExampleTask (  ) 

Destructor.


Member Function Documentation

TaskPlate MipTasks::ExampleTask::getPlate (  )  const [inline, virtual]

Gets task plate (mandatory).

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMaxDuration (  )  [inline, virtual]

Gets maxDuration, maximum allowed duration for a single call to the run function.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMaxSamplPeriod (  )  [inline, virtual]

Gets maxSamplPeriod, maximum allowed time period between two calls of a run.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMinSamplPeriod (  )  [inline, virtual]

Gets minSamplPeriod, minimum allowed time period between two calls of a run.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

TaskOutputs MipTasks::ExampleTask::run ( void   )  [virtual]

Run function.

Note:
It must be defined for all implemented task. The run function contains the real core of the task, since after the phase of the initialization of mip, the scheduler continuously executes the run run functions of the instantiated tasks. The run function must be implemented as a finite state machine. In this example, we have defined a two state machine: first step, and normal step.

Implements MipTasks::Task.

TaskPlate MipTasks::ExampleTask::getPlate (  )  const [inline, virtual]

Gets task plate (mandatory).

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMaxDuration (  )  [inline, virtual]

Gets maxDuration, maximum allowed duration for a single call to the run function.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMaxSamplPeriod (  )  [inline, virtual]

Gets maxSamplPeriod, maximum allowed time period between two calls of a run.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

Time MipTasks::ExampleTask::getMinSamplPeriod (  )  [inline, virtual]

Gets minSamplPeriod, minimum allowed time period between two calls of a run.

Note:
It must be defined for all implemented task.

Implements MipTasks::Task.

TaskOutputs MipTasks::ExampleTask::run (  )  [virtual]

Run function.

Note:
It must be defined for all implemented task. The run function contains the real core of the task, since after the phase of the initialization of mip, the scheduler continuously executes the run run functions of the instantiated tasks. The run function must be implemented as a finite state machine. In this example, we have defined a two state machine: first step, and normal step.

Implements MipTasks::Task.


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

Generated on Mon Feb 20 07:01:13 2017 for MIP by  doxygen 1.5.6