/std/string

As a convention for RTT 2.x typekits, types that don't want to be decomposed
should implement this function in their type info class:


            /**
             * A primitive type is decomposed into itself.
             */
            virtual base::DataSourceBase::shared_ptr 
decomposeType(base::DataSourceBase::shared_ptr source) const {
                return source;
            }


The typegen/orogen generated /std/string type does not implement this
function, hence, it is decomposed into 'char's at several places. Primitive
types like uint32 etc should also implement this virtual function.

For example in the taskbrowser:

Deployer [S]> import("myrobot")
3.901 [ Warning][TypekitRepository::Import] Overriding TypeInfo for 'string'
with '/std/string'.
= true

Deployer [S]> ls

Listing TaskContext Deployer[S] :

Configuration Properties:
/std/string RTT_COMPONENT_PATH = { [/, h, o, m, e, /, k, a, l, t, ...(42 items
omitted)... ], size = 52, capacity = 52 } (Locations to look for components.
Use a colon or semi-colon separated list of paths. Defaults to the environment
variable with the same name.)
...

Peter

/std/string

On Wednesday 26 January 2011 11:47:48 Peter Soetens wrote:
> As a convention for RTT 2.x typekits, types that don't want to be
> decomposed should implement this function in their type info class:
>
> 
>             /**
>              * A primitive type is decomposed into itself.
>              */
>             virtual base::DataSourceBase::shared_ptr
> decomposeType(base::DataSourceBase::shared_ptr source) const {
>                 return source;
>             }
>
>
> The typegen/orogen generated /std/string type does not implement this
> function, hence, it is decomposed into 'char's at several places. Primitive
> types like uint32 etc should also implement this virtual function.
>
> For example in the taskbrowser:
>
> Deployer [S]> import("myrobot")
> 3.901 [ Warning][TypekitRepository::Import] Overriding TypeInfo for
> 'string' with '/std/string'.
> = true
>
> Deployer [S]> ls
>
> Listing TaskContext Deployer[S] :
>
> Configuration Properties:
> /std/string RTT_COMPONENT_PATH = { [/, h, o, m, e, /, k, a, l, t, ...(42
> items omitted)... ], size = 52, capacity = 52 } (Locations to look for
> components. Use a colon or semi-colon separated list of paths. Defaults to
> the environment variable with the same name.)
> ...

A patch for orogen in attachment. I know it looks hackery, but std::string is
a special case, since one part of the application wants to treat it as a
container of chars, and the other part wants to treat it as a single 'string',
ie, when humans need to read it (xml file, taskbrowser).

Peter