$search
#include <StructTypeInfo.hpp>
Public Member Functions | |
virtual bool | composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const |
virtual bool | getMember (internal::Reference *ref, base::DataSourceBase::shared_ptr item, const std::string &name) 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) |
virtual bool | resize (base::DataSourceBase::shared_ptr arg, int size) const |
StructTypeInfo (std::string name) |
Type Information for data types that are structs, ie all user data types fall in this category.
Use this class to register your data type to the Orocos type system.
This class requires that your struct is compatible with the boost::serialization API. This means that it must provide a serialize() function or that you define a free function serialize() in the boost::serialization namespace. If no such function exists, you can fall back to StdTypeInfo or even TemplateTypeInfo.
Definition at line 62 of file StructTypeInfo.hpp.
RTT::types::StructTypeInfo< T, has_ostream >::StructTypeInfo | ( | std::string | name | ) | [inline] |
Definition at line 65 of file StructTypeInfo.hpp.
virtual bool RTT::types::StructTypeInfo< T, has_ostream >::composeTypeImpl | ( | const PropertyBag & | source, | |
typename internal::AssignableDataSource< T >::reference_t | result | |||
) | const [inline, virtual] |
Implementation that updates result with the matching parts in source Relies on the fact that getMember returns a C++ reference to each part of result, which is then updated with a property found in source.
Reimplemented from RTT::types::TemplateCompositionFactory< T >.
Definition at line 150 of file StructTypeInfo.hpp.
virtual bool RTT::types::StructTypeInfo< T, has_ostream >::getMember | ( | internal::Reference * | ref, | |
base::DataSourceBase::shared_ptr | item, | |||
const std::string & | name | |||
) | const [inline, 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 from RTT::types::MemberFactory.
Definition at line 120 of file StructTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::StructTypeInfo< 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 101 of file StructTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::StructTypeInfo< 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 91 of file StructTypeInfo.hpp.
virtual std::vector<std::string> RTT::types::StructTypeInfo< 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 83 of file StructTypeInfo.hpp.
bool RTT::types::StructTypeInfo< T, has_ostream >::installTypeInfoObject | ( | TypeInfo * | ti | ) | [inline, virtual] |
Installs the type info object in the global data source type info handler and adds any additional features to the type info object. This method will be called by the TypeInfoRepository, in order to register this type's factories into the TypeInfo object.
Reimplemented from RTT::types::TemplateTypeInfo< T, has_ostream >.
Definition at line 70 of file StructTypeInfo.hpp.
virtual bool RTT::types::StructTypeInfo< 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 139 of file StructTypeInfo.hpp.