Orocos Real-Time Toolkit  2.8.3
StreamFactory.cpp
Go to the documentation of this file.
1 #include "StreamFactory.hpp"
2 #include "../rtt-config.h"
3 
4 using namespace std;
5 using namespace RTT;
6 using namespace RTT::detail;
7 
8 #ifdef OS_HAVE_STREAMS
9 #include <sstream>
10 #endif
11 
12 string StreamFactory::toString( DataSourceBase::shared_ptr in ) const
13 {
14 #ifdef OS_HAVE_STREAMS
15  stringstream result;
16  this->write( result, in );
17  return result.str();
18 #else
19  return string("(") + in->getTypeInfo()->getTypeName() + ")";
20 #endif
21 }
22 
23 bool StreamFactory::fromString( const std::string& value, DataSourceBase::shared_ptr out ) const
24 {
25  stringstream result(value);
26  return this->read( result, out ).good();
27 }
STL namespace.
Convenient short notation for every sub-namespace of RTT.
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:51