[Bug 301] Toolkit Plugins should provide read()/operator>> as well

For more information about this bug, visit
A comment was added:
------- Comment #1 from peter [dot] soetens [..] ... 2007-03-13 12:54

Created an attachment (id=89)
--> (http://www.fmtc.be/orocos-bugzilla/attachment.cgi?id=89&action=view)
Allows type system to convert string to value.

This patch for the 1.2 branch adds support for operator>>, i.e. reading a value
(Property,...) from a string. It adds the
std::istream& read(std::istream& os, DataSourceBase::shared_ptr out ) const
and
bool fromString( const std::string& value, DataSourceBase::shared_ptr out )
const
functions to the TypeInfo interface, which complement the existing write() and
toString() functions. Also the CORBA interface has been expanded for this
conversion.

This patch allows for example to set property values in the KTaskBrowser, but
also allows to write simpler XML parsers or scripting parsers, as the knowledge
on how to read a type is located in one place (TypeInfo subclass).

If you use the TemplateTypeInfo class with use_ostream = true, you will be
required to provide the operator>> function for your type, or a compilation
error will occur. As far as I know, this is already so for KDL. Can someone
confirm that ? Has this effects on BFL ?

wmeeusse's picture

[Bug 301] Toolkit Plugins should provide read()/operator>> as we

For more information about this bug, visit
A comment was added:
------- Comment #2 from wim [dot] meeussen [..] ... 2007-03-13 13:00

> Has this effects on BFL ?

I don't think so, since BFL has no 'toolkit' that links BFL and RTT.