Empty implementation of TypeInfo interface. More...
#include <rtt/TypeInfoName.hpp>
Public Member Functions | |
EmptyTypeInfo (std::string name) | |
AttributeBase * | buildConstant (std::string name, DataSourceBase::shared_ptr dsb) const |
Build a non modifyable instance of this type. | |
AttributeBase * | buildVariable (std::string name) const |
Build a non modifyable instance of this type. | |
AttributeBase * | buildAttribute (std::string name, DataSourceBase::shared_ptr in) const |
Build an Attribute of this type. | |
AttributeBase * | buildAlias (std::string name, DataSourceBase::shared_ptr in) const |
build an alias with b as the value. | |
virtual const std::string & | getTypeName () const |
Return unique the type name. | |
virtual PropertyBase * | buildProperty (const std::string &name, const std::string &desc, DataSourceBase::shared_ptr source=0) const |
Build a Property of this type. | |
virtual DataSourceBase::shared_ptr | buildValue () const |
Build a ValueDataSource of this type. | |
DataSourceBase::shared_ptr | construct (const std::vector< DataSourceBase::shared_ptr > &) const |
Constructor syntax: construct a DataSource which returns an instance of data depending on the given arguments. | |
virtual std::ostream & | write (std::ostream &os, DataSourceBase::shared_ptr in) const |
Output this datasource as a human readable string. | |
virtual std::istream & | read (std::istream &is, DataSourceBase::shared_ptr out) const |
Read a new value for this datasource from a human readable string. | |
virtual bool | decomposeType (DataSourceBase::shared_ptr source, PropertyBag &targetbag) const |
Decompose a structure as basic components into a PropertyBag. | |
virtual bool | composeType (DataSourceBase::shared_ptr source, DataSourceBase::shared_ptr result) const |
Compose a structure from a PropertyBase containing its basic components. | |
virtual std::string | getTypeIdName () const |
Type building/factory functions | |
virtual AttributeBase * | buildConstant (std::string name, DataSourceBase::shared_ptr, int sizehint) const |
Build a non modifyable instance of this type. | |
virtual AttributeBase * | buildVariable (std::string name, int sizehint) const |
Build a modifyable instance of this type. | |
virtual DataSourceBase::shared_ptr | convert (DataSourceBase::shared_ptr arg) const |
Automatic conversion: convert a DataSource to this type. | |
virtual void | addConstructor (TypeBuilder *tb) |
Add a constructor/convertor object. | |
Conversion to/from text | |
virtual std::string | toString (DataSourceBase::shared_ptr in) const |
Usability function which converts data to a string. | |
virtual bool | fromString (const std::string &value, DataSourceBase::shared_ptr out) const |
Usability function which converts a string to data. | |
Distribution of objects | |
bool | addProtocol (int protocol_id, detail::TypeTransporter *tt) |
Register a protocol for data transport over a network. | |
detail::TypeTransporter * | getProtocol (int protocol_id) const |
Register a protocol for data transport over a network. | |
std::vector< int > | getTransportNames () const |
Return a list of protocols that have transporters. | |
Protected Types | |
typedef std::vector < TypeBuilder * > | Constructors |
typedef std::vector < detail::TypeTransporter * > | Transporters |
Protected Attributes | |
Constructors | constructors |
Transporters | transporters |
Empty implementation of TypeInfo interface.
Definition at line 52 of file TypeInfoName.hpp.
AttributeBase* RTT::EmptyTypeInfo::buildAlias | ( | std::string | name, | |
DataSourceBase::shared_ptr | b | |||
) | const [inline, virtual] |
build an alias with b as the value.
If b is of the wrong type, 0 will be returned..
Implements RTT::TypeInfo.
Definition at line 86 of file TypeInfoName.hpp.
References RTT::Logger::log().
virtual AttributeBase* RTT::TypeInfo::buildConstant | ( | std::string | name, | |
DataSourceBase::shared_ptr | , | |||
int | sizehint | |||
) | const [virtual, inherited] |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
AttributeBase* RTT::EmptyTypeInfo::buildConstant | ( | std::string | name, | |
DataSourceBase::shared_ptr | ||||
) | const [inline, virtual] |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Implements RTT::TypeInfo.
Definition at line 65 of file TypeInfoName.hpp.
References RTT::Logger::log().
virtual AttributeBase* RTT::TypeInfo::buildVariable | ( | std::string | name, | |
int | sizehint | |||
) | const [virtual, inherited] |
Build a modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Reimplemented in RTT::TemplateContainerTypeInfo< T, IndexType, SetType, IPred, APred, has_ostream >, and RTT::TemplateContainerTypeInfo< std::vector< T >, int, T, ArrayIndexChecker< std::vector< T > >, SizeAssignChecker< std::vector< T > >, has_ostream >.
AttributeBase* RTT::EmptyTypeInfo::buildVariable | ( | std::string | name | ) | const [inline, virtual] |
Build a non modifyable instance of this type.
sizehint | For variable size instances, use it to hint the size of the instance. |
Implements RTT::TypeInfo.
Definition at line 72 of file TypeInfoName.hpp.
References RTT::Logger::log().
virtual bool RTT::EmptyTypeInfo::composeType | ( | DataSourceBase::shared_ptr | source, | |
DataSourceBase::shared_ptr | target | |||
) | const [inline, virtual] |
Compose a structure from a PropertyBase containing its basic components.
The default behavior tries to assign source to target. If this does not work, because source and target have different type, this function returns false.
Implements RTT::TypeInfo.
Definition at line 134 of file TypeInfoName.hpp.
References RTT::Logger::log().
DataSourceBase::shared_ptr RTT::EmptyTypeInfo::construct | ( | const std::vector< DataSourceBase::shared_ptr > & | args | ) | const [inline, virtual] |
Constructor syntax: construct a DataSource which returns an instance of data depending on the given arguments.
When args is empty, the default 'variable' is returned.
Reimplemented from RTT::TypeInfo.
Definition at line 107 of file TypeInfoName.hpp.
References RTT::Logger::log().
virtual DataSourceBase::shared_ptr RTT::TypeInfo::convert | ( | DataSourceBase::shared_ptr | arg | ) | const [virtual, inherited] |
Automatic conversion: convert a DataSource to this type.
For example, for converting float -> double. If no valid conversion was found, returns arg again, otherwise, a new data source.
virtual bool RTT::EmptyTypeInfo::decomposeType | ( | DataSourceBase::shared_ptr | source, | |
PropertyBag & | targetbag | |||
) | const [inline, virtual] |
Decompose a structure as basic components into a PropertyBag.
true | decomposition resulted in new types added to targetbag. | |
false | nothing was added to targetbag. |
Implements RTT::TypeInfo.
Definition at line 128 of file TypeInfoName.hpp.
References RTT::Logger::log().
virtual std::istream& RTT::EmptyTypeInfo::read | ( | std::istream & | os, | |
DataSourceBase::shared_ptr | out | |||
) | const [inline, virtual] |
Read a new value for this datasource from a human readable string.
The default does nothing.
Implements RTT::TypeInfo.
Definition at line 123 of file TypeInfoName.hpp.
virtual std::ostream& RTT::EmptyTypeInfo::write | ( | std::ostream & | os, | |
DataSourceBase::shared_ptr | in | |||
) | const [inline, virtual] |
Output this datasource as a human readable string.
The default just writes the type name in parentheses to os.
Implements RTT::TypeInfo.
Definition at line 114 of file TypeInfoName.hpp.