Orocos Real-Time Toolkit
2.8.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
extras
PeriodicActivity.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
tag: Peter Soetens Mon Jan 19 14:11:19 CET 2004 PeriodicActivity.hpp
3
4
PeriodicActivity.hpp - description
5
-------------------
6
begin : Mon January 19 2004
7
copyright : (C) 2004 Peter Soetens
8
email : peter.soetens@mech.kuleuven.ac.be
9
10
***************************************************************************
11
* This library is free software; you can redistribute it and/or *
12
* modify it under the terms of the GNU General Public *
13
* License as published by the Free Software Foundation; *
14
* version 2 of the License. *
15
* *
16
* As a special exception, you may use this file as part of a free *
17
* software library without restriction. Specifically, if other files *
18
* instantiate templates or use macros or inline functions from this *
19
* file, or you compile this file and link it with other files to *
20
* produce an executable, this file does not by itself cause the *
21
* resulting executable to be covered by the GNU General Public *
22
* License. This exception does not however invalidate any other *
23
* reasons why the executable file might be covered by the GNU General *
24
* Public License. *
25
* *
26
* This library is distributed in the hope that it will be useful, *
27
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
28
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29
* Lesser General Public License for more details. *
30
* *
31
* You should have received a copy of the GNU General Public *
32
* License along with this library; if not, write to the Free Software *
33
* Foundation, Inc., 59 Temple Place, *
34
* Suite 330, Boston, MA 02111-1307 USA *
35
* *
36
***************************************************************************/
37
38
#ifndef ORO_PERIODIC_ACTIVITY_HPP
39
#define ORO_PERIODIC_ACTIVITY_HPP
40
41
#include "../base/RunnableInterface.hpp"
42
43
#include "../Time.hpp"
44
#include "../base/ActivityInterface.hpp"
45
#include "
TimerThread.hpp
"
46
47
#ifdef ORO_PRAGMA_INTERFACE
48
#pragma interface
49
#endif
50
51
namespace
RTT
52
{
namespace
extras {
53
54
70
class
RTT_API
PeriodicActivity
71
:
public
base::ActivityInterface
72
{
73
public
:
74
88
PeriodicActivity
(
int
priority,
Seconds
period,
base::RunnableInterface
* r=0 );
89
105
PeriodicActivity
(
int
scheduler,
int
priority,
Seconds
period,
base::RunnableInterface
* r=0 );
106
124
PeriodicActivity
(
int
scheduler,
int
priority,
Seconds
period,
unsigned
cpu_affinity,
base::RunnableInterface
* r=0 );
125
126
136
PeriodicActivity
(
TimerThreadPtr
thread,
base::RunnableInterface
* r=0);
137
149
PeriodicActivity
(
Seconds
period,
TimerThreadPtr
thread,
base::RunnableInterface
* r=0 );
150
164
PeriodicActivity
(
secs
sec,
nsecs
nsec,
TimerThreadPtr
thread,
base::RunnableInterface
* r=0 );
165
169
virtual
~
PeriodicActivity
();
170
171
virtual
bool
start();
172
173
virtual
bool
execute();
174
175
virtual
bool
trigger();
176
177
virtual
bool
stop();
178
179
virtual
bool
isRunning()
const
;
180
181
virtual
bool
isActive()
const
;
182
183
virtual
bool
isPeriodic()
const
;
184
185
virtual
Seconds
getPeriod()
const
;
186
187
virtual
bool
setPeriod(
Seconds
s);
188
189
virtual
unsigned
getCpuAffinity()
const
;
190
191
virtual
bool
setCpuAffinity(
unsigned
cpu);
192
193
virtual
os::ThreadInterface
* thread();
194
198
virtual
bool
initialize();
199
203
virtual
void
step();
204
208
virtual
void
finalize();
209
210
protected
:
211
void
init();
212
216
bool
running
;
217
221
bool
active
;
222
226
TimerThreadPtr
thread_
;
227
};
228
229
}}
230
231
#endif
RTT::Seconds
double Seconds
Seconds are stored as a double precision float.
Definition:
Time.hpp:53
RTT::base::RunnableInterface
A class for running a certain piece of code in a thread.
Definition:
RunnableInterface.hpp:69
RTT::secs
long secs
seconds as a signed long.
Definition:
Time.hpp:57
RTT::extras::PeriodicActivity::running
bool running
State info.
Definition:
PeriodicActivity.hpp:216
RTT_API
#define RTT_API
Definition:
rtt-config.h:97
TimerThread.hpp
RTT::extras::TimerThreadPtr
boost::shared_ptr< TimerThread > TimerThreadPtr
TimerThread objects are reference counted such that when the last PeriodicActivity which uses it is d...
Definition:
TimerThread.hpp:61
RTT::extras::PeriodicActivity::thread_
TimerThreadPtr thread_
The thread which runs this activity.
Definition:
PeriodicActivity.hpp:226
RTT::os::ThreadInterface
A thread which is being run.
Definition:
ThreadInterface.hpp:56
RTT::base::ActivityInterface
Interface to start/stop and query a Activity.
Definition:
ActivityInterface.hpp:62
RTT::extras::PeriodicActivity
A PeriodicActivity is the general implementation of a Activity which has (realtime) periodic constrai...
Definition:
PeriodicActivity.hpp:70
RTT::extras::PeriodicActivity::active
bool active
State info.
Definition:
PeriodicActivity.hpp:221
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:51
RTT::nsecs
long long nsecs
nanoseconds as a signed long long.
Definition:
Time.hpp:69
Generated on Fri Apr 5 2019 12:14:47 for Orocos Real-Time Toolkit by
1.8.11