#include <PrimitiveSequenceTypeInfo.hpp>
Public Member Functions | |
base::AttributeBase * | buildVariable (std::string name, int size) const |
virtual bool | composeType (base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const |
virtual base::DataSourceBase::shared_ptr | decomposeType (base::DataSourceBase::shared_ptr source) const |
virtual base::DataSourceBase::shared_ptr | getMember (base::DataSourceBase::shared_ptr item, const std::string &name) const |
virtual base::DataSourceBase::shared_ptr | getMember (base::DataSourceBase::shared_ptr item, base::DataSourceBase::shared_ptr id) const |
virtual std::vector< std::string > | getMemberNames () const |
bool | installTypeInfoObject (TypeInfo *ti) |
PrimitiveSequenceTypeInfo (std::string name) | |
virtual bool | resize (base::DataSourceBase::shared_ptr arg, int size) const |
New-style SequenceTypeInfo which offers type info for sequences which can NOT be sent over flow ports. This has huge code size reduction, while still being able to use these sequences in structs which are sent over flow ports.
Definition at line 19 of file PrimitiveSequenceTypeInfo.hpp.
RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::PrimitiveSequenceTypeInfo | ( | std::string | name | ) | [inline] |
Definition at line 26 of file PrimitiveSequenceTypeInfo.hpp.
base::AttributeBase* RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::buildVariable | ( | std::string | name, |
int | size | ||
) | const [inline] |
Reimplemented from RTT::types::SequenceTypeInfoBase< T >.
Definition at line 47 of file PrimitiveSequenceTypeInfo.hpp.
virtual bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::composeType | ( | base::DataSourceBase::shared_ptr | source, |
base::DataSourceBase::shared_ptr | target | ||
) | const [inline, virtual] |
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.
Definition at line 52 of file PrimitiveSequenceTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::decomposeType | ( | base::DataSourceBase::shared_ptr | source | ) | const [inline, virtual] |
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. If your return a datasource containing a property bag, then this function should do the inverse of composeType: the returned property bag contains all parts of the current type (source) which can be modified and merged back into this type with composeType. Mathematically: composeType( decomposeType( A ), B); assert( A == B );
Reimplemented from RTT::types::CompositionFactory.
Definition at line 61 of file PrimitiveSequenceTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMember | ( | base::DataSourceBase::shared_ptr | item, |
const std::string & | name | ||
) | const [inline, virtual] |
Returns a member of a given data source struct identified by its name.
item | The item of which to return a reference to a member |
name | The name of a member within item. Is a name of a member in case of a struct or an index number in case of a sequence. |
Reimplemented from RTT::types::MemberFactory.
Definition at line 69 of file PrimitiveSequenceTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMember | ( | base::DataSourceBase::shared_ptr | item, |
base::DataSourceBase::shared_ptr | id | ||
) | const [inline, virtual] |
Returns a member of a given data source identified by a data source id. This will be an int (for indexing) or a string (for the member name).
item | The item of which to return a member |
id | Or a string data source containing the name of a member if item is a struct, Or an unsigned int data source containing the index of an element if item is a sequence |
Reimplemented from RTT::types::MemberFactory.
Definition at line 73 of file PrimitiveSequenceTypeInfo.hpp.
virtual std::vector<std::string> RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMemberNames | ( | ) | const [inline, virtual] |
Returns the list of struct member names of this type. In case this type is not a struct, returns an empty list.
Reimplemented from RTT::types::MemberFactory.
Definition at line 65 of file PrimitiveSequenceTypeInfo.hpp.
bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::installTypeInfoObject | ( | TypeInfo * | ti | ) | [inline] |
Reimplemented from RTT::types::SequenceTypeInfoBase< T >.
Definition at line 30 of file PrimitiveSequenceTypeInfo.hpp.
virtual bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::resize | ( | base::DataSourceBase::shared_ptr | arg, |
int | size | ||
) | const [inline, virtual] |
Tries to resize a data source in case it's a resizable sequence.
Reimplemented from RTT::types::MemberFactory.
Definition at line 57 of file PrimitiveSequenceTypeInfo.hpp.