$search
#include <EnumTypeInfo.hpp>
Public Member Functions | |
virtual bool | composeType (base::DataSourceBase::shared_ptr source, base::DataSourceBase::shared_ptr result) const |
virtual base::DataSourceBase::shared_ptr | decomposeType (base::DataSourceBase::shared_ptr source) const |
EnumTypeInfo (std::string type) | |
bool | installTypeInfoObject (TypeInfo *ti) |
Protected Types | |
typedef std::map< T, std::string > | MapType |
Static Protected Member Functions | |
static int | enum_to_int (T e) |
static T | int_to_enum (int i) |
Protected Attributes | |
std::map< T, std::string > | to_string |
Type information for Enum types for which they are convertible to int.
Definition at line 56 of file EnumTypeInfo.hpp.
typedef std::map<T,std::string> RTT::types::EnumTypeInfo< T >::MapType [protected] |
Definition at line 70 of file EnumTypeInfo.hpp.
RTT::types::EnumTypeInfo< T >::EnumTypeInfo | ( | std::string | type | ) | [inline] |
Definition at line 72 of file EnumTypeInfo.hpp.
virtual bool RTT::types::EnumTypeInfo< T >::composeType | ( | base::DataSourceBase::shared_ptr | source, | |
base::DataSourceBase::shared_ptr | result | |||
) | const [inline, virtual] |
Composition also checks if source is an int or string, and if so, converts it to the enum of type T kept in result.
source | a DataSource<int> or DataSource<string>, generated by decomposeType(). | |
result | An AssignableDataSource<T> that will get the new enum value. |
Reimplemented from RTT::types::PrimitiveTypeInfo< T, use_ostream >.
Definition at line 98 of file EnumTypeInfo.hpp.
virtual base::DataSourceBase::shared_ptr RTT::types::EnumTypeInfo< T >::decomposeType | ( | base::DataSourceBase::shared_ptr | source | ) | const [inline, virtual] |
Converts the enum to a string in case source is an enum and the string mapping is known. In case there is no string mapping, an int is returned. The conversion the other way around is done by composeType()
Reimplemented from RTT::types::PrimitiveTypeInfo< T, use_ostream >.
Definition at line 140 of file EnumTypeInfo.hpp.
static int RTT::types::EnumTypeInfo< T >::enum_to_int | ( | T | e | ) | [inline, static, protected] |
Definition at line 59 of file EnumTypeInfo.hpp.
bool RTT::types::EnumTypeInfo< T >::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, false >.
Definition at line 77 of file EnumTypeInfo.hpp.
static T RTT::types::EnumTypeInfo< T >::int_to_enum | ( | int | i | ) | [inline, static, protected] |
Definition at line 64 of file EnumTypeInfo.hpp.
std::map<T,std::string> RTT::types::EnumTypeInfo< T >::to_string [protected] |
Definition at line 69 of file EnumTypeInfo.hpp.