RTT::types::MemberFactory Class Reference

#include <MemberFactory.hpp>

Inheritance diagram for RTT::types::MemberFactory:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Inspecting data structures.

Used to write a complex type to an external representation, like XML.

virtual bool resize (base::DataSourceBase::shared_ptr arg, int size) const
virtual std::vector< std::string > getMemberNames () 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 bool getMember (internal::Reference *ref, base::DataSourceBase::shared_ptr item, const std::string &name) const

Detailed Description

Definition at line 15 of file MemberFactory.hpp.


Member Function Documentation

virtual base::DataSourceBase::shared_ptr RTT::types::MemberFactory::getMember ( base::DataSourceBase::shared_ptr  item,
const std::string &  name 
) const [virtual]

Returns a member of a given data source struct identified by its name.

Parameters:
itemThe item of which to return a reference to a member
nameThe 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.
Returns:
null if no such member exists, an assignable datasource referencing that member otherwise.

Reimplemented in RTT::types::MatrixTypeInfo< T, has_ostream >, RTT::types::CArrayTypeInfo< T, has_ostream >, RTT::types::StructTypeInfo< T, has_ostream >, RTT::types::BoostArrayTypeInfo< T, has_ostream >, RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >, 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 >.

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).

Warning:
Currently this only works for a SequenceTypeInfo-like object. We don't implement this for StructTypeInfo-like objects, since that would be a very expensive implementation (memory wise).
Parameters:
itemThe item of which to return a member
idOr 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 in RTT::types::MatrixTypeInfo< T, has_ostream >, RTT::types::CArrayTypeInfo< T, has_ostream >, RTT::types::BoostArrayTypeInfo< T, has_ostream >, RTT::types::StructTypeInfo< T, has_ostream >, RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >, 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 >.

virtual bool RTT::types::MemberFactory::getMember ( internal::Reference ref,
base::DataSourceBase::shared_ptr  item,
const std::string &  name 
) const [virtual]

Stores a reference to a member of a struct identified by its name. This method does not allocate memory when item is assignable..

Parameters:
refThe reference object in which to store the reference.
itemThe item of which to return a reference to a member. It must be assignable, otherwise, a reference to a copy of item will be returned. This copy will allocate memory.
nameThe name of a member within item.
Returns:
false if no such member exists, true if ref got filled in otherwise.

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

vector< string > MemberFactory::getMemberNames ( ) const [virtual]
bool MemberFactory::resize ( base::DataSourceBase::shared_ptr  arg,
int  size 
) const [virtual]

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


rtt
Author(s): RTT Developers
autogenerated on Sat Jun 8 2019 18:46:40