cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstMultiTask
mtsTaskContinuous.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
Author(s): Peter Kazanzides
6
Created on: 2008-09-23
7
8
(C) Copyright 2008-2026 Johns Hopkins University (JHU), All Rights Reserved.
9
10
--- begin cisst license - do not edit ---
11
12
This software is provided "as is" under an open source license, with
13
no warranty. The complete license can be found in license.txt and
14
http://www.cisst.org/cisst/license.txt.
15
16
--- end cisst license ---
17
*/
18
19
24
25
#ifndef _mtsTaskContinuous_h
26
#define _mtsTaskContinuous_h
27
28
#include <
cisstMultiTask/mtsTask.h
>
29
30
// Always include last
31
#include <
cisstMultiTask/mtsExport.h
>
32
41
class
CISST_EXPORT
mtsTaskContinuous
:
public
mtsTask
42
{
43
CMN_DECLARE_SERVICES(
CMN_NO_DYNAMIC_CREATION
,
CMN_LOG_ALLOW_DEFAULT
);
44
45
public
:
46
typedef
mtsTask
BaseType
;
47
48
protected
:
49
/************************ Protected task data *********************/
50
52
bool
NewThread
;
53
56
bool
CaptureThread
;
57
58
/********************* Methods that call user methods *****************/
59
62
void
*
RunInternal
(
void
* argument)
override
;
63
65
virtual
void
StartInternal
(
void
);
66
67
public
:
68
/********************* Task constructor and destructor *****************/
69
101
mtsTaskContinuous
(
const
std::string & name,
102
unsigned
int
sizeStateTable = 256,
103
bool
newThread =
true
);
104
105
mtsTaskContinuous
(
const
mtsTaskContinuousConstructorArg
&arg);
106
108
virtual
~mtsTaskContinuous
();
109
110
/********************* Methods to change task status *****************/
111
112
/* Create a new thread (if needed). */
113
void
Create
(
void
*data = 0)
override
;
114
116
void
Start
(
void
)
override
;
117
119
void
Suspend
(
void
)
override
;
120
122
void
Kill
(
void
)
override
;
123
124
/********************* Other Methods *****************/
125
127
virtual
bool
CreatesThread
(
void
)
const
{
return
NewThread
; }
128
};
129
130
131
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsTaskContinuous
)
132
133
// Continuous task that doesn't create a thread (uses main thread).
134
135
class
CISST_EXPORT
mtsTaskMain
: public
mtsTaskContinuous
136
{
137
CMN_DECLARE_SERVICES(
CMN_NO_DYNAMIC_CREATION
,
CMN_LOG_ALLOW_DEFAULT
);
138
public
:
139
mtsTaskMain
(
const
std::string &name) :
mtsTaskContinuous
(name, 256, false) {}
140
~mtsTaskMain
() {}
141
};
142
143
CMN_DECLARE_SERVICES_INSTANTIATION
(
mtsTaskMain
)
144
145
#endif
// _mtsTaskContinuous_h
mtsTaskContinuousConstructorArg
Definition
mtsParameterTypes.h:1510
mtsTaskContinuous
Definition
mtsTaskContinuous.h:42
mtsTaskContinuous::Suspend
void Suspend(void) override
mtsTaskContinuous::NewThread
bool NewThread
Definition
mtsTaskContinuous.h:52
mtsTaskContinuous::Create
void Create(void *data=0) override
mtsTaskContinuous::Kill
void Kill(void) override
mtsTaskContinuous::CreatesThread
virtual bool CreatesThread(void) const
Definition
mtsTaskContinuous.h:127
mtsTaskContinuous::~mtsTaskContinuous
virtual ~mtsTaskContinuous()
mtsTaskContinuous::mtsTaskContinuous
mtsTaskContinuous(const mtsTaskContinuousConstructorArg &arg)
mtsTaskContinuous::mtsTaskContinuous
mtsTaskContinuous(const std::string &name, unsigned int sizeStateTable=256, bool newThread=true)
mtsTaskContinuous::BaseType
mtsTask BaseType
Definition
mtsTaskContinuous.h:46
mtsTaskContinuous::StartInternal
virtual void StartInternal(void)
mtsTaskContinuous::Start
void Start(void) override
mtsTaskContinuous::CaptureThread
bool CaptureThread
Definition
mtsTaskContinuous.h:56
mtsTaskContinuous::RunInternal
void * RunInternal(void *argument) override
mtsTask::mtsTask
mtsTask(const std::string &name, unsigned int sizeStateTable=256)
mtsTaskMain
Definition
mtsTaskContinuous.h:136
mtsTaskMain::~mtsTaskMain
~mtsTaskMain()
Definition
mtsTaskContinuous.h:140
mtsTaskMain::mtsTaskMain
mtsTaskMain(const std::string &name)
Definition
mtsTaskContinuous.h:139
CMN_DECLARE_SERVICES_INSTANTIATION
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition
cmnClassRegisterMacros.h:199
CMN_NO_DYNAMIC_CREATION
const int CMN_NO_DYNAMIC_CREATION
Definition
cmnClassRegisterMacros.h:325
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
CMN_LOG_ALLOW_DEFAULT
#define CMN_LOG_ALLOW_DEFAULT
Definition
cmnLogLoD.h:76
mtsExport.h
Rules of exporting.
mtsTask.h
Defines a periodic task.
Generated by
1.18.0