Public Member Functions | List of all members
RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream > Class Template Reference

#include <PrimitiveSequenceTypeInfo.hpp>

Inheritance diagram for RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >:
Inheritance graph
[legend]

Public Member Functions

base::AttributeBasebuildVariable (std::string name, int size) const
 
virtual bool composeType (base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const
 
virtual base::DataSourceBase::shared_ptr decomposeType (base::DataSourceBase::shared_ptr source) const
 
virtual base::DataSourceBase::shared_ptr getMember (base::DataSourceBase::shared_ptr item, const std::string &name) const
 
virtual base::DataSourceBase::shared_ptr getMember (base::DataSourceBase::shared_ptr item, base::DataSourceBase::shared_ptr id) const
 
virtual std::vector< std::string > getMemberNames () const
 
bool installTypeInfoObject (TypeInfo *ti)
 
 PrimitiveSequenceTypeInfo (std::string name)
 
virtual bool resize (base::DataSourceBase::shared_ptr arg, int size) const
 
- Public Member Functions inherited from RTT::types::PrimitiveTypeInfo< T, has_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
 
bool installTypeInfoObject (TypeInfo *ti)
 
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
 
- 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::SequenceTypeInfoBase< T >
base::AttributeBasebuildVariable (std::string name, int size) const
 
bool composeType (base::DataSourceBase::shared_ptr dssource, base::DataSourceBase::shared_ptr dsresult) const
 
base::DataSourceBase::shared_ptr decomposeType (base::DataSourceBase::shared_ptr source) const
 
base::DataSourceBase::shared_ptr getMember (base::DataSourceBase::shared_ptr item, const std::string &name) const
 
base::DataSourceBase::shared_ptr getMember (base::DataSourceBase::shared_ptr item, base::DataSourceBase::shared_ptr id) const
 
std::vector< std::string > getMemberNames () const
 
bool installTypeInfoObject (TypeInfo *ti)
 
bool resize (base::DataSourceBase::shared_ptr arg, int size) const
 
 SequenceTypeInfoBase ()
 
 ~SequenceTypeInfoBase ()
 
- Public Member Functions inherited from RTT::types::MemberFactory
virtual ~MemberFactory ()
 
virtual bool getMember (internal::Reference *ref, base::DataSourceBase::shared_ptr item, const std::string &name) const
 
- Public Member Functions inherited from RTT::types::CompositionFactory
virtual base::DataSourceBase::shared_ptr convertType (base::DataSourceBase::shared_ptr source) const
 
virtual ~CompositionFactory ()
 

Additional Inherited Members

- Public Types inherited from RTT::types::PrimitiveTypeInfo< T, has_ostream >
typedef T DataType
 
- Public Types inherited from RTT::types::TemplateValueFactory< T >
typedef T DataType
 
- Protected Attributes inherited from RTT::types::PrimitiveTypeInfo< T, has_ostream >
boost::shared_ptr< PrimitiveTypeInfo< T, use_ostream > > mshared
 
const std::string tname
 

Detailed Description

template<class T, bool has_ostream = false>
class RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >

New-style SequenceTypeInfo which offers type info for sequences which can NOT be sent over flow ports. This has huge code size reduction, while still being able to use these sequences in structs which are sent over flow ports.

Definition at line 57 of file PrimitiveSequenceTypeInfo.hpp.

Constructor & Destructor Documentation

template<class T , bool has_ostream = false>
RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::PrimitiveSequenceTypeInfo ( std::string  name)
inline

Definition at line 64 of file PrimitiveSequenceTypeInfo.hpp.

Member Function Documentation

template<class T , bool has_ostream = false>
base::AttributeBase* RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::buildVariable ( std::string  name,
int  sizehint 
) const
inlinevirtual

Build a modifyable instance of this type.

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

Reimplemented from RTT::types::ValueFactory.

Definition at line 85 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::composeType ( base::DataSourceBase::shared_ptr  source,
base::DataSourceBase::shared_ptr  target 
) const
inlinevirtual

Compose a type (target) from a DataSourceBase (source) containing its members. The default behavior tries to assign source to target. If that fails, it tries to decompose target into its members and update the members of target with the contents of source.

The default implementation in TemplateTypeInfo works for most types, but can be overridden in case there are multiple versions/possibilities to make a target from a source. For example, in order to support legacy formats or in order to do the inverse of decomposeType().

Parameters
sourceA data source of the same type as target OR a PropertyBag that contains the parts of target to be refreshed.
targetA data source of the same type as this TypeInfo object which contains the data to be updated from source.
Returns
true if source could be updated, false otherwise.
See also
types::propertyDecomposition and types::typeDecomposition for the inverse function, decomposing a type into datasources and hierarchical properties.
decomposeType to do the inverse operation.

Implements RTT::types::CompositionFactory.

Definition at line 90 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::decomposeType ( base::DataSourceBase::shared_ptr  source) const
inlinevirtual

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. If your return a datasource containing a property bag, then this function should do the inverse of composeType: the returned property bag contains all parts of the current type (source) which can be modified and merged back into this type with composeType. Mathematically: composeType( decomposeType( A ), B); assert( A == B );

Returns
null in order to indicate that decomposition through getMember() may be tried. You may return source itself in order to prevent any further decomposition of your type (using getMember(), which is used as fall-back by the rest of the software. For example, to avoid that a string is decomposed into a sequence of chars, or to avoid that a primitive type like 'int' is further queried.

Reimplemented from RTT::types::CompositionFactory.

Definition at line 99 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMember ( base::DataSourceBase::shared_ptr  item,
const std::string &  name 
) const
inlinevirtual

Returns a member of a given data source struct identified by its name.

Parameters
itemThe item of which to return a reference to a member
nameThe name of a member within item. Is a name of a member in case of a struct or an index number in case of a sequence.
Returns
null if no such member exists, an assignable datasource referencing that member otherwise.

Reimplemented from RTT::types::MemberFactory.

Definition at line 107 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual base::DataSourceBase::shared_ptr RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMember ( base::DataSourceBase::shared_ptr  item,
base::DataSourceBase::shared_ptr  id 
) const
inlinevirtual

Returns a member of a given data source identified by a data source id. This will be an int (for indexing) or a string (for the member name).

Warning
Currently this only works for a SequenceTypeInfo-like object. We don't implement this for StructTypeInfo-like objects, since that would be a very expensive implementation (memory wise).
Parameters
itemThe item of which to return a member
idOr a string data source containing the name of a member if item is a struct, Or an unsigned int data source containing the index of an element if item is a sequence

Reimplemented from RTT::types::MemberFactory.

Definition at line 111 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual std::vector<std::string> RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::getMemberNames ( ) const
inlinevirtual

Returns the list of struct member names of this type. In case this type is not a struct, returns an empty list.

Reimplemented from RTT::types::MemberFactory.

Definition at line 103 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::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 68 of file PrimitiveSequenceTypeInfo.hpp.

template<class T , bool has_ostream = false>
virtual bool RTT::types::PrimitiveSequenceTypeInfo< T, has_ostream >::resize ( base::DataSourceBase::shared_ptr  arg,
int  size 
) const
inlinevirtual

Tries to resize a data source in case it's a resizable sequence.

Returns
true if the resizing could be done, false otherwise.

Reimplemented from RTT::types::MemberFactory.

Definition at line 95 of file PrimitiveSequenceTypeInfo.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:48