Orocos Real-Time Toolkit
2.8.3
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
extras
FileDescriptorSimulationActivity.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
3
***************************************************************************
4
* This library is free software; you can redistribute it and/or *
5
* modify it under the terms of the GNU General Public *
6
* License as published by the Free Software Foundation; *
7
* version 2 of the License. *
8
* *
9
* As a special exception, you may use this file as part of a free *
10
* software library without restriction. Specifically, if other files *
11
* instantiate templates or use macros or inline functions from this *
12
* file, or you compile this file and link it with other files to *
13
* produce an executable, this file does not by itself cause the *
14
* resulting executable to be covered by the GNU General Public *
15
* License. This exception does not however invalidate any other *
16
* reasons why the executable file might be covered by the GNU General *
17
* Public License. *
18
* *
19
* This library is distributed in the hope that it will be useful, *
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22
* Lesser General Public License for more details. *
23
* *
24
* You should have received a copy of the GNU General Public *
25
* License along with this library; if not, write to the Free Software *
26
* Foundation, Inc., 59 Temple Place, *
27
* Suite 330, Boston, MA 02111-1307 USA *
28
* *
29
***************************************************************************/
30
31
#ifndef FILEDESCRIPTORSIMULATION_ACTIVITY_HPP
32
#define FILEDESCRIPTORSIMULATION_ACTIVITY_HPP
33
34
#include "../base/ActivityInterface.hpp"
35
#include "../base/RunnableInterface.hpp"
36
#include "../extras/FileDescriptorActivityInterface.hpp"
37
38
namespace
RTT
{
namespace
extras {
39
58
class
RTT_API
FileDescriptorSimulationActivity
:
public
extras::FileDescriptorActivityInterface
,
59
public
base::ActivityInterface
60
{
61
public
:
62
// priority and name are ignored
63
FileDescriptorSimulationActivity
(
int
priority,
64
base::RunnableInterface
* _r = 0,
65
const
std::string& name =
"FileDescriptorSimulationActivity"
);
66
67
// scheduler, priority, and name, are ignored
68
FileDescriptorSimulationActivity
(
int
scheduler,
69
int
priority,
70
base::RunnableInterface
* _r = 0,
71
const
std::string& name =
"FileDescriptorSimulationActivity"
);
72
73
// scheduler, priority, and name, are ignored
74
FileDescriptorSimulationActivity
(
int
scheduler,
75
int
priority,
76
Seconds
period,
77
base::RunnableInterface
* _r = 0,
78
const
std::string& name =
"FileDescriptorSimulationActivity"
);
79
80
// scheduler, priority, cpu_affinity, and name, are ignored
81
FileDescriptorSimulationActivity
(
int
scheduler,
82
int
priority,
83
Seconds
period,
84
unsigned
cpu_affinity,
85
base::RunnableInterface
* _r = 0,
86
const
std::string& name =
"FileDescriptorSimulationActivity"
);
87
91
virtual
~
FileDescriptorSimulationActivity
();
92
93
/**********************************************************************
94
* FDAInterface functions
95
**********************************************************************/
96
98
void
watch(
int
fd);
99
101
void
unwatch(
int
fd);
102
104
void
clearAllWatches();
105
107
bool
isWatched(
int
fd)
const
;
108
111
bool
isUpdated(
int
fd)
const
;
112
115
bool
hasTimeout()
const
;
116
117
bool
hasError()
const
;
118
120
void
setTimeout(
int
timeout);
121
123
void
setTimeout_us(
int
timeout_us);
124
126
int
getTimeout()
const
;
127
129
int
getTimeout_us()
const
;
130
131
/**********************************************************************
132
* ActivityInterface functions
133
**********************************************************************/
134
136
virtual
bool
start();
138
virtual
bool
stop();
140
virtual
bool
isRunning()
const
;
142
virtual
bool
isActive()
const
;
144
virtual
Seconds
getPeriod()
const
;
146
virtual
bool
isPeriodic()
const
;
148
virtual
bool
setPeriod(
Seconds
s) ;
150
virtual
unsigned
getCpuAffinity()
const
;
152
virtual
bool
setCpuAffinity(
unsigned
cpu) ;
154
virtual
bool
execute();
156
virtual
bool
trigger();
158
virtual
os::ThreadInterface
* thread();
159
160
protected
:
163
Seconds
period
;
165
bool
running
;
166
};
167
}}
168
169
#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_API
#define RTT_API
Definition:
rtt-config.h:97
RTT::extras::FileDescriptorSimulationActivity::running
bool running
Definition:
FileDescriptorSimulationActivity.hpp:165
RTT::os::ThreadInterface
A thread which is being run.
Definition:
ThreadInterface.hpp:56
RTT::extras::FileDescriptorSimulationActivity
Simulate a FileDescriptorActivity (FDA) Primarily this is designed for unit tests that are testing co...
Definition:
FileDescriptorSimulationActivity.hpp:58
RTT::base::ActivityInterface
Interface to start/stop and query a Activity.
Definition:
ActivityInterface.hpp:62
RTT::extras::FileDescriptorActivityInterface
An activity which is triggered by the availability of data on a set of file descriptors.
Definition:
FileDescriptorActivityInterface.hpp:95
RTT::extras::FileDescriptorSimulationActivity::period
Seconds period
Fake period - some classes require period!=0.
Definition:
FileDescriptorSimulationActivity.hpp:163
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:51
Generated on Fri Apr 5 2019 12:14:47 for Orocos Real-Time Toolkit by
1.8.11