Orocos Real-Time Toolkit
2.9.0
|
#include <rtt/types/TemplateCompositionFactory.hpp>
Public Types | |
typedef T | UserType |
The given T parameter is the type for reading DataSources. More... | |
Public Member Functions | |
virtual bool | composeType (base::DataSourceBase::shared_ptr source, base::DataSourceBase::shared_ptr result) const |
Compose a type (target) from a DataSourceBase (source) containing its members. More... | |
virtual base::DataSourceBase::shared_ptr | decomposeType (base::DataSourceBase::shared_ptr source) const |
This default implementation sets up a PropertyBag which is passed to decomposeTypeImpl(). More... | |
virtual bool | composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const |
User, implement this function in case you want to control reading the XML data format. More... | |
virtual bool | decomposeTypeImpl (typename internal::AssignableDataSource< T >::const_reference_t source, PropertyBag &targetbag) const |
User, implement this function in case you want to control writing the XML data format. More... | |
virtual base::DataSourceBase::shared_ptr | convertType (base::DataSourceBase::shared_ptr source) const |
Specialize this function to return an alternate type which represents this one in a compatible way. More... | |
Definition at line 11 of file TemplateCompositionFactory.hpp.
typedef T RTT::types::TemplateCompositionFactory< T >::UserType |
The given T parameter is the type for reading DataSources.
Definition at line 19 of file TemplateCompositionFactory.hpp.
|
inlinevirtual |
Compose a type (target) from a DataSourceBase (source) containing its members.
The default behavior tries to assign source to target. If that fails, it tries to decompose target into its members and update the members of target with the contents of source.
The default implementation in TemplateTypeInfo works for most types, but can be overridden in case there are multiple versions/possibilities to make a target from a source. For example, in order to support legacy formats or in order to do the inverse of decomposeType().
source | A data source of the same type as target OR a PropertyBag that contains the parts of target to be refreshed. |
target | A data source of the same type as this TypeInfo object which contains the data to be updated from source. |
Implements RTT::types::CompositionFactory.
Reimplemented in RTT::types::EnumTypeInfo< T >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::StdTypeInfo< T >, RTT::types::StdTypeInfo< bool >, RTT::types::StdVectorTemplateTypeInfo< T, has_ostream >, RTT::types::StdVectorTypeInfo, RTT::types::SequenceTypeInfo< T, has_ostream >, RTT::types::SequenceTypeInfo< rt_string, true >, RTT::types::SequenceTypeInfo< std::string, true >, RTT::types::SequenceTypeInfo< std::vector< double >, true >, and RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream >.
Definition at line 21 of file TemplateCompositionFactory.hpp.
|
inlinevirtual |
User, implement this function in case you want to control reading the XML data format.
Reimplemented in RTT::types::StructTypeInfo< T, has_ostream >.
Definition at line 61 of file TemplateCompositionFactory.hpp.
Referenced by RTT::types::TemplateCompositionFactory< bool >::composeType().
|
virtualinherited |
Specialize this function to return an alternate type which represents this one in a compatible way.
For example, a short converts to an long or an enum to an int or a string.
Definition at line 6 of file CompositionFactory.cpp.
Referenced by RTT::types::CompositionFactory::decomposeType().
|
inlinevirtual |
This default implementation sets up a PropertyBag which is passed to decomposeTypeImpl().
It is advised to implement that function and to leave this function as-is, unless you don't want to return a PropertyBag, but another data type.
Reimplemented from RTT::types::CompositionFactory.
Reimplemented in RTT::types::EnumTypeInfo< T >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::StdTypeInfo< T >, RTT::types::StdTypeInfo< bool >, RTT::types::SequenceTypeInfo< T, has_ostream >, RTT::types::SequenceTypeInfo< rt_string, true >, RTT::types::SequenceTypeInfo< std::string, true >, RTT::types::SequenceTypeInfo< std::vector< double >, true >, and RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream >.
Definition at line 46 of file TemplateCompositionFactory.hpp.
|
inlinevirtual |
User, implement this function in case you want to control writing the XML data format.
Add the structural elements of source to targetbag.
Definition at line 69 of file TemplateCompositionFactory.hpp.
Referenced by RTT::types::TemplateCompositionFactory< bool >::decomposeType().