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

#include <EnumTypeInfo.hpp>

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

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)
 
- Public Member Functions inherited from RTT::types::TemplateTypeInfo< T, false >
virtual base::ChannelElementBase::shared_ptr buildRemoteChannelOutput (base::OutputPortInterface &output_port, types::TypeInfo const *type_info, base::InputPortInterface &input, const ConnPolicy &policy)
 
bool installTypeInfoObject (TypeInfo *ti)
 
 TemplateTypeInfo (std::string name)
 
virtual ~TemplateTypeInfo ()
 
- Public Member Functions inherited from RTT::types::PrimitiveTypeInfo< T, use_ostream >
virtual bool decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const
 
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > getSharedPtr ()
 
TypeInfogetTypeInfoObject () const
 
virtual const std::string & getTypeName () const
 
virtual bool isStreamable () const
 
 PrimitiveTypeInfo (std::string name)
 
virtual std::istream & read (std::istream &os, base::DataSourceBase::shared_ptr out) const
 
virtual std::ostream & write (std::ostream &os, base::DataSourceBase::shared_ptr in) const
 
virtual ~PrimitiveTypeInfo ()
 
- Public Member Functions inherited from RTT::types::TypeInfoGenerator
virtual ~TypeInfoGenerator ()
 
- Public Member Functions inherited from RTT::types::TemplateValueFactory< T >
base::DataSourceBase::shared_ptr buildActionAlias (base::ActionInterface *action, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildAlias (std::string name, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const
 
base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const
 
virtual base::PropertyBasebuildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
 
virtual base::DataSourceBase::shared_ptr buildReference (void *ptr) const
 
virtual base::DataSourceBase::shared_ptr buildValue () const
 
base::AttributeBasebuildVariable (std::string name) const
 
- Public Member Functions inherited from RTT::types::ValueFactory
virtual ~ValueFactory ()
 
virtual base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr, int sizehint) const
 
virtual base::AttributeBasebuildVariable (std::string name, int sizehint) const
 
- Public Member Functions inherited from RTT::types::StreamFactory
virtual ~StreamFactory ()
 
virtual std::string toString (base::DataSourceBase::shared_ptr in) const
 
virtual bool fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const
 
- Public Member Functions inherited from RTT::types::TemplateConnFactory< T >
base::ChannelElementBase::shared_ptr buildChannelInput (base::OutputPortInterface &port, ConnPolicy const &policy) const
 
base::ChannelElementBase::shared_ptr buildChannelOutput (base::InputPortInterface &port, ConnPolicy const &policy) const
 
base::ChannelElementBase::shared_ptr buildDataStorage (ConnPolicy const &policy) const
 
internal::SharedConnectionBase::shared_ptr buildSharedConnection (base::OutputPortInterface *output_port, base::InputPortInterface *input_port, ConnPolicy const &policy) const
 
base::InputPortInterfaceinputPort (std::string const &name) const
 
base::OutputPortInterfaceoutputPort (std::string const &name) const
 
- Public Member Functions inherited from RTT::types::TemplateCompositionFactory< T >
virtual bool composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< T >::reference_t result) const
 
virtual bool decomposeTypeImpl (typename internal::AssignableDataSource< T >::const_reference_t source, PropertyBag &targetbag) const
 
- Public Member Functions inherited from RTT::types::CompositionFactory
virtual base::DataSourceBase::shared_ptr convertType (base::DataSourceBase::shared_ptr source) const
 
virtual ~CompositionFactory ()
 

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
 
- Protected Attributes inherited from RTT::types::PrimitiveTypeInfo< T, use_ostream >
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > mshared
 
const std::string tname
 

Additional Inherited Members

- Public Types inherited from RTT::types::TemplateTypeInfo< T, false >
typedef T UserType
 
- Public Types inherited from RTT::types::PrimitiveTypeInfo< T, use_ostream >
typedef T DataType
 
- Public Types inherited from RTT::types::TemplateValueFactory< T >
typedef T DataType
 
- Public Types inherited from RTT::types::TemplateCompositionFactory< T >
typedef T UserType
 

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
inlinevirtual

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
inlinevirtual

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)
inlinestaticprotected

Definition at line 59 of file EnumTypeInfo.hpp.

template<class T >
bool RTT::types::EnumTypeInfo< T >::installTypeInfoObject ( TypeInfo ti)
inlinevirtual

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.

Implements RTT::types::TypeInfoGenerator.

Definition at line 77 of file EnumTypeInfo.hpp.

template<class T >
static T RTT::types::EnumTypeInfo< T >::int_to_enum ( int  i)
inlinestaticprotected

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 Tue Jun 25 2019 19:33:46