Orocos Real-Time Toolkit  2.9.0
BufferPolicy.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 #include "BufferPolicy.hpp"
30 #include <iostream>
31 
32 namespace RTT {
33 
34 std::ostream &operator<<(std::ostream &os, const BufferPolicy &bp)
35 {
36  switch(bp) {
37  case UnspecifiedBufferPolicy: os << "(unspecified buffer policy)"; break;
38  case PerConnection: os << "PerConnection"; break;
39  case PerInputPort: os << "PerInputPort"; break;
40  case PerOutputPort: os << "PerOutputPort"; break;
41  case Shared: os << "Shared"; break;
42  default: os << "(unknown buffer policy)"; break;
43  }
44  return os;
45 }
46 
47 std::istream &operator>>(std::istream &is, BufferPolicy &bp)
48 {
49  std::string s;
50  is >> s;
51  if (s == "PerConnection") bp = PerConnection;
52  else if (s == "PerInputPort") bp = PerInputPort;
53  else if (s == "PerOutputPort") bp = PerOutputPort;
54  else if (s == "Shared") bp = Shared;
55  else bp = UnspecifiedBufferPolicy;
56  return is;
57 }
58 
59 } // namespace RTT
std::istream & operator>>(std::istream &is, BufferPolicy &bp)
std::ostream & operator<<(std::ostream &os, const BufferPolicy &bp)
BufferPolicy
The BufferPolicy controls how multiple connections to the same input or output port are handled in ca...
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52