Orocos Real-Time Toolkit  2.8.3
ConnPolicy.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Thu Oct 22 11:59:08 CEST 2009 ConnPolicy.hpp
3 
4  ConnPolicy.hpp - description
5  -------------------
6  begin : Thu October 22 2009
7  copyright : (C) 2009 Peter Soetens
8  email : peter@thesourcworks.com
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 
39 #ifndef ORO_CONN_POLICY_HPP
40 #define ORO_CONN_POLICY_HPP
41 
42 #include <string>
43 #include "rtt-fwd.hpp"
44 #include "rtt-config.h"
45 
46 namespace RTT {
47 
93  {
94  public:
95  static const int UNBUFFERED = -1;
96  static const int DATA = 0;
97  static const int BUFFER = 1;
98  static const int CIRCULAR_BUFFER = 2;
99 
100  static const int UNSYNC = 0;
101  static const int LOCKED = 1;
102  static const int LOCK_FREE = 2;
103 
112  static ConnPolicy buffer(int size, int lock_policy = LOCK_FREE, bool init_connection = false, bool pull = false);
113 
122  static ConnPolicy circularBuffer(int size, int lock_policy = LOCK_FREE, bool init_connection = false, bool pull = false);
123 
131  static ConnPolicy data(int lock_policy = LOCK_FREE, bool init_connection = true, bool pull = false);
132 
141  explicit ConnPolicy(int type = DATA, int lock_policy = LOCK_FREE);
142 
144  int type;
150  bool init;
157  bool pull;
159  int size;
165 
174  mutable int data_size;
175 
182  mutable std::string name_id;
183  };
184 }
185 
186 #endif
187 
int data_size
Suggest the payload size of the data sent over this channel.
Definition: ConnPolicy.hpp:174
int lock_policy
This is the locking policy on the connection.
Definition: ConnPolicy.hpp:152
#define RTT_API
Definition: rtt-config.h:97
int type
DATA, BUFFER or CIRCULAR_BUFFER.
Definition: ConnPolicy.hpp:144
A connection policy object describes how a given connection should behave.
Definition: ConnPolicy.hpp:92
int size
If the connection is a buffered connection, the size of the buffer.
Definition: ConnPolicy.hpp:159
bool pull
If true, then the sink will have to pull data.
Definition: ConnPolicy.hpp:157
bool init
If true, one should initialize the connection&#39;s value with the last value written on the writer port...
Definition: ConnPolicy.hpp:150
int transport
The prefered transport used.
Definition: ConnPolicy.hpp:164
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:51
std::string name_id
The name of this connection.
Definition: ConnPolicy.hpp:182