#include <MemberFactory.hpp>
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 |
Definition at line 15 of file MemberFactory.hpp.
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.
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 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 >.
virtual base::DataSourceBase::shared_ptr RTT::types::MemberFactory::getMember | ( | base::DataSourceBase::shared_ptr | item, |
base::DataSourceBase::shared_ptr | id | ||
) | const [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 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..
ref | The reference object in which to store the reference. |
item | The 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. |
name | The name of a member within item. |
Reimplemented in RTT::types::StructTypeInfo< T, has_ostream >.
vector< string > MemberFactory::getMemberNames | ( | ) | const [virtual] |
Returns the list of struct member names of this type. In case this type is not a struct, returns an empty list.
Reimplemented in 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 >.
Definition at line 12 of file MemberFactory.cpp.
bool MemberFactory::resize | ( | base::DataSourceBase::shared_ptr | arg, |
int | size | ||
) | const [virtual] |
Tries to resize a data source in case it's a resizable sequence.
Reimplemented in 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 >.
Definition at line 8 of file MemberFactory.cpp.