ERC CISST - cisst software

mtsTaskPeriodic Class Reference
[Multi Task Support]

#include <mtsTaskPeriodic.h>

Inheritance diagram for mtsTaskPeriodic:

Inheritance graph
[legend]
Collaboration diagram for mtsTaskPeriodic:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class inherits from mtsTaskContinuous and specializes it to support periodic loops, where the user-supplied Run method is called at a defined period. It also has a mechanism to make the task hard real time, assuming that the underlying operating system provides that capability.

Definition at line 48 of file mtsTaskPeriodic.h.

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes

Friends


Constructor & Destructor Documentation

mtsTaskPeriodic::mtsTaskPeriodic ( const std::string &  name,
double  periodicityInSeconds,
bool  isHardRealTime = false,
unsigned int  sizeStateTable = 256,
bool  newThread = true 
)

Create a task with name 'name', periodicity, and a flag that sets if the task needs to be hard real time.

Parameters:
name The name of the task
periodicityInSeconds The task period, in seconds
isHardRealTime True if task should run in hard real time
sizeStateTable The history size of the state table
newThread True if a new thread should be created for this task
Note:
See note in mtsTask regarding length of string name. See note in mtsTaskContinuous regarding newThread parameter.

virtual mtsTaskPeriodic::~mtsTaskPeriodic (  )  [virtual]

Default Destructor.


Member Function Documentation

virtual void* mtsTaskPeriodic::RunInternal ( void *  argument  )  [protected, virtual]

The member function that is passed as 'start routine' argument for thread creation.

Reimplemented from mtsTaskContinuous.

void mtsTaskPeriodic::StartupInternal ( void   )  [protected, virtual]

The member funtion that is executed as soon as thread gets created. It does some housekeeping before the user code can be executed as real time.

Reimplemented from mtsTask.

void mtsTaskPeriodic::CleanupInternal ( void   )  [protected, virtual]

The member function that is executed once the task terminates. This does some cleanup work

Reimplemented from mtsTask.

void mtsTaskPeriodic::StartInternal ( void   )  [protected]

Called from Start

Reimplemented from mtsTaskContinuous.

void mtsTaskPeriodic::Suspend ( void   )  [virtual]

Suspend the execution of the task

Reimplemented from mtsTaskContinuous.

double mtsTaskPeriodic::GetPeriodicity ( void   )  const [inline]

Return the periodicity of the task, in seconds

Definition at line 130 of file mtsTaskPeriodic.h.

References cmn_ns.

bool mtsTaskPeriodic::IsPeriodic ( void   )  const [inline, virtual]

Return true if thread is periodic. Currently, returns true if the thread was created with a period > 0.

Reimplemented from mtsTask.

Definition at line 134 of file mtsTaskPeriodic.h.


Member Data Documentation

osaThreadBuddy mtsTaskPeriodic::ThreadBuddy [protected]

The OS independent thread buddy, that makes the thread real-time on __ALL__ platforms.

Definition at line 62 of file mtsTaskPeriodic.h.

double mtsTaskPeriodic::Period [protected]

The period of the task, in seconds.

Definition at line 65 of file mtsTaskPeriodic.h.

bool mtsTaskPeriodic::IsHardRealTime [protected]

True if the task is hard real time. It is always false for non-real time systems.

Definition at line 70 of file mtsTaskPeriodic.h.


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu