Public Types | Public Member Functions | List of all members
RTT::types::TemplateCompositionFactory< T > Class Template Reference

#include <TemplateCompositionFactory.hpp>

Inheritance diagram for RTT::types::TemplateCompositionFactory< T >:
Inheritance graph
[legend]

Public Types

typedef T UserType
 

Public Member Functions

virtual bool composeType (base::DataSourceBase::shared_ptr source, base::DataSourceBase::shared_ptr result) const
 
virtual bool composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const
 
virtual base::DataSourceBase::shared_ptr decomposeType (base::DataSourceBase::shared_ptr source) const
 
virtual bool decomposeTypeImpl (typename internal::AssignableDataSource< T >::const_reference_t source, PropertyBag &targetbag) const
 
- Public Member Functions inherited from RTT::types::CompositionFactory
virtual base::DataSourceBase::shared_ptr convertType (base::DataSourceBase::shared_ptr source) const
 
virtual ~CompositionFactory ()
 

Detailed Description

template<typename T>
class RTT::types::TemplateCompositionFactory< T >

Definition at line 49 of file TemplateCompositionFactory.hpp.

Member Typedef Documentation

template<typename T>
typedef T RTT::types::TemplateCompositionFactory< T >::UserType

The given T parameter is the type for reading DataSources.

Definition at line 57 of file TemplateCompositionFactory.hpp.

Member Function Documentation

template<typename T>
virtual bool RTT::types::TemplateCompositionFactory< T >::composeType ( base::DataSourceBase::shared_ptr  source,
base::DataSourceBase::shared_ptr  target 
) const
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().

Parameters
sourceA data source of the same type as target OR a PropertyBag that contains the parts of target to be refreshed.
targetA data source of the same type as this TypeInfo object which contains the data to be updated from source.
Returns
true if source could be updated, false otherwise.
See also
types::propertyDecomposition and types::typeDecomposition for the inverse function, decomposing a type into datasources and hierarchical properties.
decomposeType to do the inverse operation.

Implements RTT::types::CompositionFactory.

Reimplemented in RTT::types::EnumTypeInfo< T >, 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 >, RTT::types::SequenceTypeInfo< std::vector< T >, has_ostream >, RTT::types::StdStringTypeInfo, RTT::types::RTStringTypeInfo, RTT::types::StdTypeInfo< T >, RTT::types::StdTypeInfo< bool >, RTT::types::StdVectorTemplateTypeInfo< T, has_ostream >, and RTT::types::StdVectorTypeInfo.

Definition at line 59 of file TemplateCompositionFactory.hpp.

template<typename T>
virtual bool RTT::types::TemplateCompositionFactory< T >::composeTypeImpl ( const PropertyBag source,
typename internal::AssignableDataSource< T >::reference_t  result 
) const
inlinevirtual

User, implement this function in case you want to control reading the XML data format.

Reimplemented in RTT::types::StructTypeInfo< T, has_ostream >, and RTT::types::MatrixTypeInfo< T, has_ostream >.

Definition at line 99 of file TemplateCompositionFactory.hpp.

template<typename T>
virtual base::DataSourceBase::shared_ptr RTT::types::TemplateCompositionFactory< T >::decomposeType ( base::DataSourceBase::shared_ptr  source) const
inlinevirtual
template<typename T>
virtual bool RTT::types::TemplateCompositionFactory< T >::decomposeTypeImpl ( typename internal::AssignableDataSource< T >::const_reference_t  source,
PropertyBag targetbag 
) const
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 107 of file TemplateCompositionFactory.hpp.


The documentation for this class was generated from the following file:


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:46