#include <StreamFactory.hpp>
Public Member Functions | |
Conversion to/from text | |
Used to convert data to human readable text and vice versa. | |
virtual std::ostream & | write (std::ostream &os, base::DataSourceBase::shared_ptr in) const =0 |
virtual std::istream & | read (std::istream &os, base::DataSourceBase::shared_ptr out) const =0 |
virtual std::string | toString (base::DataSourceBase::shared_ptr in) const |
virtual bool | fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const |
virtual bool | isStreamable () const =0 |
Definition at line 16 of file StreamFactory.hpp.
bool StreamFactory::fromString | ( | const std::string & | value, |
base::DataSourceBase::shared_ptr | out | ||
) | const [virtual] |
Usability function which converts a string to data.
Definition at line 23 of file StreamFactory.cpp.
virtual bool RTT::types::StreamFactory::isStreamable | ( | ) | const [pure virtual] |
Returns true if this type is directly streamable using read()/write() or toString()/fromString().
Implemented in RTT::types::PrimitiveTypeInfo< T, use_ostream >, RTT::types::PrimitiveTypeInfo< bool, use_ostream >, RTT::types::PrimitiveTypeInfo< T, has_ostream >, RTT::types::PrimitiveTypeInfo< rt_string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< double >, use_ostream >, RTT::types::PrimitiveTypeInfo< std::string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >, and RTT::types::BoolTypeInfo.
virtual std::istream& RTT::types::StreamFactory::read | ( | std::istream & | os, |
base::DataSourceBase::shared_ptr | out | ||
) | const [pure virtual] |
Read a new value for this datasource from a human readable string. The default does nothing.
Implemented in RTT::types::PrimitiveTypeInfo< T, use_ostream >, RTT::types::PrimitiveTypeInfo< bool, use_ostream >, RTT::types::PrimitiveTypeInfo< T, has_ostream >, RTT::types::PrimitiveTypeInfo< rt_string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< double >, use_ostream >, RTT::types::PrimitiveTypeInfo< std::string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >, and RTT::types::BoolTypeInfo.
string StreamFactory::toString | ( | base::DataSourceBase::shared_ptr | in | ) | const [virtual] |
Usability function which converts data to a string.
Definition at line 12 of file StreamFactory.cpp.
virtual std::ostream& RTT::types::StreamFactory::write | ( | std::ostream & | os, |
base::DataSourceBase::shared_ptr | in | ||
) | const [pure virtual] |
Output this datasource as a human readable string. The default just writes the type name in parentheses to os.
Implemented in RTT::types::PrimitiveTypeInfo< T, use_ostream >, RTT::types::PrimitiveTypeInfo< bool, use_ostream >, RTT::types::PrimitiveTypeInfo< T, has_ostream >, RTT::types::PrimitiveTypeInfo< rt_string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< double >, use_ostream >, RTT::types::PrimitiveTypeInfo< std::string, use_ostream >, RTT::types::PrimitiveTypeInfo< std::vector< T >, use_ostream >, and RTT::types::BoolTypeInfo.