Orocos Real-Time Toolkit  2.9.0
TypeStreamSelector.hpp
Go to the documentation of this file.
1 #ifndef ORO_TYPESTREAMSELECTOR_HPP_
2 #define ORO_TYPESTREAMSELECTOR_HPP_
3 
4 #include <ostream>
5 #include <istream>
6 
7 
8 namespace RTT
9 {
10  namespace types {
11  template<typename T, bool b_value>
13  template<typename T>
14  struct TypeStreamSelector<T,true>
15  {
16  static std::ostream& write(std::ostream& os, T const& t)
17  {
18 #ifdef OS_HAVE_STREAMS
19  os << t;
20 #endif
21  return os;
22  }
23  static std::istream& read(std::istream& os, T& t)
24  {
25 #ifdef OS_HAVE_STREAMS
26  os >> t;
27 #endif
28  return os;
29  }
30  };
31  template<typename T>
32  struct TypeStreamSelector<T,false>
33  {
34  static std::ostream& write(std::ostream& os, T)
35  {
36  return os;
37  }
38  static std::istream& read(std::istream& os, T& )
39  {
40  return os;
41  }
42  };
43  }
44 }
45 
46 #endif /* ORO_TYPESTREAMSELECTOR_HPP_ */
static std::istream & read(std::istream &os, T &)
static std::ostream & write(std::ostream &os, T const &t)
static std::istream & read(std::istream &os, T &t)
static std::ostream & write(std::ostream &os, T)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52