cisst-saw
Loading...
Searching...
No Matches
mtsTaskPeriodic.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): Ankur Kapoor, Peter Kazanzides, Anton Deguet
6 Created on: 2004-04-30
7
8 (C) Copyright 2004-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 _mtsTaskPeriodic_h
26#define _mtsTaskPeriodic_h
27
31
32// Always include last
34
44{
46
47 public:
49
50 protected:
51 /************************ Protected task data *********************/
52
56
58 double Period;
60
64
65 /********************* Methods that call user methods *****************/
66
69 void *RunInternal(void* argument) override;
70
74 void StartupInternal(void) override;
75
78 void CleanupInternal(void) override;
79
81 void StartInternal(void) override;
82
83 public:
84 /********************* Task constructor and destructor *****************/
85
99 mtsTaskPeriodic(const std::string & name,
100 double periodicityInSeconds,
101 bool isHardRealTime = false,
102 unsigned int sizeStateTable = 256,
103 bool newThread = true);
104
105 mtsTaskPeriodic(const std::string & name,
106 const osaAbsoluteTime& periodicity,
107 bool isHardRealTime = false,
108 unsigned int sizeStateTable = 256,
109 bool newThread = true);
110
112
115
116 /********************* Methods to change task status *****************/
117 /* (use Start, Create and Kill methods from base classes) */
118
120 void Suspend(void) override;
121
122 /********************* Methods for task period and overrun ************/
123
125 double GetPeriodicity(void) const;
126
129 bool IsPeriodic(void) const override;
130
131};
132
133
135
136
137#endif // _mtsTaskPeriodic_h
mtsTaskContinuous(const std::string &name, unsigned int sizeStateTable=256, bool newThread=true)
Definition mtsParameterTypes.h:1622
Definition mtsTaskPeriodic.h:44
void StartupInternal(void) override
virtual ~mtsTaskPeriodic()
double GetPeriodicity(void) const
osaAbsoluteTime AbsoluteTimePeriod
Definition mtsTaskPeriodic.h:59
mtsTaskPeriodic(const std::string &name, double periodicityInSeconds, bool isHardRealTime=false, unsigned int sizeStateTable=256, bool newThread=true)
mtsTaskPeriodic(const std::string &name, const osaAbsoluteTime &periodicity, bool isHardRealTime=false, unsigned int sizeStateTable=256, bool newThread=true)
void CleanupInternal(void) override
mtsTaskPeriodic(const mtsTaskPeriodicConstructorArg &arg)
double Period
Definition mtsTaskPeriodic.h:58
bool IsHardRealTime
Definition mtsTaskPeriodic.h:63
osaThreadBuddy ThreadBuddy
Definition mtsTaskPeriodic.h:55
bool IsPeriodic(void) const override
void Suspend(void) override
void StartInternal(void) override
mtsTaskContinuous BaseType
Definition mtsTaskPeriodic.h:48
void * RunInternal(void *argument) override
Implementation of the Thread Proxy object in an OS independent manner.
Definition osaThreadBuddy.h:63
#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 continuously executing task.
Declaration of osaThreadBuddy.
Declaration of osaTimeServer class.
Definition osaTimeServer.h:36