Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
rtt
base
DataObjectBase.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
* This library is free software; you can redistribute it and/or *
3
* modify it under the terms of the GNU General Public *
4
* License as published by the Free Software Foundation; *
5
* version 2 of the License. *
6
* *
7
* As a special exception, you may use this file as part of a free *
8
* software library without restriction. Specifically, if other files *
9
* instantiate templates or use macros or inline functions from this *
10
* file, or you compile this file and link it with other files to *
11
* produce an executable, this file does not by itself cause the *
12
* resulting executable to be covered by the GNU General Public *
13
* License. This exception does not however invalidate any other *
14
* reasons why the executable file might be covered by the GNU General *
15
* Public License. *
16
* *
17
* This library is distributed in the hope that it will be useful, *
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
20
* Lesser General Public License for more details. *
21
* *
22
* You should have received a copy of the GNU General Public *
23
* License along with this library; if not, write to the Free Software *
24
* Foundation, Inc., 59 Temple Place, *
25
* Suite 330, Boston, MA 02111-1307 USA *
26
* *
27
***************************************************************************/
28
29
30
#include "
DataObjectBase.hpp
"
31
#include "../ConnPolicy.hpp"
32
33
using namespace
RTT
;
34
using namespace
RTT::base
;
35
36
DataObjectBase::Options::Options
()
37
: max_threads_(2)
38
, multiple_writers_(false)
39
, multiple_readers_(false)
40
{}
41
42
DataObjectBase::Options::Options
(
unsigned
int
max_threads
)
43
:
max_threads_
(max_threads)
44
,
multiple_writers_
(false)
45
,
multiple_readers_
(true)
46
{}
47
48
DataObjectBase::Options::Options
(
const
ConnPolicy
&policy)
49
:
max_threads_
(2)
50
,
multiple_writers_
(policy.buffer_policy ==
PerInputPort
|| policy.buffer_policy ==
Shared
)
51
,
multiple_readers_
(policy.buffer_policy ==
PerOutputPort
|| policy.buffer_policy ==
Shared
)
52
{
53
if
(policy.
max_threads
== 0) {
54
if
(
multiple_writers_
) {
55
max_threads_
+= 10;
56
}
57
if
(
multiple_readers_
) {
58
max_threads_
+= 10;
59
}
60
}
else
{
61
max_threads_
= policy.
max_threads
;
62
}
63
}
RTT::base::DataObjectBase::Options::max_threads_
unsigned int max_threads_
Definition:
DataObjectBase.hpp:51
RTT::base::DataObjectBase::Options::multiple_readers_
bool multiple_readers_
Definition:
DataObjectBase.hpp:53
RTT::base::DataObjectBase::Options::max_threads
unsigned int max_threads() const
Definition:
DataObjectBase.hpp:60
RTT::base::DataObjectBase::Options::Options
Options()
Definition:
DataObjectBase.cpp:36
RTT::ConnPolicy
Definition:
ConnPolicy.hpp:107
DataObjectBase.hpp
RTT::PerOutputPort
Definition:
BufferPolicy.hpp:78
RTT::ConnPolicy::max_threads
int max_threads
Definition:
ConnPolicy.hpp:224
RTT::base::DataObjectBase::Options::multiple_writers_
bool multiple_writers_
Definition:
DataObjectBase.hpp:52
RTT::base
Definition:
ActionInterface.hpp:50
RTT::PerInputPort
Definition:
BufferPolicy.hpp:77
RTT
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition:
Activity.cpp:53
RTT::Shared
Definition:
BufferPolicy.hpp:79
rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:23