Orocos Real-Time Toolkit  2.9.0
Public Types | Public Member Functions | Protected Attributes | List of all members
RTT::types::BoolTypeInfo Struct Reference

Write boolean as 'true' or 'false'. More...

#include <rtt/typekit/BoolTypeInfo.hpp>

Inheritance diagram for RTT::types::BoolTypeInfo:
RTT::types::StdTypeInfo< bool > RTT::types::TemplateTypeInfo< bool, true > RTT::types::PrimitiveTypeInfo< bool, use_ostream > RTT::types::TemplateConnFactory< bool > RTT::types::TemplateCompositionFactory< bool > RTT::types::TypeInfoGenerator RTT::types::TemplateValueFactory< bool > RTT::types::StreamFactory RTT::types::CompositionFactory RTT::types::ValueFactory

Public Types

typedef bool UserType
 The given T parameter is the type for reading DataSources. More...
 
typedef bool DataType
 The given T parameter is the type of the DataSources. More...
 

Public Member Functions

 BoolTypeInfo ()
 
virtual std::ostream & write (std::ostream &os, base::DataSourceBase::shared_ptr in) const
 Output this datasource as a human readable string. More...
 
virtual std::istream & read (std::istream &os, base::DataSourceBase::shared_ptr out) const
 Read a new value for this datasource from a human readable string. More...
 
virtual bool isStreamable () const
 Returns true if this type is directly streamable using read()/write() or toString()/fromString(). More...
 
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
 A primitive type is decomposed into itself. More...
 
virtual bool decomposeType (base::DataSourceBase::shared_ptr source, PropertyBag &targetbag) const
 
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)
 Installs the type info object in the global data source type info handler and adds any additional features to the type info object. More...
 
boost::shared_ptr< PrimitiveTypeInfo< bool, use_ostream > > getSharedPtr ()
 
TypeInfogetTypeInfoObject () const
 Returns the TypeInfo object of this type, or null if none exists yet. More...
 
virtual const std::string & getTypeName () const
 Return the type name for which this generator generates type info features. More...
 
base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr dsb) const
 Build a non modifyable instance of this type. More...
 
base::AttributeBasebuildVariable (std::string name) const
 Build a non modifyable instance of this type. More...
 
base::AttributeBasebuildAttribute (std::string name, base::DataSourceBase::shared_ptr in) const
 Build an Attribute of this type. More...
 
base::AttributeBasebuildAlias (std::string name, base::DataSourceBase::shared_ptr in) const
 build an alias with b as the value. More...
 
base::DataSourceBase::shared_ptr buildActionAlias (base::ActionInterface *action, base::DataSourceBase::shared_ptr in) const
 Returns a DataSource that first executes an action and returns the result of another data source. More...
 
virtual base::PropertyBasebuildProperty (const std::string &name, const std::string &desc, base::DataSourceBase::shared_ptr source=0) const
 Build a Property of this type. More...
 
virtual base::DataSourceBase::shared_ptr buildValue () const
 Build a internal::ValueDataSource of this type. More...
 
virtual base::DataSourceBase::shared_ptr buildReference (void *ptr) const
 Build a internal::ReferenceDataSource of this type, pointing to the given pointer. More...
 
base::InputPortInterfaceinputPort (std::string const &name) const
 
base::OutputPortInterfaceoutputPort (std::string const &name) const
 
base::ChannelElementBase::shared_ptr buildDataStorage (ConnPolicy const &policy) const
 
base::ChannelElementBase::shared_ptr buildChannelOutput (base::InputPortInterface &port, ConnPolicy const &policy) const
 
base::ChannelElementBase::shared_ptr buildChannelInput (base::OutputPortInterface &port, ConnPolicy const &policy) const
 
internal::SharedConnectionBase::shared_ptr buildSharedConnection (base::OutputPortInterface *output_port, base::InputPortInterface *input_port, ConnPolicy const &policy) const
 
virtual bool composeTypeImpl (const PropertyBag &source, typename internal::AssignableDataSource< bool >::reference_t result) const
 User, implement this function in case you want to control reading the XML data format. More...
 
virtual bool decomposeTypeImpl (typename internal::AssignableDataSource< bool >::const_reference_t source, PropertyBag &targetbag) const
 User, implement this function in case you want to control writing the XML data format. More...
 
virtual base::DataSourceBase::shared_ptr convertType (base::DataSourceBase::shared_ptr source) const
 Specialize this function to return an alternate type which represents this one in a compatible way. More...
 
Type building/factory functions

Used to create objects that hold data of a certain type.

virtual base::AttributeBasebuildConstant (std::string name, base::DataSourceBase::shared_ptr, int sizehint) const
 Build a non modifyable instance of this type. More...
 
virtual base::AttributeBasebuildVariable (std::string name, int sizehint) const
 Build a modifyable instance of this type. More...
 
Conversion to/from text

Used to convert data to human readable text and vice versa.

virtual std::string toString (base::DataSourceBase::shared_ptr in) const
 Usability function which converts data to a string. More...
 
virtual bool fromString (const std::string &value, base::DataSourceBase::shared_ptr out) const
 Usability function which converts a string to data. More...
 

Protected Attributes

const std::string tname
 
boost::shared_ptr< PrimitiveTypeInfo< bool, use_ostream > > mshared
 

Detailed Description

Write boolean as 'true' or 'false'.

Definition at line 52 of file BoolTypeInfo.hpp.

Member Typedef Documentation

typedef bool RTT::types::PrimitiveTypeInfo< bool , use_ostream >::DataType
inherited

The given T parameter is the type of the DataSources.

Definition at line 44 of file PrimitiveTypeInfo.hpp.

typedef bool RTT::types::TemplateTypeInfo< bool , use_ostream >::UserType
inherited

The given T parameter is the type for reading DataSources.

Definition at line 83 of file TemplateTypeInfo.hpp.

Constructor & Destructor Documentation

RTT::types::BoolTypeInfo::BoolTypeInfo ( )
inline

Definition at line 54 of file BoolTypeInfo.hpp.

Member Function Documentation

base::DataSourceBase::shared_ptr RTT::types::TemplateValueFactory< bool >::buildActionAlias ( base::ActionInterface action,
base::DataSourceBase::shared_ptr  in 
) const
inlinevirtualinherited

Returns a DataSource that first executes an action and returns the result of another data source.

If source is an AssignableDataSource, an AssignableDataSource is returned of the same type, otherwise, a plain DataSource is returned.

Implements RTT::types::ValueFactory.

Definition at line 62 of file TemplateValueFactory.hpp.

References RTT::internal::DataSource< T >::get(), and RTT::internal::ActionAliasAssignableDataSource< T >::get().

base::AttributeBase* RTT::types::TemplateValueFactory< bool >::buildAlias ( std::string  name,
base::DataSourceBase::shared_ptr  in 
) const
inlinevirtualinherited

build an alias with b as the value.

If b is of the wrong type, 0 will be returned..

Implements RTT::types::ValueFactory.

Definition at line 54 of file TemplateValueFactory.hpp.

References RTT::types::TypeInfo::convert(), and RTT::internal::DataSourceTypeInfo< T >::getTypeInfo().

base::AttributeBase* RTT::types::TemplateValueFactory< bool >::buildAttribute ( std::string  name,
base::DataSourceBase::shared_ptr  in 
) const
inlinevirtualinherited

Build an Attribute of this type.

Implements RTT::types::ValueFactory.

Definition at line 40 of file TemplateValueFactory.hpp.

References RTT::internal::ValueDataSource< T >::get(), and RTT::internal::AssignableDataSource< T >::narrow().

base::ChannelElementBase::shared_ptr RTT::types::TemplateConnFactory< bool >::buildChannelInput ( base::OutputPortInterface port,
ConnPolicy const &  policy 
) const
inlineinherited
base::ChannelElementBase::shared_ptr RTT::types::TemplateConnFactory< bool >::buildChannelOutput ( base::InputPortInterface port,
ConnPolicy const &  policy 
) const
inlineinherited
base::AttributeBase* RTT::types::TemplateValueFactory< bool >::buildConstant ( std::string  name,
base::DataSourceBase::shared_ptr  dsb 
) const
inlinevirtualinherited

Build a non modifyable instance of this type.

Parameters
sizehintFor variable size instances, use it to hint the size of the instance.

Implements RTT::types::ValueFactory.

Definition at line 20 of file TemplateValueFactory.hpp.

References RTT::types::TypeInfo::convert(), RTT::internal::DataSource< T >::get(), RTT::internal::DataSourceTypeInfo< T >::getTypeInfo(), and RTT::internal::DataSource< T >::rvalue().

AttributeBase * RTT::ValueFactory::buildConstant ( std::string  name,
base::DataSourceBase::shared_ptr  dsb,
int  sizehint 
) const
virtualinherited

Build a non modifyable instance of this type.

Parameters
sizehintFor variable size instances, use it to hint the size of the instance.

Definition at line 14 of file ValueFactory.cpp.

base::ChannelElementBase::shared_ptr RTT::types::TemplateConnFactory< bool >::buildDataStorage ( ConnPolicy const &  policy) const
inlineinherited

Definition at line 22 of file TemplateConnFactory.hpp.

virtual base::PropertyBase* RTT::types::TemplateValueFactory< bool >::buildProperty ( const std::string &  name,
const std::string &  desc,
base::DataSourceBase::shared_ptr  source = 0 
) const
inlinevirtualinherited

Build a Property of this type.

Implements RTT::types::ValueFactory.

Definition at line 74 of file TemplateValueFactory.hpp.

virtual base::DataSourceBase::shared_ptr RTT::types::TemplateValueFactory< bool >::buildReference ( void *  ptr) const
inlinevirtualinherited

Build a internal::ReferenceDataSource of this type, pointing to the given pointer.

Implements RTT::types::ValueFactory.

Definition at line 90 of file TemplateValueFactory.hpp.

virtual base::ChannelElementBase::shared_ptr RTT::types::TemplateTypeInfo< bool , use_ostream >::buildRemoteChannelOutput ( base::OutputPortInterface output_port,
types::TypeInfo const *  type_info,
base::InputPortInterface input,
const ConnPolicy policy 
)
inlinevirtualinherited

Definition at line 102 of file TemplateTypeInfo.hpp.

internal::SharedConnectionBase::shared_ptr RTT::types::TemplateConnFactory< bool >::buildSharedConnection ( base::OutputPortInterface output_port,
base::InputPortInterface input_port,
ConnPolicy const &  policy 
) const
inlineinherited
virtual base::DataSourceBase::shared_ptr RTT::types::TemplateValueFactory< bool >::buildValue ( ) const
inlinevirtualinherited

Build a internal::ValueDataSource of this type.

Implements RTT::types::ValueFactory.

Definition at line 87 of file TemplateValueFactory.hpp.

base::AttributeBase* RTT::types::TemplateValueFactory< bool >::buildVariable ( std::string  name) const
inlinevirtualinherited

Build a non modifyable instance of this type.

Parameters
sizehintFor variable size instances, use it to hint the size of the instance.

Implements RTT::types::ValueFactory.

Definition at line 33 of file TemplateValueFactory.hpp.

AttributeBase * RTT::ValueFactory::buildVariable ( std::string  name,
int  sizehint 
) const
virtualinherited
virtual bool RTT::types::StdTypeInfo< bool >::composeType ( base::DataSourceBase::shared_ptr  source,
base::DataSourceBase::shared_ptr  result 
) const
inlinevirtualinherited

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

Definition at line 65 of file StdTypeInfo.hpp.

virtual bool RTT::types::TemplateCompositionFactory< bool >::composeTypeImpl ( const PropertyBag source,
typename internal::AssignableDataSource< bool >::reference_t  result 
) const
inlinevirtualinherited

User, implement this function in case you want to control reading the XML data format.

Definition at line 61 of file TemplateCompositionFactory.hpp.

base::DataSourceBase::shared_ptr CompositionFactory::convertType ( base::DataSourceBase::shared_ptr  source) const
virtualinherited

Specialize this function to return an alternate type which represents this one in a compatible way.

For example, a short converts to an long or an enum to an int or a string.

Returns
null if this type is not convertible to anything else.
Deprecated:
by decomposeType. We want to rename convertType to decomposeType. This function is left here for transitional purposes.

Definition at line 6 of file CompositionFactory.cpp.

Referenced by RTT::types::CompositionFactory::decomposeType().

virtual base::DataSourceBase::shared_ptr RTT::types::StdTypeInfo< bool >::decomposeType ( base::DataSourceBase::shared_ptr  source) const
inlinevirtualinherited

A primitive type is decomposed into itself.

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

Definition at line 75 of file StdTypeInfo.hpp.

virtual bool RTT::types::PrimitiveTypeInfo< bool , use_ostream >::decomposeType ( base::DataSourceBase::shared_ptr  source,
PropertyBag targetbag 
) const
inlinevirtualinherited

Definition at line 123 of file PrimitiveTypeInfo.hpp.

virtual bool RTT::types::TemplateCompositionFactory< bool >::decomposeTypeImpl ( typename internal::AssignableDataSource< bool >::const_reference_t  source,
PropertyBag targetbag 
) const
inlinevirtualinherited

User, implement this function in case you want to control writing the XML data format.

Add the structural elements of source to targetbag.

Definition at line 69 of file TemplateCompositionFactory.hpp.

bool StreamFactory::fromString ( const std::string &  value,
base::DataSourceBase::shared_ptr  out 
) const
virtualinherited

Usability function which converts a string to data.

Definition at line 23 of file StreamFactory.cpp.

boost::shared_ptr<PrimitiveTypeInfo<bool , use_ostream> > RTT::types::PrimitiveTypeInfo< bool , use_ostream >::getSharedPtr ( )
inlineinherited

Definition at line 62 of file PrimitiveTypeInfo.hpp.

TypeInfo* RTT::types::PrimitiveTypeInfo< bool , use_ostream >::getTypeInfoObject ( ) const
inlinevirtualinherited

Returns the TypeInfo object of this type, or null if none exists yet.

Returns
All generators should return here TypeInfoRepository::Instance()->getTypeInfo<T>();

Implements RTT::types::TypeInfoGenerator.

Definition at line 84 of file PrimitiveTypeInfo.hpp.

virtual const std::string& RTT::types::PrimitiveTypeInfo< bool , use_ostream >::getTypeName ( ) const
inlinevirtualinherited

Return the type name for which this generator generates type info features.

This name will be aliased by the TypeInfo object.

Implements RTT::types::TypeInfoGenerator.

Definition at line 88 of file PrimitiveTypeInfo.hpp.

base::InputPortInterface* RTT::types::TemplateConnFactory< bool >::inputPort ( std::string const &  name) const
inlineinherited

Definition at line 19 of file TemplateConnFactory.hpp.

bool RTT::types::TemplateTypeInfo< bool , use_ostream >::installTypeInfoObject ( TypeInfo ti)
inlinevirtualinherited

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::PrimitiveTypeInfo< bool, use_ostream >.

Definition at line 109 of file TemplateTypeInfo.hpp.

virtual bool RTT::types::BoolTypeInfo::isStreamable ( ) const
inlinevirtual

Returns true if this type is directly streamable using read()/write() or toString()/fromString().

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

Definition at line 83 of file BoolTypeInfo.hpp.

base::OutputPortInterface* RTT::types::TemplateConnFactory< bool >::outputPort ( std::string const &  name) const
inlineinherited

Definition at line 20 of file TemplateConnFactory.hpp.

virtual std::istream& RTT::types::BoolTypeInfo::read ( std::istream &  os,
base::DataSourceBase::shared_ptr  out 
) const
inlinevirtual

Read a new value for this datasource from a human readable string.

The default does nothing.

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

Definition at line 69 of file BoolTypeInfo.hpp.

References RTT::internal::AssignableDataSource< T >::set(), and RTT::base::DataSourceBase::updated().

string StreamFactory::toString ( base::DataSourceBase::shared_ptr  in) const
virtualinherited

Usability function which converts data to a string.

Definition at line 12 of file StreamFactory.cpp.

virtual std::ostream& RTT::types::BoolTypeInfo::write ( std::ostream &  os,
base::DataSourceBase::shared_ptr  in 
) const
inlinevirtual

Output this datasource as a human readable string.

The default just writes the type name in parentheses to os.

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

Definition at line 59 of file BoolTypeInfo.hpp.

References RTT::internal::DataSource< T >::value().

Member Data Documentation

boost::shared_ptr<PrimitiveTypeInfo<bool , use_ostream> > RTT::types::PrimitiveTypeInfo< bool , use_ostream >::mshared
protectedinherited

Definition at line 39 of file PrimitiveTypeInfo.hpp.

const std::string RTT::types::PrimitiveTypeInfo< bool , use_ostream >::tname
protectedinherited

Definition at line 38 of file PrimitiveTypeInfo.hpp.


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