#include <mtsTaskContinuous.h>
Inheritance diagram for mtsTaskContinuous:


Definition at line 44 of file mtsTaskContinuous.h.
| mtsTaskContinuous::mtsTaskContinuous | ( | const std::string & | name, | |
| unsigned int | sizeStateTable = 256, |
|||
| bool | newThread = true | |||
| ) |
Create a task with name 'name' that has a state table of the specified size.
| name | The name of the task | |
| sizeStateTable | The history size of the state table | |
| newThread | True if a new thread should be created for this task |
1) Call mtsTaskContinuous::Create from the thread to be captured. The class will get the thread id for the current thread and use it to initialize all interfaces in mtsTask::StartupInternal. Once this is done, Create returns to the calling thread.
2) Call mtsTaskContinuous::Start from the thread to be captured. This function captures the thread, and uses it to call the mtsTask::Run method. It does not return until the task is terminated.
Other tasks can use mtsTask::Suspend and mtsTask::Start to suspend and resume this task, or mtsTask::Kill to terminate it. In other words, once started the task should behave the same regardless of whether or not a new thread was created.
Note that mtsTaskFromCallback provides another mechanism for using an existing thread. In that case, the task does not capture the thread, but just registers itself as a callback.
| virtual mtsTaskContinuous::~mtsTaskContinuous | ( | ) | [virtual] |
Default Destructor.
| virtual void* mtsTaskContinuous::RunInternal | ( | void * | argument | ) | [protected, virtual] |
The member function that is passed as 'start routine' argument for thread creation.
Implements mtsTask.
| void mtsTaskContinuous::StartInternal | ( | void | ) | [protected] |
Called from Start
| void mtsTaskContinuous::Start | ( | void | ) | [virtual] |
Start/resume execution of the task
Implements mtsTask.
| void mtsTaskContinuous::Suspend | ( | void | ) | [virtual] |
Suspend the execution of the task
Implements mtsTask.
| void mtsTaskContinuous::Kill | ( | void | ) | [virtual] |
End the task
Reimplemented from mtsTask.
bool mtsTaskContinuous::NewThread [protected] |
True if a new thread should be created for this task.
Definition at line 57 of file mtsTaskContinuous.h.
bool mtsTaskContinuous::CaptureThread [protected] |
If a new thread is not created, we need to capture the current thread on the first call to Start.
Definition at line 61 of file mtsTaskContinuous.h.