Public Member Functions | Protected Types | Static Protected Member Functions | Protected Attributes
RTT::types::EnumTypeInfo< T > Struct Template Reference

#include <EnumTypeInfo.hpp>

Inheritance diagram for RTT::types::EnumTypeInfo< T >:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

template<class T>
struct RTT::types::EnumTypeInfo< T >

Type information for Enum types for which they are convertible to int.

See also:
StructTypeInfo

Definition at line 56 of file EnumTypeInfo.hpp.


Member Typedef Documentation

template<class T >
typedef std::map<T,std::string> RTT::types::EnumTypeInfo< T >::MapType [protected]

Definition at line 70 of file EnumTypeInfo.hpp.


Constructor & Destructor Documentation

template<class T >
RTT::types::EnumTypeInfo< T >::EnumTypeInfo ( std::string  type) [inline]

Definition at line 72 of file EnumTypeInfo.hpp.


Member Function Documentation

template<class T >
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.

Parameters:
sourcea DataSource<int> or DataSource<string>, generated by decomposeType().
resultAn 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.

template<class T >
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()

Returns:
a new DataSource containing an int or a string, null if source is not an enum of this type.

Reimplemented from RTT::types::PrimitiveTypeInfo< T, use_ostream >.

Definition at line 140 of file EnumTypeInfo.hpp.

template<class T >
static int RTT::types::EnumTypeInfo< T >::enum_to_int ( e) [inline, static, protected]

Definition at line 59 of file EnumTypeInfo.hpp.

template<class T >
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.

Parameters:
tiA valid TypeInfo object into which new features may be installed
Returns:
true if this object may be deleted, false if not.
Postcondition:
When true is returned, this instance is still valid and the caller (TypeInfoRepository) will delete it. When false is returned, the validity is undefined and the instance will not be used anymore by the caller.

Reimplemented from RTT::types::TemplateTypeInfo< T, false >.

Definition at line 77 of file EnumTypeInfo.hpp.

template<class T >
static T RTT::types::EnumTypeInfo< T >::int_to_enum ( int  i) [inline, static, protected]

Definition at line 64 of file EnumTypeInfo.hpp.


Member Data Documentation

template<class T >
std::map<T,std::string> RTT::types::EnumTypeInfo< T >::to_string [protected]

Definition at line 69 of file EnumTypeInfo.hpp.


The documentation for this struct was generated from the following file:


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