cisst-saw
Loading...
Searching...
No Matches
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
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
24
25#ifndef _mtsTaskContinuous_h
26#define _mtsTaskContinuous_h
27
29
30// Always include last
32
42{
44
45public:
47
48protected:
49 /************************ Protected task data *********************/
50
53
57
58 /********************* Methods that call user methods *****************/
59
62 void *RunInternal(void* argument) override;
63
65 virtual void StartInternal(void);
66
67public:
68 /********************* Task constructor and destructor *****************/
69
101 mtsTaskContinuous(const std::string & name,
102 unsigned int sizeStateTable = 256,
103 bool newThread = true);
104
106
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
132
133// Continuous task that doesn't create a thread (uses main thread).
134
136{
137 CMN_DECLARE_SERVICES(CMN_NO_DYNAMIC_CREATION, CMN_LOG_ALLOW_DEFAULT);
138public:
139 mtsTaskMain(const std::string &name) : mtsTaskContinuous(name, 256, false) {}
141};
142
144
145#endif // _mtsTaskContinuous_h
Definition mtsParameterTypes.h:1510
Definition mtsTaskContinuous.h:42
void Suspend(void) override
bool NewThread
Definition mtsTaskContinuous.h:52
void Create(void *data=0) override
void Kill(void) override
virtual bool CreatesThread(void) const
Definition mtsTaskContinuous.h:127
virtual ~mtsTaskContinuous()
mtsTaskContinuous(const mtsTaskContinuousConstructorArg &arg)
mtsTaskContinuous(const std::string &name, unsigned int sizeStateTable=256, bool newThread=true)
mtsTask BaseType
Definition mtsTaskContinuous.h:46
virtual void StartInternal(void)
void Start(void) override
bool CaptureThread
Definition mtsTaskContinuous.h:56
void * RunInternal(void *argument) override
mtsTask(const std::string &name, unsigned int sizeStateTable=256)
Definition mtsTaskContinuous.h:136
~mtsTaskMain()
Definition mtsTaskContinuous.h:140
mtsTaskMain(const std::string &name)
Definition mtsTaskContinuous.h:139
#define CMN_DECLARE_SERVICES_INSTANTIATION(className)
Definition cmnClassRegisterMacros.h:199
const int CMN_NO_DYNAMIC_CREATION
Definition cmnClassRegisterMacros.h:325
#define CISST_EXPORT
Definition cmnExportMacros.h:50
#define CMN_LOG_ALLOW_DEFAULT
Definition cmnLogLoD.h:76
Rules of exporting.
Defines a periodic task.